Page 1 of 1

Macro for Heal Friend

Posted: 2004-05-15 20:23:01
by legacy
sub life()
var Friend=0x000040ea
while uo.life > 0
if ((UO.GetHP('Friend')) <20 then
UO.usetype("bandage")
UO.WaitTargetLast()
UO.warmode(0)
wait(2000)
endif
if ((UO.GetHP('Friend')) == UO.GetMaxHP('Friend')) then
UO.warmode(1)
UO.attack('lasttarget')
wait(1000)
endif
wend
wait(1000)
end sub

but not work friend have 10/100 HP and macro not stop for heal...

Posted: 2004-05-15 20:56:35
by totus
Try this...

Code: Select all

Life(0x000040ea)


Code: Select all

sub Life(Friend)
     While (UO.Life > 0)
            if (UO.GetHP(Friend) < 20) then #it doesn't work fine, cuz UO.GetHP() doesn't give EXACT information about HP
            While (UO.GetHP(Friend) < UO.GetMaxHP(Friend))
                     UO.WarMode(0)
                     UO.WaitTargetObject(Friend)
                     UO.UseType('bandage')
                     Wait(2000)                     
            WEnd
            EndIf
            UO.WarMode(1)
            UO.Attack('lastattack')
            Wait(1000)             
      WEnd
end sub


always urs, totus...

Posted: 2004-05-15 21:28:40
by legacy
Thanks but not work macro not heal Friend...

Posted: 2004-05-15 21:57:44
by totus
Of course...
Cuz UO.GetHP() doesn't return exact information about Hit Points of the object...

If u wanna heal urself, use UO.Life instead of UO.GetHP()...

U may use UO.GetHP() with UO.GetMaxHP() and in that case it's gonna be fine...

Re: Macro for Heal Friend

Posted: 2004-05-16 21:35:50
by Yoko
legacy wrote:if ((UO.GetHP('Friend')) <20 then

if ((UO.GetHP('Friend')*100/UO.GetMaxHP('Friend')) <20 then

also check out that Track World enabled in Main tab

Posted: 2004-05-17 09:57:34
by legacy
Yoko iam run script and injection says Unhandled exception in parser

sub life()
var Friend=0x000040ea
while uo.life > 0
if ((UO.GetHP('Friend')*100/UO.GetMaxHP('Friend')) <20 then
UO.usetype("bandage")
UO.WaitTargetLast()
UO.warmode(0)
wait(2000)
endif
if ((UO.GetHP('Friend')) == UO.GetMaxHP('Friend')) then
UO.warmode(1)
UO.attack('lasttarget')
wait(1000)
endif
wend
wait(1000)
end sub

Track World item eneabled

Posted: 2004-05-17 22:48:23
by Kazoo
UO.attack('lasttarget') = UO.attack('laststatus') There is no lasttarget is just laststatus !

Posted: 2004-05-18 13:50:59
by WeedDevil
wrong asnwer kazoo.... thats not the problem with the script...
the problem is found in the IF statement... but i couldnt see whats wrong with it yet..

first thing what is wrong, but still wont solve the probelm is that uo.getblblabl("friend") is wrong you specified Friend as a variable so it must not have the quotation marks around it... (uo.gethp(friend)) would be right in this part..

but as i said... still problem isnt solved...