Try this...
SCAR Code:
function FindAnvil(FAnvil: TPoint): Boolean;
var
AnvilColors, Anvil: TPointArray;
Anvils: T2DPointArray;
I, C: Integer;
begin
FindColorsSpiralTolerance(MScX, MScY, AnvilColors, 5131860, MSx1, MSy1, MSx2, MSy2, 30);
if (Length(AnvilColors) < 1) then
Exit;
Anvils := SplitTPA(AnvilColors, 10);
C := High(Anvils);
SetArrayLength(Anvil, C + 1);
for I := 0 to C do
Anvil[I] := MiddleTPA(Anvils[I]);
for I := 0 to C do
begin
MMouse(Anvil[I].X, Anvil[I].Y, 5, 5);
Wait(50 + Random(50));
if (IsUpText('..........???')) then
begin
GetMousePos(FAnvil.X, FAnvil.Y);
Result := True;
Exit;
end;
end;
end;
Use as:
SCAR Code:
if (FindAnvil(TheAnvil)) then
begin
Mouse(TheAnvil.x, TheAnvil.y, 0, 0, True);//no randomness as my function has already done it, but if you move the mouse before you Click the anvil, add like 5, 5 randomness.
....
end;