Using SCAR Assistant and the data from your function, I created this function for you:
SCAR Code:
program SCARAssistant;
{.include SRL/SRL.scar}
function FindObject: Boolean;
var
Colors: TIntegerArray;
X, Y, I, A, M, curCTS: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
Result := False;
if not LoggedIn then exit;
curCTS := GetColorToleranceSpeed;
Colors := [4820866, 2648669, 3240805, 4359803, 4424052, 2385497, 1325361, 1124644, 2381903, 665632, 665632, 2977122];
for I := 0 to 11 do
begin
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Colors[I], MSX1, MSY1, MSX2, MSY2, 7);
if Length(TPA) = 0 then Continue;
ColorToleranceSpeed(1);
ATPA := TPAtoATPAEx(TPA, 30, 30);
M := High(ATPA);
for A := 0 to M do
if MiddleTPAEx(ATPA[A], X, Y) then
begin
MMouse(X, Y, 6, 6);
Wait(100 + Random(50));
if Pos('Yew', RS_GetUpText) > 0 then
begin
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, True);
Result := True;
ColorToleranceSpeed(curCTS);
Exit;
end;
end;
end;
ColorToleranceSpeed(curCTS);
end;
begin
SetUpSRL;
ActivateClient;
Wait(350 + Random(500));
FindObject;
end.
Try to see if you can single out differences between your function and this.