SRL Archive - OSR Fishing

[AL] F2P PowerFisher


Nixes

2021-05-10 09:05:27

This is my first script here. It's quite simple and doesn't have good antiban features.
I got lvl 75 fishing with it before getting banned.

I welcome any feedback and constructive criticism. Also any suggestions are welcome.
Also feel free to ask for help if can't get the script working for any reason.

Possible future plans:
  • Adding antiban features.
  • Adding drop for fish only so it doesn't drop fishing tool and other items if they are not in first inventory space.
  • Adding break timer.
  • Adding xp and fish counter.
  • Automatic check for:
    • Fishing tool in first inventory space.
  • Automatic check and select for:
    • Enable shift clicking.
    • Have brightness set to max.


Requirements:

How to use:
Run the script near fishing spot with fishing tool in your first slot.


program new;
{$define SMART} //If not using SMART, then comment this line out
{$i AeroLib/AeroLib.Simba}

const //Script config.
P_USERNAME = '';
P_PASSWORD = '';
Fish_Tool_To_Fish_With := 'Net'; // Net, Bait, Lure, BaitRod, Harpoon, Cage

PersonalRandomModifier := random(1,1000);
dropRandom := random(50,350);
var
AFKCounter : Integer;
playerIsFishing : Boolean;
fishingSpotIsTop : Boolean;
fishingSpotIsRight : Boolean;
fishingSpotIsBottom : Boolean;
fishingSpotIsLeft : Boolean;

splitNumbers : TIntegerArray;
dropAmount : TIntegerArray;
dropStart : TIntegerArray;
numberOfSplits : Integer;
completedRandomLoop : boolean;

procedure declarePlayer();
begin
Me.Name := P_USERNAME;
Me.Pass := P_PASSWORD;
Me.Active := True;
Me.Member := False;
end;

procedure setupPlayer();
begin
writeln('player setup...');
if (not isLoggedIn()) then
loginPlayer(false);
if (isLoggedIn()) then
begin
clickNorth(True);
setAngle(ANGLE_HIGH);
end;
end;

procedure checkIfIsFishing();
var
netSearchAreaTop : TBox;
netSearchAreaRight : TBox;
netSearchAreaBottom : TBox;
netSearchAreaLeft : TBox;

baitSearchAreaTop : TBox;
baitSearchAreaRight : TBox;
baitSearchAreaBottom : TBox;
baitSearchAreaLeft : TBox;

harpoonSearchAreaTop : TBox;
harpoonSearchAreaRight : TBox;
harpoonSearchAreaBottom : TBox;
harpoonSearchAreaLeft : TBox;

cageSearchAreaTop : TBox;
cageSearchAreaRight : TBox;
cageSearchAreaBottom : TBox;
cageSearchAreaLeft : TBox;

color_Net : TColEx;
color_Bait : TColEx;
color_Cage : TColEx;
color_Harpoon : TColEx;

color_FishingTool : TColEx;
fishingToolSearchAreaTop : TBox;
fishingToolSearchAreaRight : TBox;
fishingToolSearchAreaBottom : TBox;
fishingToolSearchAreaLeft : TBox;
fishingToolSearchArea : TBox;
fishingSpotLocation : Boolean;
i : Integer;

T : Timer;
begin
netSearchAreaTop := [254,144,274,157];
netSearchAreaRight := [273,169,298,191];
netSearchAreaBottom := [256,178,273,216];
netSearchAreaLeft := [214,171,237,191];

baitSearchAreaTop := [262,101,273,149];
baitSearchAreaRight := [273,165,331,183];
baitSearchAreaBottom := [248,186,256,237];
baitSearchAreaLeft := [184,157,238,178];

harpoonSearchAreaTop := [258,139,268,166];
harpoonSearchAreaRight := [253,158,294,187];
harpoonSearchAreaBottom := [253,156,264,215];
harpoonSearchAreaLeft := [227,140,268,167];

