|
Lokke11 Beginner
Joined: 27 Apr 2007 Posts: 16
|
Posted: Mon Sep 27, 2010 8:03 am
Help with a Heal Script |
Just looking for a heal script that will look at my groups health and will determine which one is the lowest and set that member to a hotkey.
This is a copy of what comes off mud when I type group:
Your group consists of ( 2/30):
( Head) 1693/1693 hit, 193/193 move Freddy
(Front) 1210/1210 hit, 149/149 move Batman
(Front) 500/751 hit, 125/125 move Robin
Let me know if you need more information to make this work.
Thanks ahead of time. |
|
|
|
Lokke11 Beginner
Joined: 27 Apr 2007 Posts: 16
|
Posted: Fri Oct 15, 2010 3:51 pm |
Pattern: [~(Front~)|~(Back~)|~( Head~)]%s(%d)/(%d)*hit,*{move|mana} (%w)
Trigger:
#math hurtLevel (%1 * 1000/ %2)
#math maxHps %2
#math curHps %1
#if (@mostHurtLevel > @hurtLevel) {#var mostHurt %3}
#mat mostHurtLevel @hurtLevel
And I have this button to se the @musthurtleve:
#va mosthurt nothing
#va mosthurtlevel 1000
group
The problem I am having is that it is only recognizing the last person in the group as the most hurt even if they are only damaged 1hp.
Suggestions? |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Fri Oct 15, 2010 6:37 pm |
I'm not sure what your are trying to do with the HurtLevel or why you are multiplying by a thousand but when I tested the code it worked seemed to set the 'mosthurt' correctly.
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<var name="Text" copy="yes">Your group consists of ( 2/30):
( Head) 1693/1693 hit, 193/193 move Freddy
(Front) 110/1210 hit, 149/149 move Batman
(Front) 500/751 hit, 125/125 move Robin </var>
<trigger priority="20" copy="yes">
<pattern>[~(Front~)|~(Back~)|~( Head~)]%s(%d)/(%d)*hit,*{move|mana} (%w)</pattern>
<value>#math hurtLevel (%1 * 1000/ %2)
#math maxHps %2
#math curHps %1
#echo %3 -- @mostHurtLevel @hurtLevel (@mostHurtLevel > @hurtLevel)
#if (@mostHurtLevel > @hurtLevel) {#var mostHurt %3}
#mat mostHurtLevel @hurtLevel
</value>
</trigger>
<alias name="test" copy="yes">
<value>#VAR mosthurt ""
#show @text
#echo @mosthurt</value>
</alias>
</cmud> |
I simply ran the test alias in a blank session. |
|
_________________ Asati di tempari! |
|
|
|
Lokke11 Beginner
Joined: 27 Apr 2007 Posts: 16
|
Posted: Fri Oct 15, 2010 6:57 pm |
Yea the trigger itself works. Just the problems I am having it one, how to clear a variable that is set to nothing. Like if I run the trigger and it says Batman is most hurt, I heal him, then no one is hurt, the variable still is set to Batman and would like to clear that so if I hit the macro button it wont waste a heal on someone full health.
Also, It doesnt not seem to recognize the person who is the most hurt via the math. I'm at a loss on how to create this. It works when there is just 1 person hurt, but doesnt seem to get the right person who is the lowest.
This was a trigger I was/am using on zmud 4.62. |
|
|
|
|
|