mIRC Homepage
Posted By: BoredNL /pause, or something like it - 15/01/03 11:05 AM
Something that would be useful for me: A command that will allow me to pause before continuing within a script. So if I am running an outside program to process a certain file, I can make it wait for say 1,000 ms (which would probably be more than enough time for the file to be processed, then to check to see if an output file was create, if not, wait 1,000 ms longer..

Ex.

alias dooy {
write input.txt here's the input $1-
run c:\processor\process.exe $mircdirinput.txt $mircdiroutput2.txt
while ($exists(output.txt) == $false) { wait 1000 }
run c:\processor2\proces2.exe $mircdiroutput.txt $mircdiroutput2.txt
while ($exists(output2.txt) == $false) { wait 1000 }
Echo The file has been processed.. Opening now!
.rename output2.txt thefile.txt
run thefile.txt
}

( :tongue: I would have put catches in there to guard against an endless loop if the file wasn't processed within a certainamount of seconds, but you get the idea. wink )
Posted By: GK_Kamel Re: /pause, or something like it - 16/01/03 12:55 AM
this can be done with other methods...

however, mirc will not process an event until it is finished with whatever it's on... so, putting something after the event should be sufficiant enough.

if not, you can always do it with a series of timers/aliases

ie: alias dooy {
write input.txt here's the input $1-
run c:\processor\process.exe $mircdirinput.txt $mircdiroutput2.txt
dooy1
}
alias dooy1 {
if (!$exists(output.txt)) {
timer 1 1 dooy1
}
else {
run c:\processor2\proces2.exe $mircdiroutput.txt $mircdiroutput2.txt
dooy2
}
}

... so on and so forth.
Posted By: Gon_ Re: /pause, or something like it - 17/01/03 06:20 PM
A sleep command is a good idea and has been suggested a lot before. I have no idea how it would be achieved techincally though.
© mIRC Discussion Forums