|
Mcbeth Newbie
Joined: 16 May 2005 Posts: 2
|
Posted: 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. |
|
|
|
DeReP Adept
Joined: 14 Jun 2003 Posts: 222 Location: Chile
|
Posted: Mon May 16, 2005 5:34 pm |
--- EDIT ---
I just noticed the trigger wont work, sorry bout that.
Tried with #ALARM yet? |
|
|
|
DeReP Adept
Joined: 14 Jun 2003 Posts: 222 Location: Chile
|
Posted: 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} |
|
|
|
Mcbeth Newbie
Joined: 16 May 2005 Posts: 2
|
Posted: 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. |
|
|
|
Kiasyn Apprentice
Joined: 05 Dec 2004 Posts: 196 Location: New Zealand
|
Posted: Mon May 16, 2005 8:06 pm |
get to work ;)
|
|
|
|
Theragil Apprentice
Joined: 13 Feb 2004 Posts: 157 Location: USA
|
Posted: 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.
|
|
|
|
|
|