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
mcphersonpa1
Newbie


Joined: 01 Aug 2008
Posts: 3

PostPosted: Fri Aug 01, 2008 9:02 pm   

Can't stop a script
 
I'm really new at this so I apologize if this is really basic.

I set up a script that runs off a button. All it has in it is basic commands for the mud and the #WAIT command. The problem is that once I press the button I can't stop the script until it is finished. Is there any easy command to stop this in the middle? I've already tried #STOP all. I also tried typing in #THREAD but no new thread shows up.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Fri Aug 01, 2008 11:48 pm   
 
Well the best solution depends on why you are using the #WAIT command. Basically, your script needs changing, so maybe you should post it so we can see how to change it.
Reply with quote
mcphersonpa1
Newbie


Joined: 01 Aug 2008
Posts: 3

PostPosted: Sat Aug 02, 2008 11:37 am   
 
It goes like this:

backstab guard;#WA 7000;
n;ne;
backstab guard;#WA 7000;

And so on and so forth. Like I said its really basic. Ideally I would like to get it to the point where when the mud outputs "guard dies" it moves on to the next command in the script. I'm sure there's some way I could trigger that but I'm still working on reading through some of the help documentation for CMUD. Thanks in advance for your help.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Sat Aug 02, 2008 5:21 pm   
 
Well, you could try something like this instead of #WAIT:
#WAITFOR {abort} 7000
If you want to abort the wait, just type #SHOW abort (or make another button or alias with that command in) and I think it will abort the wait.
Alternatively, you could use a smaller wait duraction and check a variable to see whether the wait should continue, with a loop to ensure it adds up to the total wait time you want, but #WAITFOR should be more efficient and simpler. You can also try:
#WAITFOR {abort|guard dies} 7000 {commands to do if abort or guard dies is displayed} {commands to do if there is a timeout}
Reply with quote
mcphersonpa1
Newbie


Joined: 01 Aug 2008
Posts: 3

PostPosted: Sat Aug 02, 2008 9:21 pm   
 
I'll try that. Thanks so much for your help.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Sat Aug 02, 2008 10:34 pm   
 
Tell me if it works out as I didn't test it.
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