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
Illogic
Beginner


Joined: 11 Nov 2006
Posts: 13

PostPosted: Sat Dec 02, 2006 12:47 am   

#wait question
 
is there a way to set up #wait so that it waits to get a specific line (not just any output) from the mud ?



my alias looks like this

rw
#wait You feel a surge of energy run through your right arm.
rs


but it doesnt work...
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Dec 02, 2006 1:12 am   
 
No, #wait is specifically for waiting a number of milliseconds. That won't work because it's not the intended use :)

There are a couple of ways to do what you want to do. The easiest way is to use the #temp command to create a temporary trigger, so the alias would look like this:

#alias whatever {rw;#temp {You feel a surge of energy run through your right arm} {rs}}

If you have many commands you want to run, you can use trigger states and the #cond command to create multiple triggers that then work in sequence. For example, you could have:

#trigger {You feel a surge of energy run through your right arm} {rs}
#cond {You feel an even bigger surge of energy run through your right arm} {rk}

Or something. Then you put this trigger in its own class and enable or disable it using the #T+ and #T- commands.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Illogic
Beginner


Joined: 11 Nov 2006
Posts: 13

PostPosted: Sat Dec 02, 2006 5:49 am   
 
its actually a spell buff alias...only thing is there is a 3 second delay after each command...for example


to cast shield i would need to enter these hand movements

rs (right snap)
rc (clap hands)
rp (right point)


but each hand movement has an approx 3 second delay , and after each movement, a line is displayed from the point IE

you snap your right fingers
you clap your hands
you point to yourself with your right hand

respectively

instead of making the wait command delay 3000 clicks


id rather have the alias wait until it got a line back after every movement...

i cant accomplish this with triggers because those hand movements are also used for various other spells so triggers would greatly muddle things up


any suggestions ?
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Dec 02, 2006 11:37 am   
 
I didn't understand whether or not the message is recieved from the MUD before or after the 3 second wait. I assume after.

It's simple to make a trigger for it. Just create it in its own class folder, and uncheck in the "enabled" box, and check the "disable on connect" box. This'll stop it from firing any time other than when you explicitly activate it with #t+ {Class|sub-class}

So you set up an alias outside that class that looks like this:

#alias spbuff {rs;#t+ SpellBuff}

#trigger {You snap your right fingers} {rc}
#cond {You clap your hands} {rp;#t- SpellBuff}

Then you put the trigger in the SpellBuff class, by dragging it there in the settings editor, and you're good to go :)

Multistate triggers (which is what you've created here) have more than one pattern that they match - but they only do so in order. When they reach the last pattern, they loop back to the beginning to wait to start the whole process again. So the trigger starts off disabled - when you run your alias, it's turned on and the first command is sent. After 3 seconds, the first message is recieved and the trigger sends the second command. It then changes state so it'll no longer match its first pattern, but will match its second pattern. When the second message is recieved 3 seconds later, it sends the last command, disables itself, and goes back to the first state to wait to be turned on again.

You can add as many states as you like, in order, so long as you put the #- command in the very last one.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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