mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-15 18:30:27 -04:00
Make port number optional in irc.lua
This commit is contained in:
parent
43193a59c6
commit
8b8ee1cb88
@ -17,13 +17,17 @@ local text = require("text")
|
||||
|
||||
local args, options = shell.parse(...)
|
||||
if #args < 1 then
|
||||
print("Usage: irc <nickname> [server:port]")
|
||||
print("Usage: irc <nickname> [server[:port]]")
|
||||
return
|
||||
end
|
||||
|
||||
local nick = args[1]
|
||||
local host = args[2] or "irc.esper.net:6667"
|
||||
|
||||
if not host:find(":") then
|
||||
host = host .. ":6667"
|
||||
end
|
||||
|
||||
-- try to connect to server.
|
||||
local sock, reason = internet.open(host)
|
||||
if not sock then
|
||||
|
Loading…
x
Reference in New Issue
Block a user