Posted 09 July 2014 - 11:30 PM
I need help with the part of identifying if args was given or not.
It's at the "Stop" command
if anyone can help, I'll appreciate it.
It's at the "Stop" command
Spoiler
--Manage Server Commands and Messages.
function chat()
newLine()
term.write( "[Server] " )
local input = read()
if input == nil then
line = line - 1
newLine()
end
if aC == "True" then
if input:sub(1,1) == "/" then
local cmd,args = input:match("/(%S+) ?(.*)")
if cmd == "help" then
printHelp()
elseif cmd == "stop" then
if args == nil or args == " " then
stop = true
stopServer()
else
timeLeft = args
repeat
newLine()
term.write( "[Server] will close in "..timeLeft )
timeLeft = timeLeft - 1
sleep(1)
until timeLeft <= 0
stop = true
stopServer()
end
elseif cmd == "time" then
local utime = os.time()
local time = textutils.formatTime( utime, false )
newLine()
term.write( "[Server][Time]["..time.."]" )
elseif cmd == "version" then
printVersion()
elseif cmd == "ban" then
ban(args)
elseif cmd == "list_banned" then
checkBanned()
newLine()
term.write( "[Server] "..BIDs )
elseif cmd == nil then
newLine()
term.write( "[Server][Error] No Command Entered" )
else
newLine()
term.write( "[Server][Error] Command /"..cmd.." unknown" )
end
end
end
end
Edited on 09 July 2014 - 09:31 PM