mIRC Home    About    Download    Register    News    Help

Print Thread
#132322 09/10/05 05:00 PM
Joined: Oct 2004
Posts: 38
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Oct 2004
Posts: 38
This event return $address identifier for $newnick, but doesn`t do it for $nick!

Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
Are you talking about $address($newnick,5) or $address ?


Those who fail history are doomed to repeat it
Joined: Oct 2004
Posts: 38
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Oct 2004
Posts: 38
$address($newnick,5)

Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
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,


Mentality/Chris
Joined: Oct 2004
Posts: 38
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Oct 2004
Posts: 38
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

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2004
Posts: 38
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Oct 2004
Posts: 38
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

Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
that would make more sence indeed.


$maybe
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard