SRL Archive - SRL Archives

Fixed: FindFishSpotTPA


marpis

2009-10-03 19:21:04

It used to have 11 tolerance which accepted the whole water area I suppose.
I fixed it to use tolerance 3 and search for colors for 700ms so it also notices spots that aren't showing (because of the fishingspot animation)

Also removed FindWhirlpool.


Function FindFishSpotsTPA2(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));
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;

EvilChicken!

2009-10-03 23:05:35

Looking like nice work!

How well have this been tested?

marpis

2009-10-04 02:37:21

From: EvilChicken!
Looking like nice work!

How well have this been tested?


A couple of times in Karamja. ~20

EvilChicken!

2009-10-04 13:52:44

Overwrote the old FindFishSpotsTPA with your function.

Thank you!