SCAR Code:
Function FindObjects : Boolean;
Var
Bx, By : Integer;
TPA : Array Of TPoint;
ATPA : T2DPointArray;
I : Integer;
Begin
if (FindColorsSpiralTolerance(Bx, By, TPA, SearchColor, MSX1, MSY1, MSX2, MSY2, 10)) then
Begin
ATPA := SplitTPA(TPA, 15);
For I := 0 To High(ATPA) Do
If MiddleTPAEX(ATPA[i], Bx, By) Then
begin
MMouse(Bx, By, 1, 1);
Wait(500 + Random(500));
If IsUpText(SearchText) Then
Begin
Mouse(Bx, By, 1, 1, true);
Flag;
Result := True;
Exit;
end else
begin
Result := False;
Exit;
end;
end;
end;
end;
Fixed up the standards a bit for you also.