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


Joined: 09 Jan 2006
Posts: 86

PostPosted: Wed Aug 30, 2006 3:54 pm   

Capture Hpbar
 
Hi, I'm trying to capture part of my hp bar and store the values as different vars.
Under different circumstances, there are slight differences in my hpbar, was wondering if anyone can help me out. Let me elaborate

Combat Hp Bar:
[E: bruises-= | =-
(bruises is just the health of the mob, i don't think its very impt)

Non-Combat Hp Bar:
[E: -= | =-

my trigger
#TRIGGER {~[E~: (*)~-~=(*)~|(*)~=~-} {#GAG;#VAR mobhealth %1;#VAR effects %2;#VAR pherbs %3}

in combat, this appears every round my hpbar triggers it,
Variable: effects None
Variable: pherbs None

Out of combat, this appears
Variable: mobhealth bruises
Variable: effects None
Variable: pherbs None

Anyone able to help me out with it, i don't understand why all these variables keep coming out..
thanks
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Wed Aug 30, 2006 4:44 pm   
 
It would help a lot if you posted actual examples of your prompt in battle and outside of battle.

But I think I figured out what the problem is. When your pattern that matches is the empty string (which for example happens to mobhealth your prompt matches outside of combat}, then you have in essence issued the command
Code:
#VAR mobhealth
and for zMud the behaviour of such a command is to display the variables current value.

The simplest solution would be to wrap the variable assignments in Curly Brace { } so it always knows that it's doing an assignment. The resulting code looks like this.

Code:
#TRIGGER {~[E~: (*)~-~=(*)~|(*)~=~-} {#GAG;#VAR mobhealth {%1};#VAR effects {%2};#VAR pherbs {%3}}


Try that and let me know if it works.
_________________
Asati di tempari!
Reply with quote
sav
Wanderer


Joined: 09 Jan 2006
Posts: 86

PostPosted: Wed Aug 30, 2006 4:59 pm   
 
hey, it works! thanks alot man!
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