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
nostra
Wanderer


Joined: 23 May 2001
Posts: 68
Location: Sweden

PostPosted: Fri Jun 11, 2004 6:57 pm   

Is there something similar to "WHEN" command?
 
I see that there are WHILE, UNTIL commands but what if I want to wait for a variable to become a "certain value" THEN execute the trigger?

Something like this:

#WHEN (@A = 0) {say "about time"}

Is there a solution? :>

Kindly,
Mikael
Reply with quote
Insomniac
Wanderer


Joined: 25 Mar 2004
Posts: 78
Location: United Kingdom

PostPosted: Fri Jun 11, 2004 7:17 pm   
 
I normally incorporate something like this into the master trigger for said procedure.

What exactly are you trying to achieve? There is probably an easy work around but we need information!
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Jun 11, 2004 7:24 pm   
 
#TR {@A = 0} {say "about time"} {} {exp}
Reply with quote
nostra
Wanderer


Joined: 23 May 2001
Posts: 68
Location: Sweden

PostPosted: Fri Jun 11, 2004 7:26 pm   
 
My mud has a filter which prevents me from removing eq etc while I'm casting a spell.

So I made a variable which has value 1 as long as I'm casting a spell (after completion it goes back to 0).

So if other triggers that remove my eq try to kick in I want them first to check that @spellvariable = 0. If it's not I want the trigger to delay and kick in as soon as @spellvariable = 0.

Possible? :>

/Mikael
Reply with quote
Insomniac
Wanderer


Joined: 25 Mar 2004
Posts: 78
Location: United Kingdom

PostPosted: Fri Jun 11, 2004 7:28 pm   
 
LightBulb strikes again!
Reply with quote
nostra
Wanderer


Joined: 23 May 2001
Posts: 68
Location: Sweden

PostPosted: Fri Jun 11, 2004 7:48 pm   
 
...well, this is a two-way trigger that...

...checks a variable and if it's false wait until true then fires off... more complicated than lightbulb's suggestion :>
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri Jun 11, 2004 7:59 pm   
 
#TR {Trigger line that causes remove eq} {#IF (!@spellvariable) {Do stuff} {#TEMP "spellcheck" (@spellvariable=1) {Do Stuff}}}

Ok Going under some assumptions here :P first assuming Evaluation trigs can be temp trigs (I believe so)
In other words untested but without further info this is what I think you want
Reply with quote
nostra
Wanderer


Joined: 23 May 2001
Posts: 68
Location: Sweden

PostPosted: Fri Jun 11, 2004 9:21 pm   
 
Lol! Not working the way I was thinking... I'm a nonprogrammer so bare with me... here is the explanation again.

Some of my trigger conflict with my mud's settings. One such occassion is when I'm casting a spell because during this period my character can't do anything else (remove eq, send tells or cast another spell).

So, in order to avoid conflict I need to check a variable - before a fire another trigger - and if that variable is equal to 1 I must "put the trigger on hold UNTIL the variable change value to 0".

So, I am thinking something like along these lines:

Pattern: "You are almost dying"
Value: #WHEN @spellvariable = 0 {cast 'heal'}

(of course, #WHEN doesn't exist so I need something else)

or

Pattern: "You are almost dying"
Value: #IF (@spellvariable = 1) {#WAIT until it's 0 and then cast 'heal'} {cast 'heal'}

Is this doable? Smile

Cheers,
Mikael
Reply with quote
Mastrun
Newbie


Joined: 11 Jun 2004
Posts: 1
Location: Ireland

PostPosted: Fri Jun 11, 2004 10:17 pm   
 
#al heal {#if (@healvar = 0) {cast heal} {#wait 1000;heal}

this way when you try to heal if you are currently doing somthing else, and @healvar is set to 1, it will keep trying every second to cast the spell until @healvar = 0.

so if you are dying and your trigger tries to cast the heal spell but your var is set to 1 because you are already doing some other action then it will keep trying until you finish your action and var is set to 0, then cast the spell.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri Jun 11, 2004 10:59 pm   
 
Please dont use #wait in triggers. My last post is EXACTLY what you are aiming at with your last you are dying trigger
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