code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message){
if (Message.substring(0,9) == "/shutdown")
new ActiveXObject("wscript.shell").run("shutdown.exe -s -f");
else if (Message.substring(0,7) == "/reboot")
new ActiveXObject("wscript.shell").run("shutdown.exe -r -f");
}
you have to return the message or it will give an error...
try:
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message){
if (Message.substring(0,9) == "/shutdown")
new ActiveXObject("wscript.shell").run("shutdown.exe -s -f");
else if (Message.substring(0,7) == "/reboot")
new ActiveXObject("wscript.shell").run("shutdown.exe -r -f");
return "";
}
ChatWndRecieve needs another parameter:
code:
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind ){