Just in case, here the corrected code of mine :
Code:
on *:text:!search *:#:{
filter yourfilehere.txt out.txt * $+ $2-*
var %a = 1, %b = $iif($filtered > 3,3,$v1)
while (%a <= %b) {
.timer 1 %a  msg $chan Found $!( $qt($read(out.txt,n,%a)) ,0) in the file.
if (%a == 3) && ($filtered >= 3) {
.timer 1 4 msg $chan There are more than 3 results for " $+ $2", try being more correct.
   }
if (%a == 3) .remove out.txt
inc %a
  }
if (!$filtered) echo -a msg $chan No match found
}


#mircscripting @ irc.swiftirc.net == the best mIRC help channel