cageSearchAreaTop := [247,142,262,152];
cageSearchAreaRight := [282,166,295,182];
cageSearchAreaBottom := [257,229,272,246];
cageSearchAreaLeft := [219,168,234,182];

color_Net.create(2765113, 15, 0.34, 0.50);
color_Bait.create(6694, 15, 0.34, 0.50);
color_Harpoon.create(1140619, 15, 0.34, 0.50);
color_Cage.create(872564, 15, 0.34, 0.50);

Case Fish_Tool_To_Fish_With of
'Net': begin
color_FishingTool := color_Net;
fishingToolSearchAreaTop := netSearchAreaTop;
fishingToolSearchAreaRight := netSearchAreaRight;
fishingToolSearchAreaBottom := netSearchAreaBottom;
fishingToolSearchAreaLeft := netSearchAreaLeft;
end;
'Bait', 'Lure', 'BaitRod': begin
color_FishingTool := color_Bait;
fishingToolSearchAreaTop := baitSearchAreaTop;
fishingToolSearchAreaRight := baitSearchAreaRight;
fishingToolSearchAreaBottom := baitSearchAreaBottom;
fishingToolSearchAreaLeft := baitSearchAreaLeft;
end;
'Cage': begin
color_FishingTool := color_Cage;
fishingToolSearchAreaTop := cageSearchAreaTop;
fishingToolSearchAreaRight := cageSearchAreaRight;
fishingToolSearchAreaBottom := cageSearchAreaBottom;
fishingToolSearchAreaLeft := cageSearchAreaLeft;
end;
'Harpoon': begin
color_FishingTool := color_Harpoon;
fishingToolSearchAreaTop := harpoonSearchAreaTop;
fishingToolSearchAreaRight := harpoonSearchAreaRight;
fishingToolSearchAreaBottom := harpoonSearchAreaBottom;
fishingToolSearchAreaLeft := harpoonSearchAreaLeft;
end;
end;

playerIsFishing := False;
fishingSpotLocation := False;
T.start();

while ((playerIsFishing = True) OR (T.timeElapsed() <= 5000)) do
begin

for i := 1 to 4 do
begin
if (playerIsFishing = True) then
begin
break;
end;

Case i of
1 : begin
fishingSpotLocation := fishingSpotIsTop;
fishingToolSearchArea := fishingToolSearchAreaTop;
end;
2 : begin
fishingSpotLocation := fishingSpotIsRight;
fishingToolSearchArea := fishingToolSearchAreaRight;
end;
3 : begin
fishingSpotLocation := fishingSpotIsBottom;
fishingToolSearchArea := fishingToolSearchAreaBottom;
end;
4 : begin
fishingSpotLocation := fishingSpotIsLeft;
fishingToolSearchArea := fishingToolSearchAreaLeft;
end;
end;

if (fishingSpotLocation = True) then
begin
if color_FishingTool.findIn(fishingToolSearchArea) then
begin
playerIsFishing := TRUE;
writeln('playerIsFishing = ' + toStr(playerIsFishing));
exit;
end;
end;

end;

end else
begin
playerIsFishing := FALSE;
end;

writeln('playerIsFishing = ' + toStr(playerIsFishing));
end;

procedure fish();
var
Pnt : TPoint;
Pnts : TPointArray;
TestPnts : TPointArray;

fishingSpotSearchAreaTop : TBox;
fishingSpotSearchAreaRight : TBox;
fishingSpotSearchAreaBottom : TBox;
fishingSpotSearchAreaLeft : TBox;

obj_FishingSpot : TMSObject;
color_FishingSpot : TColEx;

textToCheckFor : String;
textToCheckForTwo : String;
mouseRightNeeded : Boolean;
clickedOnFishingSpot : Boolean;
i : Integer;
T : Timer;

begin

obj_FishingSpot.create('Fishing Spot', [''], [createCol(14336937, 13, 0.27, 2.10)], [createCol(14996397, 20, 0.23, 1.15)], 10, 25, 25, 15);


