What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Question about "MyStatus"

Question about "MyStatus"
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Question about "MyStatus"
shorter and slithly faster:
js code:
function OnEvent_ChatWndSendMessage( ChatWnd, Message )
{
    // Check if it is not an automessage and if we're not busy yet
    if (!/^AutoMessage :/.test(Message) && Messenger.MyStatus !== 4 ) {
        // Set to busy
        Messenger.MyStatus = 4;
    }
    // Return the unmodified message
    // Never forget to return something for ChatWndSendMessage!
    return Message;
}

! means NOT (The boolean True becomes False, and False becomes True)
/blahblah/ is a special syntax used for regular expressions
^  at the beginning of a regular expression means start comparing it from the beginning (aka: don't do a (slower) search).
test(blahblah) is a method of the regular expression object which test the occurance of the regular expression (in the above case '^AutoMessage :') in the string (in the above case the Message variable)
&& performs a logical conjunction (=AND) on two expressions (both expressions must be True for the result to be True)

If Message begins with the string 'AutoMessage :' then /^AutoMessage :/.test(Message) will return True. Otherwise it will return False. Hence the use of ! (=NOT) to change the result of the test to the opposite...

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

Messages In This Thread
Question about "MyStatus" - by 5n4k3 on 01-17-2010 at 06:01 PM
RE: Question about "MyStatus" - by stoshrocket on 01-17-2010 at 06:29 PM
RE: Question about "MyStatus" - by 5n4k3 on 01-17-2010 at 07:24 PM
RE: Question about "MyStatus" - by Matti on 01-17-2010 at 07:56 PM
RE: Question about "MyStatus" - by stoshrocket on 01-17-2010 at 08:10 PM
RE: Question about "MyStatus" - by 5n4k3 on 01-17-2010 at 08:24 PM
RE: Question about "MyStatus" - by CookieRevised on 01-17-2010 at 10:26 PM
RE: Question about "MyStatus" - by 5n4k3 on 01-19-2010 at 08:19 AM
RE: Question about "MyStatus" - by stoshrocket on 01-19-2010 at 02:55 PM
RE: Question about "MyStatus" - by matty on 01-19-2010 at 03:29 PM
RE: Question about "MyStatus" - by Matti on 01-19-2010 at 04:55 PM
RE: Question about "MyStatus" - by 5n4k3 on 01-19-2010 at 05:20 PM
RE: Question about "MyStatus" - by stoshrocket on 01-19-2010 at 07:52 PM
RE: Question about "MyStatus" - by CookieRevised on 01-19-2010 at 08:35 PM
RE: Question about "MyStatus" - by roflmao456 on 01-19-2010 at 10:58 PM
RE: Question about "MyStatus" - by CookieRevised on 01-19-2010 at 11:39 PM
RE: Question about "MyStatus" - by roflmao456 on 01-20-2010 at 02:47 AM
RE: Question about "MyStatus" - by 5n4k3 on 01-20-2010 at 11:20 AM
RE: Question about "MyStatus" - by Matti on 01-20-2010 at 12:27 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