What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » /commands

/commands
Author: Message:
sadfib
New Member
*


Posts: 3
Joined: May 2009
O.P. /commands
I know how to make the / command with xml formatting but how do I actually use it?

for example
code:
function OnGetScriptCommands() {
    var ScriptCommands = "<ScriptCommands>";
    ScriptCommands      +=    "<Command>";
    ScriptCommands      +=        "<Name>Test</Name>";
    ScriptCommands      +=        "<Description>More Test</Description>";
    ScriptCommands      +=    "</Command>";
    ScriptCommands      += "</ScriptCommands>";

    return ScriptCommands;
}


But how do I use ScriptCommands to do something? I only know how to code Gamemaker which Isn't at all like this.
05-19-2009 11:09 AM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: /commands
js code:
function OnEvent_ChatWndSendMessage(oChatWnd, sMessage){
    if (/^\/([^\s\/]+)\s*([\s\S]*)$/.exec(sMessage) !== null) {
       
        var _command = RegExp.$1.toLowerCase();
        var _param = RegExp.$2;
        switch (_command) {
            case 'test':
                // do something here
                break;
            case 'test1':
                // do something here
                break;
        }
    }   
    return sMessage;
}
05-19-2009 01:03 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On