mIRC Homepage
Posted By: Stranger_Lv on nick event (mIRC v 6.16) - 09/10/05 05:00 PM
This event return $address identifier for $newnick, but doesn`t do it for $nick!
Posted By: landonsandor Re: on nick event (mIRC v 6.16) - 09/10/05 06:33 PM
Are you talking about $address($newnick,5) or $address ?
Posted By: Stranger_Lv Re: on nick event (mIRC v 6.16) - 09/10/05 08:07 PM
$address($newnick,5)
Posted By: Mentality Re: on nick event (mIRC v 6.16) - 09/10/05 08:16 PM
This is probably because $nick is the OLD nickname in the ON NICK event, therefore, you're looking up the address of a nickname that no longer has an address associated with it.

As far as I can see, this isn't a bug.

Regards,
Posted By: Stranger_Lv Re: on nick event (mIRC v 6.16) - 09/10/05 09:01 PM
it becomes old when "on nick" event ends (as much, as $nick is unset, when join action is over in "on join"), but inside of this event i think it must be kept 0_o
Posted By: starbucks_mafia Re: on nick event (mIRC v 6.16) - 09/10/05 11:26 PM
No, $nick should become the old nick immediately because by that point it is the old nick as far as the server is concerned. It wouldn't make much sense if you were using $nick to get information from within mIRC but then had to use $newnick when sending something to the server.

ie.
Code:
on *:nick:{
  if ($address($nick,4) == *!*@*.aol.com) whois $newnick
}



Perhaps it would've been clearer if the on nick event had used identifiers $oldnick and $nick instead since I think people generally expect $nick to be the 'active' nickname for any given event, but it's too late to change that now and the behaviour of the event definitely shouldn't be changed as you described.
Posted By: Riamus2 Re: on nick event (mIRC v 6.16) - 10/10/05 01:30 PM
I don't know... I think I'd have to disagree. An identifier doesn't change just because it is in a different event. $nick is $nick no matter where it's located. Why should it be different just because it's in the on nick event?

My guess is that the $nick doesn't change until after the on nick event, but the because the $address identifier gets the data from the server and the server knows the $nick is different, then it doesn't work from $nick and just from $newnick. And, like was mentioned, this would be because the server can't tell mIRC what the address is for a nick that isn't there.

One thing tho... why do you need $address of $nick when you can use the $address of $newnick? Since it's just a nick change, the $address isn't going to change.

I do think $oldnick and $nick may have been more appropriate, but I think this behavior is valid.
Posted By: Stranger_Lv Re: on nick event (mIRC v 6.16) - 11/10/05 11:29 AM
I`m making a identification system to my mIRC bor, so when user(identified) changes nick runs alias, which checks if $nick(old_nick) has been identified (due to security reasons a`m checking whole nick!id@host address, because checking only by IP/IP+id wouldn`t be absolute secure (for networks with an one virtual IP)), and if it was - i remove old record, and automatically reregister him with new nick.
I had solved this problem, no help needed.
But I`m thinking that, if this little fix would added - no one would be suffered wink
Posted By: Mpdreamz Re: on nick event (mIRC v 6.16) - 11/10/05 12:26 PM
that would make more sence indeed.
Posted By: Riamus2 Re: on nick event (mIRC v 6.16) - 11/10/05 12:51 PM
I agree that allowing address to be visible from the old nick could make things easier, but my question still stands...

Why not just get the address info from the new nick? It's easy enough to do $replace($address($newnick,5),$newnick,$nick) to get the entire address with nick for the old nick. Yes, if the nick/newnick was something that was the same in ident and/or host, it would replace extra things as well. If that's a concern, you can also use $replace($gettok($address($newnick,5),1,33),$newnick,$nick) $+ ! $+ $gettok($address($newnick,5),2,33).

Obviously, if $address worked with the old nick, this would be even easier, but it still isn't too difficult to do. smile
© mIRC Discussion Forums