Infantry001
2009-08-17 04:20:48
I'm reviving my Monastery Terrorist, and I came across a problem.
My CheckHealth function walks to the bottom-right corner of the Monastery where Abbot Langley resides. This is where players can heal. I've set the healing to stop at 100%, but for some reason, it doesn't work.
Here's the function:
And here's the debug:
Obviously, HPRatio is not updating, and therefore, my player heals infinitely. Can anyone spot the problem? Or is it possibly a problem with Reflection?
My CheckHealth function walks to the bottom-right corner of the Monastery where Abbot Langley resides. This is where players can heal. I've set the healing to stop at 100%, but for some reason, it doesn't work.
Here's the function:
function CheckHealth : boolean;
var
HPRatio, I : integer;
begin
if not LoggedIn then exit;
HPRatio := GetMe.HPRatio;
InfDebug('Hp - ' + IntToStr(HPRatio) + '%');
if HPRatio <= HealPercent then
begin
WalkToTileEx(HealMonk, 3, 0);
Players[CurrentPlayer].Loc := 'Healing';
repeat
if (HPRatio >= 99) then break;
if I > 20 then break;
Inc(I);
if FindNPC(801,Monk) then
begin
Mouse(Monk.MS.X,Monk.MS.Y,2,2,true);
Wait(200 + Random(500));
ClickToContinue;
Wait(500 + Random(500));
FindNPCChatText('heal',ClickLeft);
repeat
Wait(500 + Random(500));
until(not ClickToContinue)
result := true;
Wait(250 + Random(250));
end;
HPRatio := GetMe.HPRatio;
InfDebug('HP healed to ' + IntToStr(HPRatio) + '%');
until(false)
ReportVars[3] := ReportVars[3] + 1;
Players[CurrentPlayer].Integers[2] := Players[CurrentPlayer].Integers[2] + 1;
Calibrate;
end;
end;And here's the debug:
Hp - 49%
HP healed to 49%
HP healed to 49%
HP healed to 49%
HP healed to 49%
HP healed to 49%Obviously, HPRatio is not updating, and therefore, my player heals infinitely. Can anyone spot the problem? Or is it possibly a problem with Reflection?