What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Help-command not working

Help-command not working
Author: Message:
Jimbo
Veteran Member
*****

Avatar

Posts: 1650
Reputation: 18
31 / Male / Flag
Joined: Jul 2006
O.P. RE: Help-command not working
thanks markee

so, this would work?
[code]

function OnEvent_ChatWndSendMessage(ChatWnd, sMessage) {

    if(sMessage.charAt(0) == "/"){
        return parseCommands(sMessage,ChatWnd);
    }
}
function parseCommands(sMessage,iOriginWnd){

    if (sMessage.charAt(0) == '/'){
        if(sMessage.charAt(1) == '/'){
            return sMessage;
        } else {
            var firstSpace = sMessage.search(' ');
            if(firstSpace == -1){
                var command = sMessage.toLowerCase().substr(1);
                var params = '';
            } else {
                var command = sMessage.toLowerCase().substr(1, firstSpace-1);
                var params = sMessage.substr(firstSpace+1);
            }
            if(params != "") { Debug.Trace("The command \"" + command + "\" with the parameters \"" + params + "\" has been parsed."); }
            else { Debug.Trace("The command \"" + command + "\" has been parsed."); }
            switch(command) {
                case 'colour=red':
                    iOriginWnd.SendMessage("4"+params);
                    sMessage = '';
                    break;
                case 'colour=blue':
                    iOriginWnd.SendMessage("12"+params);
                    sMessage = '';
                    break;
                case 'colour=green':
                    iOriginWnd.SendMessage("50"+params);
                    sMessage = '';
                    break;
                case 'colour=yellow':
                    iOriginWnd.SendMessage("8"+params);
                    sMessage = '';
                    break;
                case 'colour=purple':
                    iOriginWnd.SendMessage("6"+params);
                    sMessage = '';
                    break;
                case 'colour=pink':
                    iOriginWnd.SendMessage("13"+params);
                    sMessage = '';
                    break;
                case 'colour=orange':
                    iOriginWnd.SendMessage("36"+params);
                    sMessage = '';
                    break;
                case 'colour=lilac':
                    iOriginWnd.SendMessage("21"+params);
                    sMessage = '';
                    break;
default:
            }
        }
    }
    return sMessage;
}
function OnGetScriptCommands()
{
    var commands = '<ScriptCommands>';
        commands+='<Command>';
            commands+='<Name>colour=red</Name>';
            commands+='<Description>'+"Change colour of text to red"+'</Description>';
            commands+='<Parameters>Message</Parameters>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>colour=blue</Name>';
            commands+='<Description>'+"Change colour of text to blue"+'</Description>';
            commands+='<Parameters>Message</Parameters>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>colour=green</Name>';
            commands+='<Description>'+"Change colour of text to green"+'</Description>';
            commands+='<Parameters>Message</Parameters>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>colour=yellow</Name>';
            commands+='<Description>'+"Change colour of text to yellow"+'</Description>';
            commands+='<Parameters>Message</Parameters>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>colour=orange</Name>';
            commands+='<Description>'+"Change colour of text to orange"+'</Description>';
            commands+='<Parameters>Message</Parameters>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>colour=pink</Name>';
            commands+='<Description>'+"Change colour of text to pink"+'</Description>';
            commands+='<Parameters>Message</Parameters>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>colour=purple</Name>';
            commands+='<Description>'+"Change colour of text to purple"+'</Description>';
            commands+='<Parameters>Message</Parameters>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>colour=lilac</Name>';
            commands+='<Description>'+"Change colour of text to lilac"+'</Description>';
            commands+='<Parameters>Message</Parameters>';
        commands+='</Command>';
    commands+='</ScriptCommands>';
    return commands;
}
09-01-2006 09:00 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Help-command not working - by Jimbo on 09-01-2006 at 08:30 AM
RE: Help-command not working - by ForestPlus! on 09-01-2006 at 08:44 AM
RE: Help-command not working - by Jimbo on 09-01-2006 at 08:46 AM
RE: Help-command not working - by ForestPlus! on 09-01-2006 at 08:50 AM
RE: Help-command not working - by Jimbo on 09-01-2006 at 08:51 AM
RE: Help-command not working - by ForestPlus! on 09-01-2006 at 08:55 AM
RE: Help-command not working - by Jimbo on 09-01-2006 at 08:56 AM
RE: RE: Help-command not working - by CookieRevised on 09-01-2006 at 09:16 AM
RE: Help-command not working - by markee on 09-01-2006 at 08:58 AM
RE: Help-command not working - by Jimbo on 09-01-2006 at 09:00 AM
RE: Help-command not working - by markee on 09-01-2006 at 09:04 AM
RE: Help-command not working - by Jimbo on 09-01-2006 at 09:08 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