SRL Archive - Research & Development Lounge

Fishing


hackncrack1

2010-05-17 10:54:52

I'm Working on an auto fisher, this function clicks the fishing spot, I'd Appreciate it if you guys gave me your feedback and if mission succecful or not :D (in EdgeVille)
Program FishingProcedureTest;
{.Include SRL/SRL.Scar}

Procedure MouseFishingSpot;
Var
Time, x, y, H, I, CTS, L : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;

Begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.12, 0.27);
MarkTime(Time);
Repeat
FindColorstolerance(TPA, 11117214, MSX1, MSY1, MSX2, MSY2, 10);
L := GetArrayLength(TPA);
Until Inrange(L, 5, 70) Or (TimeFromMark(Time) > 5000);

If GetArrayLength(TPA) < 1 Then
Begin
WriteLn('Mission : Clicking Fish Spot Failure!.');
Exit;
End;

ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);

ATPA := SplitTPAEx(TPA, 21, 21);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
H := High(ATPA)
For I := 0 To H Do
Begin
MiddleTPAEx(ATPA[I], x, y);
MMouse(x, y, 0, 0);
If IsUpText('ishin') Then
Begin
Mouse(x, y, 0, 0, True);
MMouse(x + RandomRange(-50, 0), y + RandomRange(0, 50), 0, 0);
WriteLn('Mission : Clicking Fish Spot Successful!.');
Exit;
End Else
Begin
Mouse(x, y, 0, 0, False);
ChooseOption('cel');
End;
End;
WriteLn('Mission : Clicking Fish Spot Failure!.');
End;

Begin
ClearDebug;
SetupSRL;
ACtivateClient;
MouseFishingSpot;
End.

Gu3st...

2010-05-17 11:24:15

It's looking just fine! :)
one tiny mistake I noticed is these lines:
Repeat
FindColorstolerance(TPA, 11117214, MSX1, MSY1, MSX2, MSY2, 10);
Until TimeFromMark(Time) > RandomRange(500, 800);
The repeat…until is undeeded. Just do the FindColorsTolerance(…); ;)

Naum

2010-05-17 11:28:10

Mission : Clicking Fish Spot Successful!.

Looks good, there's an error though. If it doesn't find the fishing spot it will right click:

    End Else
Begin
Mouse(x, y, 0, 0, False);
ChooseOption('cel');
End;

Once more, you can use the WaitUpText etc. functions within your script. They're found in Timing.scar.
Looks really good, well done!

EDIT: Zy:
The repeat…until is undeeded. Just do the FindColorsTolerance(…); ;)

No, it's needed cause the fishing spot 'flickers' so the white color isn't always showing. Although hackncrack you seem to be using it wrong. I suggest you put an Until (Length(TPA) > FishSpotLength) or likewise.

Gu3st...

2010-05-17 11:41:20

From: Naum
No, it's needed cause the fishing spot 'flickers' so the white color isn't always showing. Although hackncrack you seem to be using it wrong. I suggest you put an Until (Length(TPA) > FishSpotLength) or likewise.
The way he had it was unneeded

hackncrack1

2010-05-17 13:21:35

@naum thx for ur feedback for the rightclick cancel it does it if it goes to a suspected fish spot and it turns out it isnt, itll right click to make it more like humanish mistake :P and not bottish maybe its unnessaccry idk :D

@zyt3x "its unneeded" :O why and how can i make it needed :D?? i want to understand please and thank you :D

to mee it seems u guys just did theoritcal i want some practical testers also plaese.

Gu3st...

2010-05-17 13:25:52

From: hackncrack1
@zyt3x "its unneeded" :O why and how can i make it needed :D?? i want to understand please and thank you :D
It is unneeded because if you call FindColorsTolerance more than one time, only the last one will count.
Do like Naum said :)
No, it's needed cause the fishing spot 'flickers' so the white color isn't always showing. Although hackncrack you seem to be using it wrong. I suggest you put an Until (Length(TPA) > FishSpotLength) or likewise.

hackncrack1

2010-05-17 13:27:52

ahaa ! okay thanks,
EDIT> is it better now ?

Tim0suprem0

2010-05-18 13:40:49

Awesome that you did this yourself :) But isn't this essentially the same thing as the current fishing procedure in SRL?

hackncrack1

2010-05-18 15:23:08

sorta