NICK (stackable)
bind nick <flags> <mask> <proc>
procname <nick> <user@host> <handle> <channel> <newnick>
Description: triggered when someone changes nicknames. The mask
is matched against '#channel newnick' and can contain wildcards.
Channel is "*" if the user isn't on a channel (usually the bot not
yet in a channel).
Module: irc
this is from tcl-commands, $newnick will be the user who's had a nickchange.
Hope this will help
if i am reading that right, that event is triggered when the user changes thier nick, the code i posted is when somone is a channel does "!flag <nick>" . the stats.mod works like that, it keeps correct info reguardless of nickname
nick2hand <nickname> [channel]
Returns: the handle of a nickname on a channel. If a channel is not
specified, the bot will check all of its channels. If the nick is
not found, "" is returned. If the nick is found but does not have
a handle, "*" is returned.
Module: irc
hand2nick <handle> [channel]
Returns: nickname of the first person on the specified channel (if one
is specified) whose nick!user@host matches the given handle; "" is
returned if no match is found. If no channel is specified, all channels
are checked.
Module: irc