mIRC Home    About    Download    Register    News    Help

Print Thread
/pause, or something like it #6649 15/01/03 11:05 AM
Joined: Jan 2003
Posts: 154
B
BoredNL Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Jan 2003
Posts: 154
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 )


- Wherever you go there you are.[color:lightgreen]
Re: /pause, or something like it #6650 16/01/03 12:55 AM
Joined: Dec 2002
Posts: 24
G
GK_Kamel Offline
Ameglian cow
Offline
Ameglian cow
G
Joined: Dec 2002
Posts: 24
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.

Re: /pause, or something like it #6651 17/01/03 06:20 PM
Joined: Dec 2002
Posts: 56
G
Gon_ Offline
Babel fish
Offline
Babel fish
G
Joined: Dec 2002
Posts: 56
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.