What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » How to make a menu and commands?

How to make a menu and commands?
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: How to make a menu and commands?
Wow I guess I should look at my coding before posting it...

Ok first things first in __commands.js we need to edit a line
js code:
(typeof sParameter === 'undefined' ? '' : '<Parameters>&lt;'+LoadString('CommandDelay')+'&gt;</Parameters>')+
Change to:
js code:
>>>(typeof sParameter === 'undefined' ? '' : '<Parameters>&lt;'+sParameter+'&gt;</Parameters>')+<<<
Glad I found this because the code is used in Screenshot Sender as well! Oopsies!

And these functions needs to be changed:
js code:
function OnGetScriptCommands(){
    var oCommand = new Commands();
    with (oCommand) {
        AddCommand('mycommand1', 'My command without parameter');
>>>        AddCommand('mycommand1', 'My command with parameter', 'Enter a parameter');<<<
    }
    return oCommand.ExportCommands();   
}


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 'mycommand':
                if ( _param !== '' ) {
                    /*
                        Do stuff here
                    */
                } else {
                    /*
                        Do stuff here
                    */
                }
                break;
        }
    }
}

This post was edited on 02-12-2009 at 01:58 PM by matty.
02-12-2009 01:56 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
How to make a menu and commands? - by Dr Nick on 02-11-2009 at 02:51 AM
RE: How to make a menu and commands? - by matty on 02-11-2009 at 01:46 PM
RE: How to make a menu and commands? - by Spunky on 02-11-2009 at 02:35 PM
RE: How to make a menu and commands? - by matty on 02-11-2009 at 03:18 PM
RE: How to make a menu and commands? - by Dr Nick on 02-12-2009 at 06:30 AM
RE: How to make a menu and commands? - by djdannyp on 02-12-2009 at 10:50 AM
RE: How to make a menu and commands? - by matty on 02-12-2009 at 01:56 PM
RE: How to make a menu and commands? - by Dr Nick on 02-13-2009 at 06:55 AM
RE: How to make a menu and commands? - by Dr Nick on 02-13-2009 at 06:58 AM
RE: How to make a menu and commands? - by Th3rmal on 02-13-2009 at 07:06 AM
RE: How to make a menu and commands? - by matty on 02-13-2009 at 07:08 AM
RE: How to make a menu and commands? - by Dr Nick on 02-13-2009 at 08:08 AM
RE: How to make a menu and commands? - by matty on 02-13-2009 at 01:45 PM
RE: How to make a menu and commands? - by Dr Nick on 02-13-2009 at 11:41 PM
RE: How to make a menu and commands? - by matty on 02-14-2009 at 04:23 AM
RE: How to make a menu and commands? - by Dr Nick on 02-14-2009 at 08:02 AM


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