from my gnome agility runner
function CompleteStump(): Boolean;
var
I, x, y: Integer;
TPA: tPointArray;
m: tTile;
P: tPoint;
timer: LongInt;
H: Integer;
begin
with ObjectRecord[BRANCH] do
begin
m := tile(2486, 3419);
P := TileToMS(m, 3);
FindColorsTolerance(TPA, color, P.x-15, P.y-15, P.x+15, P.y+15, 8);
if Length(TPA) <= 0 then
Exit;
if High(TPA) > 3 then
H := 3
else
H := High(TPA);
for I := 0 to H do
begin
mMouse(TPA[i].x, TPA[i].y, 5, 5);
if waitUpText(uText, 500) then
begin
getMousePos(x, y);
Mouse(x, y, 5, 5, true);
Result := true;
Break;
end;
end;
timer := getSystemTime();
while not FindBlackChatMessage(sMessage) do
begin
FindNormalRandoms();
wait(randomRange(200, 300));
if getSystemTime-timer > 2500 then
begin
writeLn('didn''t find the chatmessage');
Exit;
end;
end;
while DistanceFrom(tTileArr[END_]) > 1 do
begin
FindNormalRandoms();
if FindBlackChatMessage(eMessage) then
Exit;
if getSystemTime-timer > 12000 then
Exit;
if Random(25) = 1 then
SleepAndMoveMouse(RandomRange(1000, 2400));
end;
end;
end;
notably looking at the first part of
m := tile(2486, 3419);
P := TileToMS(m, 3);
FindColorsTolerance(TPA, color, P.x-15, P.y-15, P.x+15, P.y+15, 8);