The problem I have is when this script searches all the list It has collected. It will still send a responce on files found even if it has found no files I feel my problem lies in the :END section. Where the script will DCC Send a list that is basicly empty except for the lines telling what it has found. Any help would be appreciated.

Code:
  [color:red]  

alias lsb_chk_lst {
  set %lsb=list %lsb_list 
  set %lsb_list 0
  var %lsb.time $ticks
  set %lsb.file * $+ $replace($replace($replace($replace(%lsb.temp,$chr(32),*),_,*),-,*),?,*) $+ *
  if !%lsb.file { msg $nick 12 No search string was entered $+ $chr(160) | halt }
  if %lsb.file == * { msg $nick 12 No search string was entered $+ $chr(160) | msg $nick 12Try again | halt }
  if %lsb.file == $null { halt } 
  else {
    var %lsb.sflnm %lsb_rslt_dir $+ Result_ $+ $replace(%lsb.file,$chr(42),$chr(95)) $+ .txt
    var %lsb.cnt 1
    :loop
    inc %lsb_list 1
    var %lsb.flnm = $findfile(%lsb_lst_dir,*.txt,%lsb.cnt) 
     if $left($nopath(%lsb.flnm),7) == Result_ { inc %lsb.cnt 1 | goto loop }
    else {
      filter -ff %lsb.flnm %lsb.sflnm * $+ %lsb.file $+ * 
      if %lsb.sflnm == $null { inc %lsb.cnt 1 | goto loop }
      else { write %lsb.sflnm $chr(10) | inc %lsb.cnt 1 | goto loop }
    }
  }
  :end
  var %lsb.fcnt $lines(%lsb.sflnm)
  set %lsb.flnm %lsb.sflnm
 [color:blue]if %lsb.fcnt <= 12 { [/color] [color:red]  
    msg $nick 2 L12ist 2S12earch 2B12ot Found4 NO12 matches for4 %lsb.temp $+ 2....
    msg $nick 12 Try a different spelling of4 %lsb.temp $+ 2....
    remove %lsb.send.flnm
    set %lsb.send.flnm
    halt
  }
  else {
    var %lsb.time $calc(($ticks - %lsb.time) / 1000 )
    %lsb.fcnts = %lsb.fcnt - 12
    msg $nick 2 L12ist 2S12earch 2B12ot Found 2[4 %lsb.fcnts 2] $&
      12matches for4 %lsb.file 12in 2[4 $duration(%lsb.time) 2] 
    msg $nick 2 L12ist 2S12earch 2B12ot will now Dcc you a list of its findings2....
    set %lsb.send.flnm %lsb.sflnm
    $lsb.send
  }
}

[/color]
[/color]

[EDIT: added a line continuation $& to shorten the long line for display in the forum. -Hammer]

Last edited by Hammer; 15/01/03 05:47 PM.



Intelligence: It's better to ask a stupid question, then to prove it by not asking....