|
Konquer Newbie
Joined: 31 Mar 2006 Posts: 4
|
Posted: Fri Mar 31, 2006 7:10 am
Newbie needs help |
I'm sure this is asked ALLOT, but I'm having trouble with getting my prompt trigger to work. All that I want is something that will auto heal if I drop below a certain percent of health. Here is my current prompt:
[HP] 505/505/(100)% [MANA] 1261/1261 [Op] (0)% [MV] 246
[HP] %h/%H/%z [MANA] %m/%M [Op] %Z [MV] %v
%h - Current hit points
%H - Maximum hit points
%z - Current hit points as a percentage
%m - Current mana
%M - Maximum mana
%Z - Current opponent hit points as a percentage
%v - Current Movement
I have been experimenting but since I have no idea of what I'm doing, my results have done nothing but failed. All other triggers have been working except this one. Thanks in advance. |
|
|
|
mr_kent Enchanter
Joined: 10 Oct 2000 Posts: 698
|
Posted: Fri Mar 31, 2006 9:19 am Re: Newbie needs help |
You might want to check out Pattern Matching under the References (last) heading of zMUD help.
Pattern: {~[HP~] (%d)/(%d)/~((%d)~)~% ~[MANA~] (%d)/(%d) ~[Op~] ~((%d)~)~% ~[MV~] (%d)
Action: #VAR h %1;#VAR H %2;#VAR z %3;#VAR m %4;#VAR M %5;#VAR Z %6; #VAR v %7
Or, alternatively:
~[HP~] &h/&H/~(&z~)~% ~[MANA~] &m/&M ~[Op~] ~(&Z~)~% ~[MV~] &v |
|
|
|
Konquer Newbie
Joined: 31 Mar 2006 Posts: 4
|
Posted: Fri Mar 31, 2006 4:26 pm |
ok, i got it working now but now it's working too well. Here's my script.
#TR {^~<%d/%dhp %d/%dm %d/%dmv>}
#IF (@hp < 350) {hm}
#IF (@mana < 300) {#echo LOW MANA}
how can I modify it so that it waits until after the heal is cast before it reads the prompt again?
It's currently over casting between 3 to 5 times after the battle and waisting allot of mana. |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Fri Mar 31, 2006 11:36 pm |
You just need to set a flag to tell if you've tried healing yet or not.
No zmud to test on nearby, but think this should work...
(replace the 'You heal yourself' bit with whatever your healing text really is)
Code: |
#TR {^~<%d/%dhp %d/%dm %d/%dmv>} {
#IF (@hp < 350) {#IF (@healing = 0) {healing = 1; hm}}
#IF (@mana < 300) {#echo LOW MANA}
}
#TR {You heal yourself} {healing = 0} |
|
|
|
|
Konquer Newbie
Joined: 31 Mar 2006 Posts: 4
|
Posted: Sat Apr 01, 2006 7:06 pm |
Well I simplified everything all together. since knowing how much mana i have really isn't a must, I wote this instead. Even though it's EXTREMLY simply, it work very well.
#TR {^~<%d/%dhp %d/%dm %d/%dmv>}
#IF (@hp > 300) {km} {hm}
basically, if my hp is over 300 I auto cast 'harm' mob, if not I heal myself. Considering that 300 is 50% of my now current hp, the mobs I'm fighting don't have a chance to killme:) |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Apr 01, 2006 8:03 pm |
Question, how are you populating @hp, or did you just leave off all the variable assignment stuff as well as the () in the trigger pattern?
Also, to spruce it up a bit so that you don't have to keep changing the if condition, try this:
#if (@hp > %eval(@maxhp / 2)) {km} {hm} |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|