SRL Archive - SRL Archives

Fishing.Scar


JuKKa

2008-03-11 14:52:23

procedure HandleWhirlPool;
var
x, y: Integer;
begin
if (FindDTM(WhirlPoolDTM, x, y, MSX1, MSY1, MSX2, MSY2)) then
begin
Status('Whirlpool found!');
Inc(WhirlPools);
Mouse(647, 82, 2, 2, True);
FTWait(50 + Random(15));
repeat
HoverSkill('fishing', False);
if (not (LoggedIn)) then Exit;
FTWait(2 + Random(2));
until (not (FindDTM(WhirlPoolDTM, x, y, MSX1, MSY1, MSX2, MSY2)));
end;
end;

This procedure has a missing DTM, it never loads a whirlpooldtm.. AND this wouldnt work most likely..

If i remember correctly nesses has a good one. Using TPA's i'd suggest using his..

OR.. i could make one ;)

Wizzup?

2008-03-11 15:00:42

I got this one from my edgeville fisher:

Function FindWhirlPool(x, y: integer): Boolean;

Var
FishPoints: TPointArray;
cts: Integer;

Begin
If Not LoggedIn Then Exit;
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(FishPoints, 13947343, x - 20, y - 20, x + 20, y + 20, 40)
If Length(FishPoints) > Round(230 * WhirlPoolAcc) Then
Begin
WhirlPools := Whirlpools + 1;
WriteLn(FloatToStr(Length(FishPoints) / 1600.0)+ '% FishColors');
Result := True;
End;
ColorToleranceSpeed(cts);
End;

This one only works for a certain coordinate. A small tweak should make it work on the mainscreen though.

N3ss3s and JuKKa, could you post your functions?

EDIT: This should work on the MS, untested.

Function FindWhirlPoolMS: Boolean;

Var
FishPoints: TPointArray;
FishPointsArray: T2DPointArray;
cts, I: Integer;

Begin
Result := False;
If Not LoggedIn Then Exit;
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(FishPoints, 13947343,MSX1, MSY1, MSX2, MSY2, 40)
FishPointsArray := TPAToATPAEx(FishPoints, 40, 40);
For I := 0 To High(FishPointsArray) Do
If Length(FishPointsArray[I]) > Round(230 * WhirlPoolAcc) Then
Begin
WhirlPools := Whirlpools + 1;
WriteLn(FloatToStr(Length(FishPoints) / 1600.0)+ '% Change');
Result := True;
ColorToleranceSpeed(cts);
Exit;
End;
ColorToleranceSpeed(cts);
End;

JuKKa

2008-03-11 15:05:09

this is what i cooked up few seconds ago also few things from my edge fisher and a few parts from the entfinder

Function FindWhirlPool(Var FishX, FishY: Integer; AvoidWhenFound: Boolean): Boolean;
Var
PoolTime, CTS: Integer;
TPA: TPointArray;
Begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(TPA, 13947086, FishX - 25, FishY - 25, FishX + 25, FishY + 25, 20);
Result := (High(TPA) > 30);
If(Result)Then
Begin
Inc(WhirlPools);
Writeln('Whirlpool found!');
If(AvoidWhenFound)Then
Begin
MFNF(MMCX, MMCY, -1, 1);
MarkTime(PoolTime);
Repeat
if(Random(20) > 15)then
IdleTime(500, 500, 0.4)
else
FTWait(2);
If(TimeFromMark(PoolTime) > 35000)Then
Break;
FindColorsTolerance(TPA, 13947086, FishX - 25, FishY - 25, FishX + 25, FishY + 25, 20);
Until( High(TPA) < 30 ) Or (Not LoggedIn);
End;
End;
ColorToleranceSpeed(CTS);
End;

n3ss3s

2008-03-11 15:46:50

KO -


Function FindWhirlPool(x1, y1, x2, y2: Integer): Boolean;
Var
CTS, X, Y, L, C, I, WM: Integer;
wPools: Array of TPointArray;
wPts: TPointArray;
TB: TBox;
Begin
If Not LoggedIn Then Exit;
CTS := GetColorToleranceSpeed;
If Not CTS = 2 Then ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, wPts, 14935266, x1, y1, x2, y2, 15);
wPools := SplitTPA(wPts, 1);
L := High(wPools);
SetArrayLength(wPts, 0);
For I := 0 To L Do
If GetArrayLength(wPools[i]) >= 20 Then
Begin
SetArrayLength(wPts, GetArrayLength(wPools[i]));
wPts := wPools[i];
Result := True;
Break;
End;
If Result Then
Begin
MouseFindFlag(MMCX, MMCY, 1, 1);
Writeln('*** FOUND WHIRLPOOL ***');
FFlag(0);
TB := GetTPABounds(wPts);
MiddleTPAEx(wPts, X, Y);
C := GetColor(X, Y);
WM := GetSystemTime;
While FindColorTolerance(X, Y, C, TB.x1, TB.y1, TB.x2, TB.y2, 5) Do
If GetSystemTime - WM > 12000 + Random(1000) Then
Break;
End;
ColorToleranceSpeed(CTS);
End;


