|
rcgspn Newbie
Joined: 27 Dec 2001 Posts: 2
|
Posted: Thu Dec 27, 2001 8:35 pm
Health monitoring trigger questions |
My apologies for my ignorance, but I just don't know the syntax on how to do this:
How do you setup a trigger to do an action once your health gets down below a certain point?
Thanks! |
|
|
|
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: Thu Dec 27, 2001 11:39 pm |
Since you didn't tell us what your prompt looks like, let's pretend it looks like this:
<932hp 783ma 394mv>
You could then write a trigger as follows:
#TRIGGER {~<(%d)hp %dma %dmv~>} {#IF (%1 < 100) {cast 'heal' self} } "" "prompt"
Things to note: In the trigger the pattern %d represents digits. To capture a number enclose the %d in parentheses. The first such captured number is stored to %1. In the trigger value portion %1 is checked to see if it's less than 100 -- if so, the heal spell is cast. Note also the word "prompt" indicates that this trigger should fire on prompt. Because < and > are special characters in zMUD, they are preceded with the quote character, ~, so they are treated literaly.
Troubadour |
|
|
|
rcgspn Newbie
Joined: 27 Dec 2001 Posts: 2
|
Posted: Fri Dec 28, 2001 12:50 am |
Ok. Here's what it looks like:
The health/mana display is displayed as such:
H:933 M:821
When the health gets to a certain point, I want it to drink health. Thus:
#TRIGGER {H:&HpVar M:&Manavar}
#If (@HpVar < 500) {drink vial}
However, here's the tricky part. In this system, you have to wait a bit before you can drink the vial again. Thus, I setup another variable called vialbalance. When it receives the message "You may drink your vial again," it will change the vialbalance variable to true and will, hopefully, force the character to drink again. My main problem now, is how do I setup 2 conditions in one if statement? Again, I think this is another syntax issue. Thank you again. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Dec 28, 2001 2:38 pm |
Just include both conditions in the #IF statement
#TRIGGER {H:&HpVar M:&Manavar} {#If ((@HpVar < 500) AND (@vialbalance = true)) {drink vial}}
LightBulb |
|
|
|
|
|