|
Shannow Newbie
Joined: 25 Dec 2003 Posts: 2 Location: Australia
|
Posted: Thu Dec 25, 2003 11:48 pm
Help with #If |
Greetings,
I'm trying to write a trigger to restore my hit mana and move to full.
Currently having problems with #If (I'm not even sure this is the best way to achieve what I'm after, so any alternative would be great ;))
Pattern I have triggering is:
You report: (%1)/(%2)H, (%3)/(%4)M, (%5)/(%6)V
#Math DiffH (%2-%1)
#Math DiffM (%4-%3)
#Math DiffV (%6-%5)
#If (@DiffH>0) {medic}{#Show Full HitPoints}
report
I haven't bothered trying to get mana and move working yet as this isn't working. It keeps going even when DiffH is equal to 0.
Hopefully you can see what I'm trying to achieve here, basically I want to use medic once if I'm not on full hit points, if I am on full hit points I don't want it to do anything, and then report so I can continue on with Mana. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Dec 26, 2003 2:46 am |
You shouldn't use %1, %2, etc in the trigger pattern. They are intended for use in the trigger value. Use one of the numeric wildcards, %d or %n. You also shouldn't put the "report" command in your trigger since that will create a trigger loop. You don't really need the variables.
It looks like your problem is that you didn't leave a space between the sections of the #IF command (a very common mistake).
Pattern:
You report: (%n)/(%n)H, (%n)/(%n)M, (%n)/(%n)V
Value:
#MATH DiffH (%2 - %1)
#MATH DiffM (%4 - %3)
#MATH DiffV (%6 - %5)
#IF (%2 > %1) {medic} {#SHOW Full Hitpoints}
The "report" command can be sent at regular intervals with an alarm. |
|
|
|
Shannow Newbie
Joined: 25 Dec 2003 Posts: 2 Location: Australia
|
Posted: Fri Dec 26, 2003 10:35 am |
Thanks that was the problem [8D]
|
|
|
|
|
|
|
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
|
|