Code:
program new;
{$i srl/srl.simba}
{$i sps/sps.simba}
var
x,y:integer;
Procedure ReturnValues(colors: TIntegerArray; var HueMods, SatMods: Extended; var color, Tolerance: Integer);
Var
h, s, t: Extended;
I,II : integer;
HSLColor : Array[1..3] of Extended;
HSL : Array[0..1] of Array[1..3] of Extended;
begin;
For I:= 1 to 3 do
begin;
HSL[0][i] := 255;
end;
For I:= 0 to High(Colors) do
begin;
ColortoHSL(Colors[i],HSLColor[1],HSLColor[2],HSLColor[3]);
For II:= 1 to 3 do
begin;
HSL[0][II] := MinE(HSLColor[II],HSL[0][II]);
HSL[1][II] := MaxE(HSLColor[II],HSL[1][II]);
end;
end;
H := (HSL[1][1] - HSL[0][1]);
S := (HSL[1][2] - HSL[0][2]);
T := (HSL[1][3] - HSL[0][3]);
try
HueMods := (H/T);
SatMods := (S/T);
Tolerance := Round(t);
except
HueMods := 0;
SatMods := 0;
Tolerance := Round(0.0);
end;
Color := HSLToColor((HSL[1][1] + HSL[0][1]) div 2,(HSL[1][2] + HSL[0][2]) div 2,(HSL[1][3] + HSL[0][3]) div 2);
end;
Function FindFishingSpot(Var X,Y: Integer): Boolean;
var
B: TBox;
TPA: TPointArray;
Hmod,Smod: Extended;
L,i,Tol,CTS,Col: Integer;
ATPA: T2DPointArray;
begin
Result := False;
ReturnValues([5345425,6466990,5279375 ,5273457], Hmod, Smod, Col, Tol);
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Hmod, SMod);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Col, MSX1, MSY1, MSX2, MSY2, Tol);
ColorToleranceSpeed(CTS);
if (Length(TPA) < 1) then
Exit;
ATPA := TPAToATPAEx(TPA, 40, 40);
SortATPAFrom(ATPA, Point(MSCX,MSCY));
L := High(ATPA);
SetArrayLength(ATPA, L+1);
for i := 0 to L do
begin
if (GetArrayLength(ATPA[i]) > 5) then
begin
B := GetTPABounds(ATPA[i]);
MiddleTPAEx(ATPA[i], X, Y);
MMouse(X, Y, 2, 2);
if WaitUpTextMulti(['ick', 'Pic'], 400) then
begin
Result := True;
GetMousePos(X, Y);
Exit;
writeln('Found Spot');
end else
Result := False;
end;
end;
end;
begin
MouseSpeed := RandomRange(15, 25);
If FindFishingSpot(x, y) then
WriteLn(x);
WriteLn(y);
end.