That debug fixed it, thank you. It helped a lot. Tested a few things though.
After I killed the Internet connection, mIRC lost connection and disconnected but the channels weren't removed from the channels list. Therefore once I turned on my Internet connection again and mIRC reconnected (Reconnect on Disconnect setting) it tried to automatically rejoin all channels that were previously active. So it's essential that the script clears the channel list. Preferably instantly, any ideas?
P.S: As far I know, there's not an option to disable the channel reconnect in mIRC.
Last edited by Gargantuan; 28/02/15 03:52 PM.