$findfile() has an internal loop mechanism where you can provide a command to be called for each file it finds. This will work out a lot faster than a regular while loop over $findfile() and much faster than your existing code which calls $findfile multiple times for each file it finds.

This code should work out a great deal faster than what you've got at the moment however it still won't be anywhere near instant when matching 100,000 files - that's simply a limitation of hard drive access speeds and mIRC's single-threaded implementation.

Code:
alias que {
  if ($hget(Files,0).item) { hfree Files }
  var %dir = $$sdir($mircdir,Select Dir) , %time = $ticks
  echo Please Wait Adding Files To Que
  var %total = $findfile(%dir, *.*, 0, if (*.NEW !iswmcs $1-) hadd -m Files $findfilen $1-)
  echo Added %total Files To Que In $round($calc(($ticks - %time) / 1000),0) Seconds
}


A quick run of this alias over my entire C:\ drive (105098 files) took 30 seconds.

Last edited by starbucks_mafia; 11/03/09 05:47 PM.

Spelling mistakes, grammatical errors, and stupid comments are intentional.