Or there's another way that you can take advantage of the /ialmark command and $ial().mark identifier to work side by side with the hash table:
on !*:join:#: check $nick
on *:exit: hsave nc nc.hsh
on *:start:{
if (!$hget(nc)) hmake nc 1000
if ($isfile(nc.hsh)) hload nc nc.hsh
}
on *:nick:{
var %nc = $addtok($ial($newnick).mark,$newnick,32)
.ialmark $newnick %nc | hadd -m nc $wildsite %nc
}
alias check {
if ($hget(nc,$address($1,2))) {
echo -s * $1's nick(s) : $replace($v1,$chr(32),$+($chr(44),$chr(32)))
}
}
mIRC's IAL will always return the rightful nicknames, whether it's new or old.