SRL Archive - Help and Support

FindFishingSpot; Help


Claymore

2008-10-27 23:11:52


function FindSpot(var x, y: Integer): Boolean;
var
ResultTPA, TPA: TPointArray;
ATPA: T2DPointArray;
cts, i, j: Integer;
begin
Result := False;
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(2.11, 0.46);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 10397596, MSX1, MSY1, MSX2, MSY2, 14);
ATPA := TPAToATPA(TPA, 25);
SetLength(TPA, 0);
SetLength(ResultTPA, Length(ATPA));
for i := 0 to High(ATPA) do
begin
if Length(ATPA[i]) < 6 then
Continue;
ResultTPA[i] := MiddleTPA(ATPA[i]);
end;
SetLength(ATPA, 0);
for j := 0 to High(ResultTPA) do
begin
MMouse(ResultTPA[j].x, ResultTPA[j].y, 0, 0);
if TextWait(500, ['Cage', 'Cag', 'age']) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Result := True;
Flag;
Break;
end;
Wait(175 + Random(50));
end;
ColorToleranceSpeed(cts);
SetColorSpeed2Modifiers(0.2, 0.2);
end;

It sometimes won't find the fishing spot, it's annoying! Is there a way i can fix this. Thanks guys, i am making a NON-Reflection Catherby Fisher, I see people begging for this script and not to mention we have no fishing scripts based on Lobsters (Well, non-Reflection ones.)

P1nky

2008-10-27 23:24:41

yeah i never done a fishing script cause i never tried or found out how to do the findfishingspot lol :p

the sparkling thingy lol, would appreciate if someone can help him and this would help me too, maybe will make a powerfisher hmm…

Claymore

2008-10-27 23:34:12

It aint that sparky thjong any more, now its bubbles popping out ;p

Scaper

2008-10-28 01:20:41

in my monker i sent ya :) that works fine for me all i did was picked the color when it bubbled and it has never failed me yet :)

NiCbaZ

2008-10-28 02:21:51

Here use the Fcuntion… It will Debug all the T2DPA's Found on the MS of your color…


{*******************************************************************************
Function DebugATPA(aPoints: T2DPointArray; BmpName: String): Boolean;
By: Wizzup? Modded By Nicbaz
Description: Draws a T2DPointArray on the debug canvas.
*******************************************************************************}
procedure DebugATPA(aPoints: T2DPointArray);
var
ClientBMP, Hi, Hi2, I, Col, I2: Integer;
B: TBox;

Begin
B := GetATPABounds(aPoints);
DisplayDebugImgWindow(B.x2 - B.x1, B.y2 - B.y1);
ClientBMP := BitmapFromString(B.x2 - B.x1, B.y2 - B.y1, '');
CopyClientToBitmap(ClientBMP, B.x1, B.y1, b.x2, b.y2);
Hi := High(aPoints);
for I := 0 to Hi do
begin
Col := Random(839894);
Hi2 := High(aPoints[i]);
for I2 := 0 to Hi2 do
FastSetPixel(ClientBMP, aPoints[i][I2].X - b.x1, aPoints[i][I2].Y - b.y1, Col);
end;
SafeDrawBitmap(ClientBMP, GetDebugCanvas, 0, 0);
FreeBitmap(ClientBMP);
end;
end;


function FindSpot(var x, y: Integer): Boolean;
var
ResultTPA, TPA: TPointArray;
ATPA: T2DPointArray;
cts, i, j: Integer;
begin
Result := False;
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(2.11, 0.46);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 10397596, MSX1, MSY1, MSX2, MSY2, 14);
ATPA := TPAToATPA(TPA, 25);
[B]DebugATPA(ATPA);[/B]
SetLength(TPA, 0);
SetLength(ResultTPA, Length(ATPA));
for i := 0 to High(ATPA) do
begin
if Length(ATPA[i]) < 6 then
Continue;
ResultTPA[i] := MiddleTPA(ATPA[i]);
end;
SetLength(ATPA, 0);
for j := 0 to High(ResultTPA) do
begin
MMouse(ResultTPA[j].x, ResultTPA[j].y, 0, 0);
if TextWait(500, ['Cage', 'Cag', 'age']) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Result := True;
Flag;
Break;
end;
Wait(175 + Random(50));
end;
ColorToleranceSpeed(cts);
SetColorSpeed2Modifiers(0.2, 0.2);
end;

Narcle

2008-10-28 03:24:37

Read the Comments
function FindSpot(var x, y: Integer): Boolean;
var
ResultTPA, TPA: TPointArray;
ATPA: T2DPointArray;
cts, i, j, Len: Integer;
begin
Result := False;
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(2.11, 0.46);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 10397596, MSX1, MSY1, MSX2, MSY2, 14);
ColorToleranceSpeed(cts);// - Moved these here, that way you can exit out of script later
SetColorSpeed2Modifiers(0.2, 0.2);// /
ATPA := TPAToATPA(TPA, 25);
//SetLength(TPA, 0); -Not needed, you don't use it again
//SetLength(ResultTPA, Length(ATPA)); -Right here this is a problem
//You tell it to skip if there is less then 6 tp's,
//but still record for i, so some TPA slots will be blank.
for i := 0 to High(ATPA) do
begin
if Length(ATPA[i]) < 6 then
Continue;
Len := High(ResultTPA);
SetArrayLength(ResultTPA, Len+1);//This way ResultTPA is shorter
ResultTPA[Len] := MiddleTPA(ATPA[i]);
end;
SetLength(ATPA, 0);
for j := 0 to High(ResultTPA) do
begin
MMouse(ResultTPA[j].x, ResultTPA[j].y, 0, 0);
if TextWait(500, ['Cage', 'Cag', 'age']) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Result := True;
Flag;
Exit;//Break changed to Exit;
end;
//Wait(175 + Random(50)); Don't need to wait IMO
end;
end;

Claymore

2008-10-28 18:56:06

Thanks Narcle! Your awesome at TPA's +Rep

~Thanks for the info, i learned a lot ;p

P1nky

2008-10-28 20:27:10

dude Narcle is a beast helped me yesterday on a TPA thing :)

thanks , now i can consider to make a script that fishes.