quote:
Originally posted by SamV522
Ok. So I've tried quite a few different things with sending a response, but it crashes whenever I try and send a message...
What am I doing wrong?
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Origin, Message, MessageKind){
if (Message.substr(0,6).toLowerCase() == "/AwayI"){
var param = Message.substr(7);
switch(param){
case "enable":
AI.State = true;
break;
case "disable":
AI.State = false;
break;
case "commands":
alert("Enable\nDisable\nCommands");
break;
/*default:
alert("Invalid Command! Type \"/AwayI Commands\" to see a list of valid commands");
break;
*/
}
}
}
Unless alert is your own custom function, it will fail. MP!L doesn't have an alert function. You can call a msgbox by using the relevant Win32 APIs or you can use Debug.Print to see it in the debug area. It shouldn't crash though, unless you just mean theres an error...
EDIT: Too slow, had to read other tabs first ¬_¬