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

Command parser not working
Author: Message:
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
O.P. Huh?  Command parser not working
Hi,

I am experiencing a problem with a new way of parsing commands.

The following code displays an error about invalid commands:

code:
function OnEvent_ChatWndSendMessage(pChatWnd,sMessage) {
    if(Initialised) {
        isCommand = parseCommands(pChatWnd,sMessage.toLowerCase());
        if(isCommand) {
            return "";
        }
        return sMessage;
    }
}

function parseCommands(objChatWnd,strMessage) {
    if(strMessage.substr(1,12) == "skincreator" && strMessage.charAt(0) == "/") {
        Splitter = sterMessage.split(" ");
        FunctionName = Splitter[1];
        if(FunctionName == "openskin") {
            Skin.Name = strMessage.substr(21);
            BrowseFile(Skin.Dir + "\\" + Skin.Name,"xml");
        }
        return true;
    } else {
        return false;
    }
}


To make things worse, nothing shows up in the debugger.

Does anyone know what's wrong with this code?

Tnx in advance.
07-16-2008 09:42 PM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Command parser not working
code:
function OnEvent_ChatWndSendMessage(pChatWnd,sMessage) {
    if(Initialised) {
        isCommand = parseCommands(pChatWnd, sMessage.toLowerCase());
        if(isCommand) {
            return "";
        }
        return sMessage;
    }
}

function parseCommands(objChatWnd,strMessage) {
    if(strMessage.substr(1,12) == "skincreator" && strMessage.charAt(0) == "/") {
        Splitter = sterMessage.split(" ");
        FunctionName = Splitter[1];
        if(FunctionName == "openskin") {
            Skin.Name = strMessage.substr(21);
            BrowseFile(Skin.Dir + "\\" + Skin.Name,"xml");
        }
        return true;
    } else {
        return false;
    }
}
07-16-2008 11:32 PM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
O.P. RE: Command parser not working
Err.. I don't see much difference between your code and mine.. And besides, it doesn't work either.. *-)
07-17-2008 07:30 AM
Profile PM Find Quote Report
Volv
Skinning Contest Winner
*****

Avatar

Posts: 1233
Reputation: 31
35 / Male / Flag
Joined: Oct 2004
RE: Command parser not working
I think he highlighted your problem. There is no sterMessage variable.

This post was edited on 07-17-2008 at 07:55 AM by Volv.
07-17-2008 07:54 AM
Profile PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
O.P. RE: Command parser not working
:wall:

Sorry!! :$

I didn't see that typo, and I can barely see bold text on my monitor :S
07-17-2008 08:00 AM
Profile 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