How are you disconnecting from several network ? I've tried to use $? in a on disconnect event, and even when I disconnect from several network, it work, i've used :
Code:
on *:disconnect:echo -a $$?="test $network "


#mircscripting @ irc.swiftirc.net == the best mIRC help channel