This is just a little script I wrote to keep my character healing himself while running my ilshenar spawner. It only heals w/ bandages and divine furys. My problem is it will apply a bandage & then scan the journal for the message saying you finished healing yourself, but it occasionally misses it and will never badage self again so I die.
:*(
Can anyone see a loop hole anywhere that may be causing it? I'd like to add a timeout value based on your dex & healing speed tables, but would be nice to figure out this problem first before working around what may be just a error in my code.
set %heal TRUE
set #lpc 500
set %timeout 999999
set %nextdf 0
loop:
if %heal = FALSE
gosub scan
if #stamina < 84 && %nextdf < #SCNT2
{
event macro 15 205
set %nextdf #SCNT2 + 40
}
if %heal = TRUE
{
if #hits < #maxhits
{
redobandage:
finditem ZLF C_ , #backpackid
if #findkind = -1
sound
set #lobjectid #findid
event macro 17
target 1s
if #targcurs <> 1
goto redobandage
while #targcurs <> 0
{
event macro 23
}
set %heal FALSE
set %lindex #jindex
}
}
goto loop
sub scan
if #jindex = %lindex
return
set %temp #jindex
for %a %lindex %temp
{
scanjournal %a
if finish_applying_the_bandages in #journal || you_apply_the_bandages,_but in #journal || heal_what_little in #journal
{
set %heal TRUE
set %lindex %temp
return
}
}
set %lindex %temp
return