quote:
Originally posted by Stigmata
code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
var CMD = Message.split(" ", 1);
Debug.Trace(CMD[0]);
if(MessageKind == 1){
switch(CMD[0]){
case "!date" : ChatWnd.SendMessage("The date is: (!D)"); break;
case "!time" : ChatWnd.SendMessage("The time is: (!T)"); break;
}
}
}
the debug shows that the correct (splitted) string was used.
The split function returns an Array!! Try the code above.