What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Need Help with my First Script

Need Help with my First Script
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Need Help with my First Script
Your OnEvent_ChatWndSendMessage function is wrong. For starters the main if-then-statement will never return true since you change everything to lowercase and compare it with a mixed case string. Second, you must(!) return the original message if it isn't a command of your command.

corrected:
Javascript code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
    if (Message.substr(0,6).toLowerCase() == "/awayi"){        var param = Message.substr(7);
        switch(param){
            case "enable":
                AI.State = true;
                return "";
            case "disable":
                AI.State = false;
                return "";
            case "commands":
                var WindowOptions=MsgPlus.CreateWnd("Commands.xml","CommandsWND");
                return "";
            /*default:
                alert("Invalid Command! Type \"/AwayI Commands\" to see a list of valid commands");
                break;
                */
        }
    } else {        return Message;    }
}


---------

In the OnEvent_ChatWndReceiveMessage function you first must check if you actually can send a message. See point 3 in my previous post.

And also, just as in OnEvent_ChatWndSendMessage, you must(!) return the original message if you're not going to change it.

This post was edited on 11-24-2009 at 08:47 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
11-24-2009 08:35 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Need Help with my First Script - by SamV522 on 11-24-2009 at 04:54 PM
RE: Need Help with my First Script - by SourSpud on 11-24-2009 at 04:58 PM
RE: Need Help with my First Script - by SamV522 on 11-24-2009 at 05:00 PM
RE: Need Help with my First Script - by SourSpud on 11-24-2009 at 05:02 PM
RE: Need Help with my First Script - by SamV522 on 11-24-2009 at 05:12 PM
RE: Need Help with my First Script - by CookieRevised on 11-24-2009 at 05:14 PM
RE: Need Help with my First Script - by SamV522 on 11-24-2009 at 05:43 PM
RE: Need Help with my First Script - by SamV522 on 11-24-2009 at 06:10 PM
RE: Need Help with my First Script - by matty on 11-24-2009 at 06:20 PM
RE: Need Help with my First Script - by SamV522 on 11-24-2009 at 06:24 PM
RE: Need Help with my First Script - by Spunky on 11-24-2009 at 06:25 PM
RE: Need Help with my First Script - by SamV522 on 11-24-2009 at 06:32 PM
RE: Need Help with my First Script - by matty on 11-24-2009 at 06:53 PM
RE: Need Help with my First Script - by SamV522 on 11-24-2009 at 07:16 PM
RE: Need Help with my First Script - by matty on 11-24-2009 at 07:19 PM
RE: Need Help with my First Script - by SamV522 on 11-24-2009 at 07:23 PM
RE: Need Help with my First Script - by SamV522 on 11-24-2009 at 07:55 PM
RE: Need Help with my First Script - by Spunky on 11-24-2009 at 08:00 PM
RE: Need Help with my First Script - by matty on 11-24-2009 at 08:29 PM
RE: Need Help with my First Script - by CookieRevised on 11-24-2009 at 08:35 PM


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