|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: Fri Apr 11, 2008 3:05 pm
Forced Interrupt and Delay Commands |
IS there a command I can put in the middle of a long bit of text that delays the text that comes after it? Something like:
< text here >
#delay 20
< text here >
#delay 20
< text here >
Would say, delay it for 20 milliseconds
And then, the reason I want to delay it. Is there a way to throw in an interrupt that cancels inputted text?
< text here >
#delay 20
< text here>
typing in stop during delay 20 would then cancel everything after it, something like that. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri Apr 11, 2008 3:42 pm |
#WAIT.
The only way to stop the script would be to set a variable to false when you want to stop it, and check the variable before every command. If it's false, use #abort 1 to end the script. |
|
|
|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: Fri Apr 11, 2008 4:03 pm |
Thanks.
The interrupt would interrupt a script per se, it would interrupt my input. I'm setting the delay for when I load up triggers, etc... via the command line, so that if I notice something that I don't need I can abort and not have it load, then fix it and send again. |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Fri Apr 11, 2008 8:05 pm |
OK, there are LOTS of ways to do this and hundreds if not thousands of requests in the forums for things like this...
Keeping the above in mind you can dig around and find other ways if you don't like my suggestion here.
In fact the thing I helped oldguy write up this morning could be used for this too...
Make a variable named @abortScript
Ad the beginning of the script set it to 0
Then put in your commands.
#alias exercise {
abortScript=0
Do 5 jumping jacks
#wait 2000
#if (@abortScript) {#abort 1}
Do 5 pushups
#wait 2000
#if (@abortScript) {#abort 1}
Jump rope 5 times.}
#alias stopEX {#show {Stopping exercise.};abortScript=1}
Now, I changed it to a 2 second wait so that you could see how the example works.
Good luck! |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
|
|