Macro for Heal Friend

Ask for help

Moderators: Murderator+, Murderator

Post Reply
legacy
Posts: 7
Joined: 2004-04-04 09:44:36

Macro for Heal Friend

Post 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...
totus
Posts: 48
Joined: 2004-04-17 23:02:41
Location: Odessa, Ukraine
Contact:

Post 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...
...thinking - 37% complete...
legacy
Posts: 7
Joined: 2004-04-04 09:44:36

Post by legacy »

Thanks but not work macro not heal Friend...
totus
Posts: 48
Joined: 2004-04-17 23:02:41
Location: Odessa, Ukraine
Contact:

Post 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...
...thinking - 37% complete...
Yoko
Site Admin
Posts: 1964
Joined: 2004-04-03 16:49:38
Contact:

Re: Macro for Heal Friend

Post 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
legacy
Posts: 7
Joined: 2004-04-04 09:44:36

Post 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
Kazoo
Posts: 173
Joined: 2004-04-03 18:39:28
Contact:

Post by Kazoo »

UO.attack('lasttarget') = UO.attack('laststatus') There is no lasttarget is just laststatus !
WeedDevil
Posts: 32
Joined: 2004-04-06 12:13:49

Post 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...
Post Reply