Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: 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.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: 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.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: 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.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: 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. Confused

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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net