most times its provided in the /whois info on a user ... i dont think there is any other means of determining what server a user is connected to without doing that... once uve found that u could store it into variable/hashtable/text file and read from it for yur script....... without doing a whois on another nick to first get that info i dont think it is possible to detect it