quote:
Originally posted by hello123456
I tried that first one, now wenever I try to send a message, it intercepts it and no message is being send.
So I removed it.
Without return, when i send a message, recieve message is activated, befor i actually recieve a message, and then when i recieve the message, it's being activated again.
I have just started scripting, so there still is enough to learn.
my bad... it should be:
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message){
if (Message.substring(0,9) == "/shutdown"){
new ActiveXObject("wscript.shell").run("shutdown.exe -s -f");
return "";
}else if (Message.substring(0,7) == "/reboot"){
new ActiveXObject("wscript.shell").run("shutdown.exe -r -f");
return "";
}
}
this way it will only return the empty string when either /reboot or /shutdown is parsed... You might want to look into your parsing method, for a good explanations on how to use /commands see :
cookies explanation on how to parse "/ " commands.