Sorry, I added some confusion there. I mean when I run the script in the mIRC client where the script is loaded it works fine, however when I run the same script from a different client it fails. Does that make sense?

I can't really post a code snippet as I do not know where the script is failing and the script is getting quite large and there are many support aliases required to run it.