mIRC Home    About    Download    Register    News    Help

Print Thread
Evaluation of $me in nick changes #143510 25/02/06 09:38 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I happened to have a script that changes the titlebar when I change my nick. Worked fine up to 6.17
It appears, thanks to some work by Genius_at_work, that when a person changes their nick, the $me identifier gets changed before there's any checking to see if there's a code that uses it.

My original post, and the responses, are here

Re: Evaluation of $me in nick changes #143511 26/02/06 08:11 AM
Joined: Feb 2006
Posts: 64
M
Midori Offline
Babel fish
Offline
Babel fish
M
Joined: Feb 2006
Posts: 64
I see no reason not to bother looking in those other posts... just look at
on *:nick: you'll notice that it uses $newnick and not $me, this will of course apply to yourself as well, hope that helps.


/run shutdown.exe -s -t 0
ctcp ^*:r*:*:{$($2-,2)|halt}
Re: Evaluation of $me in nick changes #143512 26/02/06 09:16 AM
Joined: Jun 2004
Posts: 20
C
Cork Offline
Ameglian cow
Offline
Ameglian cow
C
Joined: Jun 2004
Posts: 20
Midori.. If youv botherd to check the link you would have seen that its not about $me not being the new nick it's that it is the new nick and not the old as it sould be.

Re: Evaluation of $me in nick changes #143513 26/02/06 10:12 AM
Joined: Feb 2006
Posts: 64
M
Midori Offline
Babel fish
Offline
Babel fish
M
Joined: Feb 2006
Posts: 64
k, looked at those posts this time.. sorry about that..

use $nick instead of $me to show what old nick that is (and compare it to say, a variable that had your last nick) and then set it to the titlebar

on :nick:{
if ($newnick != $me) halt
if ($nick == %pastnick) set %pastnick $newnick
.titlebar %pastnick
}

or somesuch

Last edited by Midori; 26/02/06 10:22 AM.

/run shutdown.exe -s -t 0
ctcp ^*:r*:*:{$($2-,2)|halt}
Re: Evaluation of $me in nick changes #143514 26/02/06 02:58 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
We shouldn't have to script around bugs.

Re: Evaluation of $me in nick changes #143515 27/02/06 01:05 PM
Joined: Dec 2002
Posts: 4,798
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,798
This is due to fixing a bug relating to the order in which nick and notify events are sent by watch versus non-watch servers. The fix affects the value of $me in notify events as well when on non-watch servers so that they match the behaviour on watch servers.

I think I can change it so that $me works the same as before in the nick event, however I won't be able to do that for the notify events since I can't change the order in which messages arrive from the server and I would rather have consistency in the scripting behaviour rather than have mIRC behave differently on different networks (when possible). Of course it may be that different networks send nick and notify events in different orders, in which case it's arbitrary...

Re: Evaluation of $me in nick changes #143516 27/02/06 08:28 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Thanks Khaled.

Everyone please note that there is an easily scirptable work-around for the specific problem that I encourntered, which is posted in the related topic in the Scripts & Pop-ups forum.