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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
jbrady33
Newbie


Joined: 07 Jul 2011
Posts: 3

PostPosted: Thu Jul 07, 2011 2:41 pm   

Need trigger with variables help - or alternate suggestion
 
Hi all, new users here, just paid up and registered :)

Having a problem, doing a 2 character multiplay - call them CH1 and CH2. CH1 is a warrior/tank, CH2 is healing cleric. Trying to auto heal the tank, based on the prompt, which looks like this during a fight:

Code:
284/300 124/124 4751606 {Small Wounds}/excellent>


that's currentHP/maxHP currentMana/maxMana exp_to_next_level {enemy_condition}/Tank Condition>

If there is a cleaner way to do this, please speak up! :) What I came up with is that if the end of the prompt goes to /Fair>, this trigger fires on the the tank (CH1):

Code:
#IF (@pending != 1) {tell CH2 heal me!}
#VARIABLE pending 1


The "tell" fires a separate trigger on the cleric with this:

Code:
cast 'heal' CH1
CH1:#VARIABLE pending 0


The reason for the variables is that without them the trigger set fires 3 times and wastes 2 heals worth of mana. (Because the prompt returns several times before the heal actually happens)
If this fixed it I would be good, but it doesn't - since the variable ins't set or unset until after the prompt has triggered a new instance 2 or 3 extra times :(


Any suggestions to get one heal, wait for success (you heal CH1) or failure (You lost your concentration) before allowing another instance to trigger?

Thanks!
Reply with quote
aslanthekat
Novice


Joined: 17 Sep 2007
Posts: 44
Location: Missouri

PostPosted: Fri Jul 08, 2011 7:32 pm   
 
I think you might want to look into multistate triggers http://forums.zuggsoft.com/modules/mx_kb/kb.php?page=3&mode=doc&k=2993
Essentially, the first pattern matches and does something or nothing, moves on and waits for the next pattern in the multistate trigger to be matched.
Reply with quote
aslanthekat
Novice


Joined: 17 Sep 2007
Posts: 44
Location: Missouri

PostPosted: Fri Jul 08, 2011 7:59 pm   
 
If I'm understanding you correctly... It might look something like....
Code:
#TR healtrig {fair>$} {c heal CH1}
#cond healtrig {{you heal CH1|You lost your concentration}} {#if (%line(0)="You lost your concentration") {c heal CH1}}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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