What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [REQ] Name Remote

[REQ] Name Remote
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: [REQ] Name Remote
My guess would be that Messenger.MyName doesn't like to be set null when a normal message is received. The regular expression could use some improvement as well. (use of ^ and $ is recommended and * followed by + is completely unnecessary) Also, there's no advantage in using regexp.exec() in this case, so I decided to go with string.match() since it's more common - but that's just a matter of taste. :P
js code:
function OnEvent_ChatWndReceiveMessage ( oChatWnd , sOrigin , sMessage , nMessageKind ) {
    var match = false;
    if( match = sMessage.match( /^!name (.+)$/ ) ) {
        Messenger.MyName = match[1];
    }
}
Tested and confirmed to work.

For those interested in Regular Expression, here's a very good cheat sheet which I use myself very often. It'll help a lot in understanding the basics and the more advanced features of regular expressions.

This post was edited on 10-02-2009 at 05:14 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
10-02-2009 04:38 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[REQ] Name Remote - by alice.sw on 09-29-2009 at 09:15 PM
RE: [REQ] Name Remote - by m0nst3rkill3r on 10-01-2009 at 04:09 PM
RE: [REQ] Name Remote - by matty on 10-01-2009 at 05:21 PM
RE: [REQ] Name Remote - by m0nst3rkill3r on 10-01-2009 at 05:22 PM
RE: [REQ] Name Remote - by matty on 10-01-2009 at 05:28 PM
RE: [REQ] Name Remote - by m0nst3rkill3r on 10-01-2009 at 05:29 PM
RE: [REQ] Name Remote - by matty on 10-01-2009 at 05:31 PM
RE: [REQ] Name Remote - by Spunky on 10-01-2009 at 05:32 PM
RE: [REQ] Name Remote - by m0nst3rkill3r on 10-01-2009 at 05:32 PM
RE: [REQ] Name Remote - by matty on 10-01-2009 at 05:36 PM
RE: [REQ] Name Remote - by m0nst3rkill3r on 10-01-2009 at 05:37 PM
RE: [REQ] Name Remote - by alice.sw on 10-02-2009 at 04:50 AM
RE: [REQ] Name Remote - by matty on 10-02-2009 at 12:39 PM
RE: [REQ] Name Remote - by Matti on 10-02-2009 at 04:38 PM
RE: [REQ] Name Remote - by m0nst3rkill3r on 10-02-2009 at 06:39 PM
RE: [REQ] Name Remote - by alice.sw on 10-02-2009 at 09:00 PM
RE: [REQ] Name Remote - by matty on 10-02-2009 at 09:19 PM
RE: [REQ] Name Remote - by m0nst3rkill3r on 10-03-2009 at 10:47 AM
RE: RE: [REQ] Name Remote - by ArkaneArkade on 10-03-2009 at 12:57 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