Code:
sub AutoHeal()
var player = uo.getserial('self')
VAR Success = ': HP +'
VAR Fizzle = ': *Healing Failed*'
VAR bandag = '0x0E21'
VAR healtimer
start:
while not uo.Dead()
If UO.GetHP() < UO.GetMaxHP() - 1 Then
If UO.Count( Bandag ) > 0 Then
uo.DeleteJournal( Success )
uo.DeleteJournal( Fizzle )
uo.DeleteJournal('Healing,')
uo.msg('.bandageself')
healtimer = uo.timer()
repeat
wait(50)
if healtimer + 30 <= uo.timer() and not UO.InJournal('Healing,') then
uo.print('Script restarted!')
goto start
end if
until uo.JournalSerial(UO.InJournal(Success)-1) == player or uo.JournalSerial(UO.InJournal(Fizzle)-1) == player or UO.GetHP()==UO.GetMaxHP()
Else
uo.print('Bandage not found!')
wait(500)
Endif
Else
wait(500)
Endif
wend
wait(1500)
uo.print('You are ghost!')
while uo.Dead()
wait(500)
wend
goto start
end sub