Case Fish_Tool_To_Fish_With of
'Net': begin
textToCheckFor := 'Net Fishing spot';
mouseRightNeeded := False;
end;
'Bait': begin
textToCheckFor := 'Net Fishing spot';
mouseRightNeeded := True;
textToCheckForTwo := 'Bait Fishing spot';
end;
'Lure': begin
textToCheckFor := 'Lure Rod Fishing spot';
mouseRightNeeded := False;
end;
'BaitRod': begin
textToCheckFor := 'Lure Rod Fishing spot';
mouseRightNeeded := True;
textToCheckForTwo := 'Bait Rod Fishing spot';
end;
'Cage': begin
textToCheckFor := 'Cage Fishing spot';
mouseRightNeeded := False;
end;
'Harpoon': begin
textToCheckFor := 'Cage Fishing spot';
mouseRightNeeded := True;
textToCheckForTwo := 'Harpoon Fishing spot';
end;
end;

//Finding fishing spot
while (NOT clickedOnFishingSpot = True) do
begin
if obj_FishingSpot.findall(10, MSCP, Pnts) then
begin
for i := low(Pnts) to high(Pnts) do
begin
if (NOT clickedOnFishingSpot = True) then
begin
HumanMMouse(Pnts[i], 5, 5);
if IsUpTextMulti([textToCheckFor]) then
begin
if (mouseRightNeeded = False) then
begin
fastClick(MOUSE_LEFT);
clickedOnFishingSpot := True;
end;
if (mouseRightNeeded = True) then
begin
fastClick(MOUSE_RIGHT);
if WaitOption(textToCheckForTwo, 1000) then
begin
ChooseOption(textToCheckForTwo);
clickedOnFishingSpot := True;
end;
end;
end;
end;
end;
end;
end;

AFKCounter := 0;

wait(random(1000,2000));
While isPlayerWalking() do
begin
wait(random(500,1200));
end;


// Check fishing spots locations.
color_FishingSpot.create(14336937,13,0.27,2.10);

fishingSpotSearchAreaTop := [253,139,278,157];
fishingSpotSearchAreaRight := [286,169,307,189];
fishingSpotSearchAreaBottom := [247,203,273,227];
fishingSpotSearchAreaLeft := [208,171,233,195];

fishingSpotIsTop := False;
fishingSpotIsRight := False;
fishingSpotIsBottom := False;
fishingSpotIsLeft := False;

T.start();
while (T.timeElapsed() <= 5000) do
begin
//Top
if ((fishingSpotIsTop = False) AND color_FishingSpot.findIn(fishingSpotSearchAreaTop)) then
begin
writeln('Found fishing spot in area: Top.');
fishingSpotIsTop := True;
end;

//Right
if ((fishingSpotIsRight = False) AND color_FishingSpot.findIn(fishingSpotSearchAreaRight)) then
begin
writeln('Found fishing spot in area: Right.');
fishingSpotIsRight := True;
end;

//Bottom
if ((fishingSpotIsBottom = False) AND color_FishingSpot.findIn(fishingSpotSearchAreaBottom)) then
begin
writeln('Found fishing spot in area: Bottom.');
fishingSpotIsBottom := True;
end;

//Left
if ((fishingSpotIsLeft = False) AND color_FishingSpot.findIn(fishingSpotSearchAreaLeft)) then
begin
writeln('Found fishing spot in area: Left.');
fishingSpotIsLeft := True;
end;
end;

end;

procedure drop();
var
j : Integer;
i : Integer;
randomNumber : Integer;
dontDropSpaces : Integer;
chosenOption : Integer;
temporaryInteger : Integer;

sortReady : boolean;
randomNumberWasUnique : boolean;

begin
writeLn('completedRandomLoop: ' + ToStr(completedRandomLoop));
if completedRandomLoop = False then
begin

