FFlag works in a similar fashion like Flag, only FFlag solves a number of problems for you.
1. It has a build-in timer, that solves the Hanging-Flag problem that sometime occurs (Flag wont go away from screen). If the Flag is still visible after 20 seconds, it will replant the Flag once at Color 255 (= itself). After that, you are on your own...
2. FFlag exits, when the Flag is within Distance distance. As a result, your Player will roadwalk without stopping between each click.
SCAR Code:
{*******************************************************************************
procedure FFlag(Distance: Integer);
By: Wizzup? / WT-Fakawi.
Description: Waits until Flag is within "Distance" distance.
*******************************************************************************}
procedure FFlag(Distance: Integer);
var
XK, YK, XL, YL : Integer;
var
T1, T2 : Extended;
begin
T1 := GetTickCount;
repeat
T2 := GetTickCount;
Wait(100);
if HumanCircleFlag(Distance) then
Break;
Wait(100);
if T2 - T1 > 30000 then
begin
if FindColor(XL, YL, 255, MMX1, MMY1, MMX2, MMY2) then
MouseFindFlag(XL, YL, 1, 1)
else Mouse(MMCX, MMCY, 0, 0, True);
break;
end;
if Random(20) = 1 then IdleTime(500,1000,0.01);
until (not FindColor(XK, YK, 255, MMX1, MMY1, MMX2, MMY2));
end;