|
Tyraelxv2 Newbie
Joined: 27 May 2011 Posts: 7
|
Posted: Fri May 27, 2011 6:48 pm
Help with trigger! |
I need help making a trigger to heal myself. I want to heal myself at 60%, but my prompt doesnt specify a max. Looks like:
hp: 906 sp: 960 mp: 1056 left foot: 19% Cutting
Thats the display after taking a hit. How do I do this without a max on the prompt?
the healing command would be: apply salve
Sorry for being a complete noob =D |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Fri May 27, 2011 6:54 pm |
you would need to have you max value predetermined and stored in a variable such as @maxHp
Code: |
#TR {hp: (%d) sp: (%d) mp: (%d)} {
hp=%1
#IF (@hp<%eval(@maxHp*0.6)) {apply salve}
} |
something like that should work |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Tyraelxv2 Newbie
Joined: 27 May 2011 Posts: 7
|
Posted: Fri May 27, 2011 6:56 pm |
I forgot to mention that in battle you sometimes get multiple prompts as you get hit multiple times. Would the eval prevent over healing?
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Fri May 27, 2011 7:06 pm |
the eval just figures out what 60% of max is
if you want to make it so this only fires so often... you could turn it off for a timed interval before it turns back on and is able to fire again... that required naming the setting as well.
Code: |
#TR "healingPrompt" {hp: (%d) sp: (%d) mp: (%d)} {
hp=%1
#IF (@hp<%eval(@maxHp*0.6)) {
apply salve
#T- healingPrompt
#ALARM "keephealing" +30 {#T+ healingPrompt}
}
} |
That alarm will keep the trigger from firing but once every 30 seconds |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Tyraelxv2 Newbie
Joined: 27 May 2011 Posts: 7
|
Posted: Fri May 27, 2011 7:07 pm |
Wow ...... thanks for the help~
|
|
|
|
|
|