numberOfSplits := random(1,10);
randomNumberWasUnique := True;
SetLength(splitNumbers,numberOfSplits);

for i := 0 to (numberOfSplits-1) do
begin

// Set randomNumberWasUnique to False to enter loop.
randomNumberWasUnique := False;

while randomNumberWasUnique = False do
begin

// Set randomNumberWasUnique to True to enter loop.
randomNumberWasUnique := True;

// Generate new random number.
splitNumbers[i] := random(1,100);

// See if that random number is already in array.
for j := 0 to (i-1) do
if randomNumberWasUnique = True then
begin
begin
if splitNumbers[i] <> splitNumbers[j] then
begin
randomNumberWasUnique := True;
end;
if splitNumbers[i] = splitNumbers[j] then
begin
randomNumberWasUnique := False;
end;
end;
end;

end;

end;

// Sort the array.
sortReady := False;
while sortReady = False do
begin
sortReady := true;
for i := 0 to (numberOfSplits-2) do
begin
if splitNumbers[i] > splitNumbers[i+1] then
begin
// Put first number in temporary array.
temporaryInteger := splitNumbers[i];
// Move second number to where first number was.
splitNumbers[i] := splitNumbers[(i+1)];
// Move first number to second number spot.
splitNumbers[(i+1)] := temporaryInteger;
sortReady := False;
end;
end;
end;
writeLn('numberOfSplits: ' + ToStr(numberOfSplits));
writeLn('splitNumbers: ' + ToStr(splitNumbers));

if((Fish_Tool_To_Fish_With = 'Net') OR (Fish_Tool_To_Fish_With = 'Cage') OR (Fish_Tool_To_Fish_With = 'Harpoon')) then
dontDropSpaces := 1;
if((Fish_Tool_To_Fish_With = 'Bait') OR (Fish_Tool_To_Fish_With = 'BaitRod') OR (Fish_Tool_To_Fish_With = 'Lure')) then
dontDropSpaces := 2;

// Generate drop amount for each split + 1.
SetLength(dropAmount,(numberOfSplits+1));
for i := 0 to (numberOfSplits) do
begin
dropAmount[i] := random(1,(28-dontDropSpaces));
end;
Writeln('dropAmount: ' + ToStr(dropAmount));

// Generate where drop starts for each split + 1.
SetLength(dropStart,(numberOfSplits+1));
for i := 0 to (numberOfSplits) do
begin
dropStart[i] := random((dontDropSpaces+1),(29-dropAmount[i]));
end;
Writeln('dropStart: ' + ToStr(dropStart));

completedRandomLoop := True;
end;

randomNumber := random(1,100);
Writeln('randomNumber: ' + ToStr(randomNumber));

//chosenOption;
for i := 0 to (numberOfSplits) do
begin
if i = 0 then
begin
case randomNumber of
1..splitNumbers[i] : chosenOption := i;
end;
end;
if NOT(i = 0) AND NOT(i = (numberOfSplits)) then
begin
begin
case randomNumber of
splitNumbers[(i-1)]..splitNumbers[i] : begin
Writeln('i: ' + ToStr(i));
chosenOption := i;
end;
end;
end;
end;
if i = (numberOfSplits) then
begin
begin
case randomNumber of
splitNumbers[i-1]..100 : chosenOption := i;
end;
end;
end;
end;
Writeln('chosenOption: ' + ToStr(chosenOption));


Writeln('dropStart[chosenOption]: ' + ToStr(dropStart[chosenOption]));
Writeln('dropStart[chosenOption] + dropAmount[chosenOption]: ' + ToStr(dropStart[chosenOption] + dropAmount[chosenOption]));
for i := dropStart[chosenOption] to (dropStart[chosenOption] + dropAmount[chosenOption]) do
begin
fastDropSlots([i]);
wait(gaussRandom(dropRandom));
end;

wait(random(1500,2600));

