I made the !cure because I wasn't sure if you had one or not.

Regarding the problem of crashing your bot, the problem line is the while. Unfortunately I'm not at a location where I can reference mIRC for testing purposes.

Regarding characters in filenames that make invalid filenames, there's no 100% foolproof way around this, so I'm going to recommend that you consider storing the information in a hash table, rather than multiple INI files.

If you want, I'd be more than happy to re-code your script to use a hash table rather than ini files.

I've also noticed that you use the halt command in with straight if statements, rather than using the if/elseif/else format. While using halt isn't wrong, it is considered to be poor programming.

One last note, when posting code in the forums, please use the Code Tags, as they do make things easier for the helpers that may need to copy/paste your code.