The above script uses the JOIN event, so it is looking at channel joins. The reason it's network dependant is because the address shadowing by each network is different. The address seen by join/part/etc is the same address you see in the /whois command, and your own address in /whois will be different at each irc network you join, assuming they are all doing address shadowing.