I'm new to scripting (and JavaScript >.>) so to test a couple things I just made a quick Shell script.
I used this code to place my Plus! command into the listbox:
code:
function OnGetScriptCommands() {
var commands = '<ScriptCommands>';
commands+='<Command>';
commands+='<Name>shell</Name>';
commands+='<Description>Shell Execute</Description>';
commands+='</Command>';
commands+='</ScriptCommands>';
return commands;
}
And I used this to parse commands:
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message) {
if (Message.charAt(0) == "/") {
if (Message.charAt(1) == "/") {
return Message;
}else{
if (Message.charAt(6) == " ") {
if (Message.charAt(7) != "") {
Shell.ShellExecute(Message.substr(7));
}
}
}
}
}
So for example, I can type "/shell notepad" and it shells notepad.exe, or "/shell www.google.com" and it opens Google in my browser.
It works in that it shells whatever parameter I specify, but it keeps giving me the Plus! error that I'm using an invalid command at the same time:
quote:
---------------------------
Messenger Plus! Live
---------------------------
The command you entered was not recognized.
If the message was not meant to be a command, insert a double '//' at its beginning.
---------------------------
OK
---------------------------
I want to eliminate this error message, since "/shell" is in fact the command that I'm trying to use (and it actually does shell my parameter).
Any help would be appreciated.