I have some issues trying to perfect the healing on my war supplies bot, so it doesn't just pop the healing stance as soon as it fights, better if we get down to 75% ish health and then use it, so it lasts better during the fights.
I remember using the first code below, like a year ago and worked fine, but now it just pops the healing stance even if we are 100% health, meaning it doesnt get the struct health percentage?.
So i tried using the GetHealth() function, and it does work on myself, but for some reason it cannot get mikus health properly. I know for a fact that she has 600 health, because i've tried:
If GetHealth(-1) < 601 then......
If GetHealth(-1) > 600 then.....
and those worked for me, but if i do like < 400, wich is 75% then it just heals when shes 100%..
Does anybody know a better way? would greatly appreciate it:D
I remember using the first code below, like a year ago and worked fine, but now it just pops the healing stance even if we are 100% health, meaning it doesnt get the struct health percentage?.
So i tried using the GetHealth() function, and it does work on myself, but for some reason it cannot get mikus health properly. I know for a fact that she has 600 health, because i've tried:
If GetHealth(-1) < 601 then......
If GetHealth(-1) > 600 then.....
and those worked for me, but if i do like < 400, wich is 75% then it just heals when shes 100%..
Does anybody know a better way? would greatly appreciate it:D
Code:
local $mmiku
$mmiku = getagentbyname("Miku")
If DllStructGetData($mself, "HP") < 0.7 Or DllStructGetData($mmiku, "HP") < 0.5 Then ;Have Also tried -2 instead of $mself.
If canuseskill(6, 2) Then
useskill(6, $mselfid)
Return True
EndIf
EndIf
Code:
Local $mmiku
Local $ldistance
;HEAL BOTH OR SELF
If GetHealth(-2) < 450 Then ;75%hp (works on me)
$mmiku = TargetNearestAlly()
Sleep(getping() + 100)
If GetHealth(-1) < 400 Then ;75% hp (this one doesnt work on her)
If IsRecharged(6) Then
out("Healing Us")
Sleep(getping() + 50)
useskill(6, 2)
$ldistance = getdistance(-1, -2)
If $ldistance > 900 Then
out("Moving Closer To Miku to heal")
ControlSend(getwindowhandle(), "", "", "{space}")
Sleep(getping() + 1500)
EndIf
EndIf
Else
If IsRecharged(6) Then ;heal only self (doesnt run to miku if necessery)
out("SelfHeal")
Sleep(getping() + 50)
useskill(6, 2)
Sleep(getping() + 100)
EndIf
EndIf
EndIf