SCAR Code:
// * function FindFishSpotsTPA(var VTPA:TPointArray): Boolean; // by Rasta Magician, fixed by Marpis
// * Function FindFishSpot(var xx, yy: integer; which: string): Boolean; // by Rasta Magician
{*******************************************************************************
function FindFishSpotsTPA(var VTPA:TPointArray): Boolean;
By: Rasta Magician, fixed by Marpis
Description: Finds all possible Fish Spots and stores them in the given TPA
Returns true if found at least one, false if none
*******************************************************************************}
function FindFishSpotsTPA(var VTPA:TPointArray): Boolean;
var
TPA, tempTPA: TPointArray;
ATPA: T2DPointArray;
i, tmpCTS, VTPASize, T: Integer;
TP: TPoint;
begin
Result := False;
if (not LoggedIn) then exit;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.12, 0.27);
T := GetSystemTime + 700;
repeat
FindColorsSpiralTolerance(MSCX, MSCY, tempTPA, 11117214, MSX1, MSY1, MSX2, MSY2, 3);
TPA := CombineTPA(tempTPA, TPA);
until(GetSystemTime > T);
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (Length(TPA) < 1) then exit;
VTPASize := 1;
SetLength(VTPA, 1);
ATPA := SplitTPA(TPA, 10);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
SortATPAFromFirstPoint(ATPA, Point(MSCX, MSCY));
for i := 0 to High(ATPA) do
begin
TP := MiddleTPA(ATPA[i]);
VTPA[VTPASize - 1] := TP;
Inc(VTPASize);
SetLength(VTPA, VTPASize);
end;
Result := (VTPASize > 1);
end;
{*******************************************************************************
function FindFishSpot(var xx, yy: integer; which: string): Boolean;
By: Rasta Magician
Description: Finds a fishing spot, according to your needs.
Stores (x, y) coordinates to the given variables.
which:
'harpoon' -> Harpoon fishing
'cage', 'lobster' -> Cage Fishing
'fly', 'flyfish' -> Fly Fishing
'rod', 'bait' -> Bait Fishing
'net' -> Net Fishing
*******************************************************************************}
function FindFishSpot(var X, Y: Integer; Which: string): Boolean;
var
TPA: TPointArray;
s: string;
i: integer;
begin
if (not FindFishSpotsTPA(TPA)) then exit;
case lowercase(which) of
'harpoon': S := 'arpoon Fis';
'cage', 'lobster': S := 'age Fis';
'fly', 'flyfish': S := 'ure Fis';
'rod', 'bait': S := 'ait Fis';
'net': S := 'et Fis';
end;
for i := 0 to High(TPA) do
begin
MMouse(TPA[i].x, TPA[i].y, 5, 5);
if WaitUpText(S, 375) then
begin
GetMousePos(X, Y);
Wait(Random(100));
Result := True;
Exit;
end else
begin
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, False);
if WaitOptionEx(S, 'all', Nothing, 375) then
begin
ChooseOption('ancel');
Result := True;
Exit;
end;
ChooseOption('ancel');
end;
end;
end;