hello,
i'm making a script where one of my chars will cast magic arrow on my another char. i need my script to STOP casting magic arrow and wait for him to heal up when target's hp reaches lets say 20hp. how do i do that?
stop if last target has below 20 HP
Moderators: Murderator+, Murderator
Re: stop if last target has below 20 HP
utternoob wrote:hello,
i'm making a script where one of my chars will cast magic arrow on my another char. i need my script to STOP casting magic arrow and wait for him to heal up when target's hp reaches lets say 20hp. how do i do that?
Try to do something like this:
Code: Select all
sub magicarrow()
var target = '0x000000' ; serial of the 2nd char
var mana
while not uo.dead()
mana = uo.mana
uo.cast( 'Magic Arrow', target )
repeat
wait( 100 )
until mana > uo.mana
if uo.gethp( target ) < 20 then
while uo.gethp( target ) <> uo.getmaxhp( target )
wait( 100 )
wend
endif
wend
endsub
Also you can add here reagents and mana check
