It's not as clean as it can be. Use aliases to minimize duplication of code. You're repeating yourself way too much.

Basically, if you use any command with the same (or similar) parameters more than once, it should be made an alias. Also, if you use any string literal more than once, it should be put in a variable or identifier.

For example, I see "$shortfn(hardcodedpath)" way too many times in your script. What happens if you change the filename in the future? You're going to get a headache, is what. Throw it in an identifier and use that. If you change the literal the identifier represents, you only need to do it in one place.

alias myfilename { return $qt(C:\path\to\dupefile.txt) }
write $myfilename ....

Finally, this is an efficiency thing, but be careful how many times you call $read on a file.. it's relatively slow. If you're $read'ing that many times, consider using /filter to pull all your data out of the file and then mess with it in memory. /help /filter. From a glance at your script it looks like what you want anyway, since /filter is a great way to match dupes without looping or $read's


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"