if anySlotActivated() = True then
begin
fastDropSlots([dropStart[chosenOption] + dropAmount[chosenOption]]);
end;

wait(random(100,1500));

AFKCounter := 0;

end;


begin
clearDebug();
initAL();
declarePlayer();
setupPlayer();

writeln('PersonalRandomModifier = ' + toStr(PersonalRandomModifier));
writeln('dropRandom = ' + toStr(dropRandom));

Repeat
checkIfIsFishing();


if((Fish_Tool_To_Fish_With = 'Bait') OR (Fish_Tool_To_Fish_With = 'BaitRod') OR (Fish_Tool_To_Fish_With = 'Lure')) then
begin
if (itemInSlot(2) = False) then
begin
exit;
end;
end;

if isInvFull() then
begin
drop();
end;

if (playerIsFishing = FALSE) then
begin
fish();
wait(random(150,3500));
end;

if (AFKCounter >= 25) then
begin
fastClick(MOUSE_RIGHT);
HumanMMouse([400, 400], 100, 100);
wait(random(100,2500));
AFKCounter := 0;
end;

wait(5000);
AFKCounter := AFKCounter + 1;
Until(false);
end.

footballjds

2021-05-19 17:13:13

Hey Nixes, originally stopped here to test your script and provide feedback. However, i see it is using Aero Lib and I'm familiar with the SRL include…

That being said, I can make a few suggestions.
- Randomize! To avoid bans you want to avoid patterns. Take a look at your script and see where you can adjust wait times or mix up the order you do certain things.
- Add pointless tasks for antiban. Mouse off client, check quest points, look at music, scroll through recent game chat, etc.

Nixes

2021-05-19 17:34:34

Thank you for the feedback. I will certainly try to add them.

Flight

2021-05-23 16:21:44

Looking good mate. It's clearly been a while since anyone has been putting out new work, I'm pleased to see this. Keep it up my friend.

Nixes

2021-05-23 19:29:54

Thanks. It means a lot to me. Always liked your scripts, tutorials and your work on Aerolib.

footballjds

2021-05-23 19:31:26

From: Nixes
Thank you for the feedback. I will certainly try to add them.


Feel free to ask for anything!

You have a lot of repeated code, which makes it tedious to critique… You'll improve on that over time.

Here's a specific suggestion, everywhere that you have a "wait(###)" in your script you could consider adding randomness by doing something like the following:

Old - Your current code:

while (NOT obj_FishingSpotCage.find(Pnt)) do
begin
wait(1000);
writeln('Searching for fishing spot: Cage. ' + toStr(Pnt));
end else
begin
writeln('Found fishing spot: Cage. ' + toStr(Pnt));
wait(gaussRandom(2000));
fastClick(MOUSE_LEFT);
AFKCounter := 0;
end;

New - An example of adding in some randomness:

while (NOT obj_FishingSpotCage.find(Pnt)) do
begin
wait(750, 1250);
if random(50) = 0 then wait(0, 500);
if random(100) = 0 then wait(1000, 3000);
writeln('Searching for fishing spot: Cage. ' + toStr(Pnt));
end else
begin
writeln('Found fishing spot: Cage. ' + toStr(Pnt));
wait(1800, 3000);
if random(50) = 0 then wait(0, 2000);
if random(100) = 0 then wait(1000, 5000);
fastClick(MOUSE_LEFT);
AFKCounter := 0;
end;

Explanation:\
You said you got banned at lvl 75 fishing. Imagine the pattern you were following. You kept an identical routine and waited an EXACT amount of milliseconds(in most cases). Obviously this "behavior" isn't very human. A lot of times i find the best way to make my script more human is to do the action myself in-game and then attempt to emulate my own behavior. Once you have wait times that are more-human, consider jumbling up the order that you do tasks.

Cheers

Nixes

2021-05-23 20:15:46

Thank you for the helpful feedback. I will certainly keep it in mind when I get to adding antiban.