mIRC Home    About    Download    Register    News    Help

Print Thread
#14923 11/03/03 06:19 AM
Joined: Dec 2002
Posts: 417
O
Othello Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
When I use this code it causes my mirc to freeze up.
Can anyone point out what is wrong with this code?

Code:
  [color:red]
alias lsb_chk_lst {
  var %lsb.time = $ticks
  set %lsb_list 0
  if ((%lsb.file == **) || (!$len(%lsb.file))) {
    msg $nick 12 No search string was entered2....
    if ($ifmatch == **) msg $nick 12 Try again2....
    halt
  }
  var %lsb.sflnm = $+(%lsb_rslt_dir,Result_,$replace(%lsb.file,*,_),.txt)
  var %lsb.cnt = 1
  while ($findfile(%lsb_lst_dir,*.txt,%lsb.cnt)) {
    var %lsb.flnm = $ifmatch
    if ($left($nopath(%lsb.flnm),7) != Result_) {
      filter -ff %lsb.flnm %lsb.sflnm %lsb.file
      if (%lsb.sflnm) write %lsb.sflnm $chr(10)
    }
    inc %lsb_list 1
  }
  var %lsb.fcnt = $lines(%lsb.sflnm)
  if ((!%lsb.fcnt) || (%lsb.fcnt < 13)) {
    msg $nick 2 L12ist 2S12earch 2B12ot Found4 NO12 matches for4 %lsb.file $+ 2....
    msg $nick 12 Try a different spelling of4 %lsb.temp $+ 2....
    .remove %lsb.send.flnm
    unset %lsb.send.flnm
    halt
  }
  set %lsb.flnm %lsb.sflnm 
  %lsb.fcnts = %lsb.fcnt - 12
  set %lsb.send.flnm %lsb.sflnm
  %lsb.time = $calc($timezone + (($ticks - %lsb.time) / 1000 ))
  msg $nick 2 L12ist 2S12earch 2B12ot Found 2[4 %lsb.fcnts 2] 12matches r4 %lsb.file 12in 2[04 $+($asctime($int(%lsb.time),n:ss),$gettok(%lsb.time,2,46)) 2]
  msg $nick 2 L12ist 2S12earch 2B12ot will now Dcc you a list of its findings2....
  $lsb.send
}
[/color]  




Intelligence: It's better to ask a stupid question, then to prove it by not asking....
#14924 11/03/03 08:48 AM
Joined: Feb 2003
Posts: 47
G
Ameglian cow
Offline
Ameglian cow
G
Joined: Feb 2003
Posts: 47
var %lsb.cnt = 1
while ($findfile(%lsb_lst_dir,*.txt,%lsb.cnt)) {
var %lsb.flnm = $ifmatch
if ($left($nopath(%lsb.flnm),7) != Result_) {
filter -ff %lsb.flnm %lsb.sflnm %lsb.file
if (%lsb.sflnm) write %lsb.sflnm $chr(10)
}
inc %lsb_list 1
}

it seems to me you're not increasing %lsb.cnt which makes it constantly search for the first file specified by the mask *.txt

#14925 11/03/03 03:36 PM
Joined: Dec 2002
Posts: 417
O
Othello Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
Thank you for the imput. At times when you work on a script so long you over look the obvious. It always helps getting a secound opinion.





Intelligence: It's better to ask a stupid question, then to prove it by not asking....
#14926 13/03/03 12:01 PM
Joined: Feb 2003
Posts: 47
G
Ameglian cow
Offline
Ameglian cow
G
Joined: Feb 2003
Posts: 47
i'm here to please smile


Link Copied to Clipboard