|
bart796 Beginner
Joined: 28 Sep 2010 Posts: 13
|
Posted: Fri Dec 31, 2010 1:38 am
Could someone tell me how to setup an autoheal trigger |
<474/474 334/1385 570/748 Opp <none> Leader <100%> Exp <21,151,712>
That is my mud prompt and i would like to activate a heal trigger when Leader <100%> gets below 70%. Could anyone tell me how to set this up? |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Fri Dec 31, 2010 4:26 am |
Basically you need a trigger like this.
Code: |
Pattern:^<%d/%d * Leader <(%d~%)>
Code: #IF (%1 < 70) {cast heal}
|
The pattern basically catches what the leaders hp is, and tests the value in the code with a #IF. You should also read up on #TRIGGER |
|
_________________ Asati di tempari! |
|
|
|
bart796 Beginner
Joined: 28 Sep 2010 Posts: 13
|
Posted: Fri Dec 31, 2010 10:06 am |
i tested your code out (which is similiar to one i tried already myself) and it fires every time my prompt shows even when leader is sitting at 100%. I understand how this code should work and and i fiddled around with some tweaks but it simply wants to fire everytime a newline appears. If it would make it easier i could change the prompt to something else..im not entirely sure what would be good. I could do something like Leader <100%/100%> so that when Leader <70%/100%> shows up it fires? maybe that would work better? im totally confused honestly
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Dec 31, 2010 5:47 pm |
Tech made a little typo by placing the ~% inside the parentheses for the leader health. This means that %1 would be X% instead of just X, and since X% is not a number it's probably evaluating to non-zero (most likely 1.) Move the ) to the other side of the ~ and it should work properly.
Note that his #IF command only checks the value of the leader health as shown on the just-matched line. This means it will attempt to cast heal with every prompt, which might be spammy enough that you don't want to do that. A state variable (state meaning that it only has a finite set of possible values, such as 0 and 1, on and off, etc) may be needed to control the spam. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
bart796 Beginner
Joined: 28 Sep 2010 Posts: 13
|
Posted: Sun Jan 02, 2011 1:49 am |
no no it works awesome thanks! everytime the prompt returns and is below 70% it fires the heal spell until it is back above 70 which is 100% what i wanted it to do (i walk away from the computer alot to do stuff and the guy i group with died once and so i figured i needed and autoheal and this works amazingly!)
|
|
|
|
|
|