Shoutbox

Invalid command? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Invalid command? (/showthread.php?tid=74362)

Invalid command? by hidendra on 05-13-2007 at 09:52 PM

Hi,
I am making my own Bot, I have most of it done, and since I've started, I've gotten the 'unknown command' with "/" commands, but they work fine.
How do you add it to the command list for Plus? When I try, it won't Re-Run when I save it.

Thanks in advance:)


RE: Invalid command? by roflmao456 on 05-13-2007 at 10:47 PM

try posting your code here and we'll see + fix errors.


the code for adding your commands (my way :tongue:):

code:
function OnGetScriptCommands(){
var SC = "<ScriptCommands>";
SC += "<Command>";
SC += "<Name>Your_Command</Name>";
SC += "<Description>Your description.</Description>";
// SC += "<Parameters>Optional. uncomment this if you want</Parameters>";
SC += "</Command>";

SC += "</ScriptCommands>";
return SC;
}

// to parse.
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
if(Message.toLowerCase() == "/your_command"){
/* if(Message.length <= 13){ // for getting the parameter
return "/me";
}
*/

/* do something here */

return ""
}
}


RE: Invalid command? by hidendra on 05-13-2007 at 10:58 PM

XD I commented out my old WndSendMessage, and replaced with yours, tested with /check, and worked fine -,=;; I had some huge ass thing for my way XDD. Thought already had OnGetScriptCommands, so no need to add that =D
So yea, gunna convert my commands. Thanks :P


RE: Invalid command? by Matti on 05-14-2007 at 03:35 PM

roflmao456, I understand that if you have no problems with the way you're parsing a command, well, fine then. But keep in mind that is NOT the way it should be. CookieRevised made an excellent post about this including example code which respects the original rules of Plus! commands, check it out: CookieRevised's reply to [Release] Exit WLM.