Multi Threaded File Seaching

By BrAndo on Sep 19, 2008

This is a dialog that basically uses $findfile() but performs a multi-threaded search, meaning it doesn't lock up your mIRC.

Image

Normally if you try to perform a large search on your computer, $findfile() will freeze your mIRC and you are unable to do anything until the search is complete. This script uses a DLL and allows a multi-threaded search to fix that.

You need this DLL somewhere in your mIRC directory. It is in a .zip file, and is completely safe.

I actually use this dialog alot, very usefull.

alias file { dialog $iif($dialog(file),-v,-m) file file }
menu * {
  File Finder:{ file }
}
alias find { .echo -q $findfile(%dir,$did(file,9),0,found $1-) }
alias found {
  inc %found
  did -za file 11 $1-
  did -ra file 13 %found
}
on *:signal:ThreadEnded:{
  did -v file 12
  did -ra file 13 %found
  .echo -q $input(Search Complete. $crlf $+ $crlf $+ - Files found: %found $crlf $+ - Search time: $bytes($calc($ticks - %ticks),b) ms,oiu,Search Summary)
  unset %found %dir %ticks
}
on *:dialog:file:*:*:{
  if ($devent == init) { 
    if (*mThreads.dll !iswm %mThreads) { 
      if (!$findfile($mircdir,mThreads.dll,1,set %mThreads $1-)) { 
        .echo -q $input(mThreads.dll was not found in your mIRC directory. $crlf $+ Download it at: http://www.genscripts.net/Projects/mThreads/,ohu,DLL not found)
        dialog -x $dname
        return
      }
    }
    did -c $dname 2 
    did -b $dname 6,7
    did -h $dname 12
  }
  elseif ($devent == dclick) { if ($did == 11) { run $did(11).seltext } }
  elseif ($devent == sclick) {
    if ($istok(2 4 5,$did,32)) { did $iif($did == 5,-e,-b) $dname 6,7 }
    elseif ($did == 7) { did -ra $dname 6 $sdir(C:\,Select Directory,Select) }
    elseif ($did == 10) {
      did -r $dname 11,13
      did -v $dname 12
      unset %found %dir %ticks
      if ($did(2).state) { %dir = $mircdir }
      elseif ($did(4).state) { %dir = C:\ }
      else {
        if (*\ iswm $did(6)) { %dir = $did(6) }
        else { .echo -q $input(Select a directory.,ohu,Unable to perform search) | return }
      }
      %found = 0
      %ticks = $ticks
      dll $qt(%mThreads) thread -ca thread1 find
    }
    elseif ($did == 11) { did -ra $dname 16 $did(11).seltext }
    elseif ($did == 17) && ($did(16) != $null) { clipboard $v1 }
  }
  elseif ($devent == close) { unset %found %dir %ticks }
}
dialog file {
  title "Multi-Threaded File Finder v2.0"
  size -1 -1 194 144
  option dbu
  box "Search Directory", 1, 4 1 187 43
  radio "mIRC Directory", 2, 9 10 50 10
  radio "None", 4, 9 20 50 10
  radio "Other", 5, 9 30 28 10
  button "...", 7, 39 30 20 10
  text "Search Pattern:", 8, 6 47 41 8
  edit "", 9, 49 46 118 10, autohs
  button "Find", 10, 168 46 20 10
  list 11, 5 57 183 60, size hsbar vsbar
  text "Files Found:", 12, 6 132 30 8
  text "", 13, 42 132 25 8, right
  button "Close", 14, 151 131 37 10, ok cancel
  text "File:", 15, 6 119 12 8
  edit "", 16, 20 118 147 10, read autohs
  button "Clpb", 17, 168 118 20 10
  edit "", 6, 62 30 125 10, autohs
}

Comments

Sign in to comment.
BrAndo   -  Sep 23, 2008

I have a download URL, and I know I can use noop.

 Respond  
napa182   -  Sep 23, 2008

how about where you have this line

.echo -q $input(mThreads.dll was not found in your mIRC directory. $crlf $+ Download it at: http://www.genscripts.net/Projects/mThreads/,ohu,DLL not found)
        dialog -x $dname
        return

you toss this in there as well

url http://www.genscripts.net/Projects/mThreads/

so when they click ok it opens up that page the dll is on

also instead of doing

.echo -q $input(Select a directory.,ohu,Unable to perform search) | return }

you can use noop

noop $input(Select a directory.,ohu,Unable to perform search)
 Respond  
Neo_   -  Sep 23, 2008

your welcome

 Respond  
BrAndo   -  Sep 22, 2008

Thanks for the feedback...

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.