quote:
If you read your code you'd understand that because you don't do that, it causes your whole code to fail. Also doing that won't make the command show, as it returns the message if it is counting.
I wrote this myself! I just only thought about the first time the event is triggerd (when you type /countdown).
Now, it's really not that complex... I mean, how complex can 100 lines of basic JScript be...
The flow of the program:
-receive message
-check if its a command (checkCommand())
-if its a command, what command? (getCommand())
-switch between the known commands (switch statement)
-if the command is 'countdown', call 'countDown()'
-add a timer and send a message (sendMessage)
Since JScript doesnt support propper OO, I can't put this in nice, structured classes
.
And from your code, i take it that type conversion is done automaticly ?