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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Mcbeth
Newbie


Joined: 16 May 2005
Posts: 2

PostPosted: Mon May 16, 2005 5:14 pm   

Scripting help - equivalent of a waitfor?
 
I'm just trying to write a simple script that will execute a bunch of commands, wait for a string or a certain timeout and then execute another set of commands.

Right now i have a trigger set up to do respond, but i don't know how to get a waitfor("String",timeout) sort of command. any help appreciated.
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Mon May 16, 2005 5:34 pm   
 
--- EDIT ---
I just noticed the trigger wont work, sorry bout that.
Tried with #ALARM yet?
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Mon May 16, 2005 5:49 pm   
 
Maybe a Trigger with a Condition will work.
Trigger off the last command executed. and have it wait for a condition pattern with an alarm in it
something like this
#TRIGGER "String_TimeOut" {last command buffer}
#COND {Line you are sopoused to receive before 2nd set of commands} {set of commands when trigger matches pattern;#ALARM +5 {set of commands when timeout;#STATE String_TimeOut 0}
Reply with quote
Mcbeth
Newbie


Joined: 16 May 2005
Posts: 2

PostPosted: Mon May 16, 2005 6:21 pm   
 
Hmm... that sucks.. so i have to set up a trigger on my trigger? bleah... Someone should write a class or somethign that emulates waitfor(string,int) or something similar... saves from making these single use triggers so messy :(

Thanks for the help.
Reply with quote
Kiasyn
Apprentice


Joined: 05 Dec 2004
Posts: 196
Location: New Zealand

PostPosted: Mon May 16, 2005 8:06 pm   
 
get to work ;)
_________________
Kiasyn
Owner of Legends of Drazon
Coder on Dark Legacy
Check out Talon, an easy IMC connection.
Reply with quote
Theragil
Apprentice


Joined: 13 Feb 2004
Posts: 157
Location: USA

PostPosted: Tue May 17, 2005 2:26 pm   
 
Worse yet, if there's more than one, and the trigger is the same (e.g., "you have recovered balance"), the earlier one will still be around and fire again, making a mess of things. This is one thing that isn't anywhere near as easy as one would expect it to be. I have made a specific version for things waiting for balance and/or equilibrium in IRE MUDs that works a charm, but a more general-purpose "do this, wait for that, do the other thing" where the "wait for" text can be anything in each step, that's probably more work to do than to just get your head around the way zMUD wants you to handle it.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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