SCAR Code:
function FindBankBooth : Boolean;
var
TPAA : TPointArray;
ATPAA : TpointArrayArray;
I,U,K,x,y : Integer;
begin
MarkTime(U);
FindColorsTolerance(TPAA,5461593,MMX1,MMY1,MMX2,MMY2,10);
{Maybe you want yo use a higher tolerance?}
GetArrayLength(TPAA); {
What do you use this for?
It returns an integer, you should either save the
result, or just don't call it. }
ATPAA := SplitTPAEx(TPAA,15,15);
{I personally do not use SplitTPA,
because the distance it sorts at is not really '15',
it varies alot. I recommend TPAToATPA.}
SortATPAFromFirstPoint(ATPAA,IntToPoint(MSCX,MSCY)); {You can just use Point(MSCX, MSCY) here.}
for i:= 0 to High(TPAA) do
begin
{Maybe a length check first?
If Length(TPAA[i] < 5 then
continue; }
MiddleTPAEx(ATPAA[i],x,y);
MMouse(x-2,y+2,11,11);
wait(50+random(50))
if IsUpText('ooth') then
begin
Mouse(x,y,2,2,false);
wait(100+random(100))
ChooseOption('uickly');
K := TimeFromMark(U);
Result:=True;
Writeln('Bank opened and found in '+IntToStr(K)+' milisecs');
Exit;
end;
end;
end;