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


Joined: 26 Oct 2012
Posts: 56

PostPosted: Fri Oct 26, 2012 1:03 am   

Quick question, help me! :)
 
Hey. So I am using Zmud to run around and kill for me and there's just one problem I keep facing.

I have a trigger to heal when my life points reach a certain low, the only problem is sometimes
when fighting my trigger will fire twice because either I lagged or I am fighting a monster than
gets two hits in per heartbeat. example:
(HP: %1/%2) <-pattern
#IF (%1<150) {heal} <-value.

So snake hits me twice in a row in the same heartbeat
HP: 140/202
HP: 130/202
boom, so my client tries to heal twice which ruins my whole script!!
(I have to run to a pub and back to heal)

Is there a way to fire the healing trigger only once ??

//Newb in need!
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Fri Oct 26, 2012 1:13 am   
 
Use a multistate trigger. Have the first state fire on the HP message and send heal, then have the second state fire on the heal message. It doesn't need to do anything, it'll just make sure that it won't queue two heals at once, since that state will be enabled until your first heal goes through.
Reply with quote
MyMiasma
Wanderer


Joined: 26 Oct 2012
Posts: 56

PostPosted: Fri Oct 26, 2012 1:17 am   
 
awesome, I'll go readup on multistate triggers, but any help or example with code in it would be helpful!
thanks :)
_________________
It is better to die on your feet than to live on your knees.
Reply with quote
MyMiasma
Wanderer


Joined: 26 Oct 2012
Posts: 56

PostPosted: Fri Oct 26, 2012 1:39 am   
 
Ok so I'm having problems getting the multistate to work. Heres what my trigger looks like now

#IF (%1<150) {healk} {}
#COND (The warp possesses your body and you suck its power.) {} {}

"the warp possesses...." is the message I get after I heal up.

What am I doing wrong?
_________________
It is better to die on your feet than to live on your knees.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Oct 26, 2012 1:44 am   
 
The #COND does not go into your trigger pattern.

Try this on the command line:

Code:
#TRIGGER {^HP: (%d)/%d} {#IF (%1<150) {healk}}
#COND {^The warp possesses your body and you suck its power.} {}


Make sure you delete your current trigger, though.
Reply with quote
MyMiasma
Wanderer


Joined: 26 Oct 2012
Posts: 56

PostPosted: Fri Oct 26, 2012 2:27 am   
 
The problem now is whenever I get any life message at all, the trigger state switches over.
for example. I'll enter combat and will get hit and this happens:

guard slashed you
HP: 190/202

So the trigger is recognized, but since it isn't under 150 life it doesn't heal me..
Now my trigger is changed to it's second state and is waiting for my heal message
to revert back. (a.k.a it won't heal my when I drop below 150life)

So what I am looking for out of my trigger is this:

To recognize when I drop under HP: 150/202,
To run my heal alias
To only fire ONCE until after I've healed

Any solutions?
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