Note:

a) Is outdated, I mean doesn't use T2DPointArray
b) The whirlpool color, I picked some random one in photoshop.
c) I whipped it quickly for someone in Scripting Help, I haven't looked so "deep" to it, but in theory it propably works…
d) It's old, the code (cts declaration part atleast) might look a bit.. weird.

Wizzy, your looks good.


e) @JuKKa: Oh noes! A FindColors in a loop! TAKE COVER!

MylesMadness

2008-03-11 21:27:55

From: n3ss3s
e) @JuKKa: Oh noes! A FindColors in a loop! TAKE COVER!
Can you tell me why this is so bad. I mean the points change…

n3ss3s

2008-03-12 06:28:41

The only thing you need to know to detect something, is that is it there, not where is it ;)

Oh, that's in the avoider, anyways, don't use FindColors in loops unless doing something like WaitWhile…

JuKKa

2008-03-12 11:28:05

now to get on topic


Wizzup… so are u going to make a new one for rev 15? If not im highly dissapointed ;)!

Wizzup?

2008-04-03 08:04:17

From: JuKKa
now to get on topic


Wizzup… so are u going to make a new one for rev 15? If not im highly dissapointed ;)!


Added FindWhirlpoolMS:
{*******************************************************************************
Function FindWhirlPoolMS: Boolean;
By: Wizzup
Description: Finds Whirlpools
*******************************************************************************}

Function FindWhirlPoolMS: Boolean;

Var
FishPoints: TPointArray;
FishPointsArray: T2DPointArray;
cts, I: Integer;

Begin
Result := False;
If Not LoggedIn Then Exit;
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(FishPoints, 13947343,MSX1, MSY1, MSX2, MSY2, 40)
FishPointsArray := TPAToATPAEx(FishPoints, 40, 40);
For I := 0 To High(FishPointsArray) Do
If Length(FishPointsArray[i]) > Round(230 * WhirlPoolAcc) Then
Begin
WhirlPools := Whirlpools + 1;
WriteLn(FloatToStr(Length(FishPoints) / 1600.0)+ '% Change');
Result := True;
ColorToleranceSpeed(cts);
Exit;
End;
ColorToleranceSpeed(cts);
End;

{*******************************************************************************
procedure HandleWhirlPool;
By: Wizzup and Dankness
Description: Finds and Handles Whirlpools by Standing still and waiting
*******************************************************************************}

procedure HandleWhirlPool;
begin
if FindWhirlPoolMS then
begin
Status('Whirlpool found!');
Inc(WhirlPools);
Mouse(647, 82, 2, 2, True);
FTWait(50 + Random(15));
repeat
HoverSkill('fishing', False);
if (not (LoggedIn)) then Exit;
FTWait(2 + Random(2));
until not FindWhirlPoolMS;
end;
end;

JuKKa

2008-04-03 09:04:45

From: Wizzup?
Added FindWhirlpoolMS:
{*******************************************************************************
Function FindWhirlPoolMS: Boolean;
By: Wizzup
Description: Finds Whirlpools
*******************************************************************************}

Function FindWhirlPoolMS: Boolean;

Var
FishPoints: TPointArray;
FishPointsArray: T2DPointArray;
cts, I: Integer;

Begin
Result := False;
If Not LoggedIn Then Exit;
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(FishPoints, 13947343,MSX1, MSY1, MSX2, MSY2, 40)
FishPointsArray := TPAToATPAEx(FishPoints, 40, 40);
For I := 0 To High(FishPointsArray) Do
If Length(FishPointsArray[i]) > Round(230 * WhirlPoolAcc) Then
Begin
WhirlPools := Whirlpools + 1;
WriteLn(FloatToStr(Length(FishPoints) / 1600.0)+ '% Change');
Result := True;
ColorToleranceSpeed(cts);
Exit;
End;
ColorToleranceSpeed(cts);
End;

{*******************************************************************************
procedure HandleWhirlPool;
By: Wizzup and Dankness
Description: Finds and Handles Whirlpools by Standing still and waiting
*******************************************************************************}

procedure HandleWhirlPool;
begin
if FindWhirlPoolMS then
begin
Status('Whirlpool found!');
Inc(WhirlPools);
Mouse(647, 82, 2, 2, True);
FTWait(50 + Random(15));
repeat
HoverSkill('fishing', False);
if (not (LoggedIn)) then Exit;
FTWait(2 + Random(2));
until not FindWhirlPoolMS;
end;
end;


I would recommend using MFNF, Or where on the MM are the co-ordinates?

Wizzup?

2008-04-03 09:21:39

From: JuKKa
I would recommend using MFNF, Or where on the MM are the co-ordinates?


I don't know. The coordinates are from the old HandleWhirlpool;

JuKKa

2008-04-03 09:27:06

well if it clicks exactly on the charr. It will still be fishing (from my experiance). With MFNF it will make sure that a flag appears and it will stop fish.