 |
sav Wanderer
Joined: 09 Jan 2006 Posts: 86
|
Posted: 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 |
|
|
 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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
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! |
|
|
 |
sav Wanderer
Joined: 09 Jan 2006 Posts: 86
|
Posted: Wed Aug 30, 2006 4:59 pm |
hey, it works! thanks alot man!
|
|
|
 |
|
|