mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2006
Posts: 2
F
Bowl of petunias
OP Offline
Bowl of petunias
F
Joined: Jan 2006
Posts: 2
hey,

i'm writing a script which reads a logfile, i want that if my while loop doesnt matches that it executes the while loop until it matches or i end the loop, but as you all know, only /continue would cause a crash because of the count how much times it gets executet in a second, so thats why i want/need to use a timer function or something similar where i can specify a delay time to execute this /continue command. If someone of you all has another idea how i can manage stuff like that please tell me. i'm happy about it then.
my while loop looks similar to that:

while (%MyVar == $false) {
echo blabla
/timer 1 15 /continue
}
else /break

thanks.
franco

Last edited by franco85; 03/01/06 07:29 PM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
What's happening with the information read from the log file? Is it being displayed to the channel or a person? If so, why not use the /play command
eg:
Code:
 while (!%myvar) {
inc %line
/play -l $+ %line $nick log.log 15000
}
  

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Try this:
Code:
alias slowloop {
  ; $1 = line number
  ;
  var %delay.sec = [color:green]1[/color]
  ;
  var %c = $iif($1,$1,1), %cc = $lines([color:red]filename.txt[/color])
  var %read = $read([color:red]filename.txt[/color],%c)
  ;
  ; Do something here using %read
  echo -a Line %c $+ : %read
  ;
  inc %c
  if (%c <= %cc) .timerSL 1 %delay.sec slowloop %c
}


Your filename goes here
Change the delay time here

-genius_at_work

Joined: Jan 2006
Posts: 2
F
Bowl of petunias
OP Offline
Bowl of petunias
F
Joined: Jan 2006
Posts: 2
yay that looks good laugh thanks man.

greetz franco


Link Copied to Clipboard