PDA

View Full Version : [Fishing] [SRL][OSRS] Slacky's FlyFisher™



slacky
02-16-2018, 11:42 PM
We don't have enough flyfishing bots that work at barbarian village! This release is partially for educational purposes to showcase SRL in action, in a simple bot.

This one does no debugging, and doesn't currently keep track over caught fish etc, it doesn't use SMART either. So in all it's very minimalistic. Feel free to try to expand on it and if you add cool features, you are free to publish your variant of it.
However, it's fairly accurate, somewhat efficient, and features decent antiban as well as breaking.

Features:

The bot has three options: Fish->Drop | Fish->Cook->Drop | Fish->Cook->Bank
You can start the bot just about anywhere "normal" (not a dungeon), it will find, or try to find it's path to barbarian village.
Can bank, but it may cause limited run-time, since the bank in edgeville is pretty bad.
Antiban, break-handling and fatigue to go with it.


Step by step setup:

Follow SRL setup procedures if you haven't yet. (https://villavu.com/forum/showthread.php?t=118211)
Requires SRL from Github (https://github.com/SRL/SRL/) version 1.0 or later compatible version.
Requires RSWalker from Github (https://github.com/slackydev/RSWalker/releases), version 1.1 or later compatible version.

Extract the last two in the correct folders: That is inside Simba/Include/ folder.

The script:

program BarbFlyFisher_V004;
{$I SRL/OSR.simba}
{$I RSWalker/Walker.simba}
{.$I SRL/utils/rsclient.simba}
{.$I SRL/utils/rsclient_overrides.simba}
{.$I WindowOverlay/WindowOverlay.simba}
{$H-}
{================================================= =============================]
| Barbarian FlyFisher ™
|
| Steps to use:
| 1. For longer runs you need to declare user details bellow
| 2. Start the script wherever, just have fishing rod and feathers in your inv
|
| Any issues starting it: Re-target RS, and try again, may help if you log
| in manually before doing that.
|
| Banking might not work very well.
[================================================== ============================}
type
TFisherStyle = (FishCookBank, FishCookDrop, FishDrop);

const
LOGIN_NAME = 'yourname';
LOGIN_PASS = 'yourpass';
RS_WORLD = -1; // preferred world, -1 = random world
IS_MEMBER = FALSE; // TRUE or FALSE
STYLE = FishCookBank; // FishCookBank or FishCookDrop, FishDrop

type
TFisher = record
StatsDebugTick: Int64;
Antiban: TAntiban;
end;

var
Bot: TFisher;
RSW: TRSWalker;

{$ifdecl TWindowOverlay}
Overlay: TWindowOverlay;
Debug: TMufasaBitmap;
{$endif}

var
SalmonDTM := DTMFromString('mrAAAAHic42BgYJjKxMDQD8RdQLwQiBcA8S wg7gDi6UD8DKjmAxC/BOLbQPwIiF8A8XsgvgvEp10lgCQjTizHgB/g1gnBMAAAzZcNRg==');
TroutDTM := DTMFromString('mrAAAAHic42BgYJjGxMDQAcQTmCDshUC8BI inA3E/EHMxMjAIAzEHEDMA8R8gxQykBYBYBIibstMgEjiwHAN+gFsnBM MAABHQB5c=');
BurntDTM := DTMFromString('mlwAAAHicY2dgYJjKxMAwDYg7ofRcIF4CxA uBOICRgcEDiGOAOAqIA4HYG4hdgNjSxASomxEHxg1w6UDSBQBl 4wcl');
RawTrout := DTMFromString('mggAAAHicY2NgYJjKxMAwDYgXAvESKLsDiM sZGRhygDgDiPOBuA6I64F457q1QF2MWDB2gE0lQjUAQtcIfQ== ');
RawSalmon := DTMFromString('mlwAAAHicY2dgYJjGBMELgXgJlN0BxL1ArM fIwKACxApArA7EZkBszggRX5efBNTNiAPjBrh0IOkCAEQMBvk= ');
Feathers := DTMFromString('mlwAAAHicY2dgYHBmYmBwAGJvIHYBYlsgtg NiKyB+ApS/B8QPgfgNEH8G4hdA/BGIt69ZAyQZsWI5BtwAuw4IhgIAZtgKcg==');
FishingRod:= DTMFromString('m1gAAAHic42JgYMhiYmCIB+JsIC4E4gogLg PiAiDOAeJ0IE4F4qdAtW+A+A4Q3wDiq0B8H4ifAfE7IP4MxE+A ONqZE0gyEsRyDMQBwiZBMAIAAO7FDhY=');


// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// OVERRIDES AND METHODS FOR FATIGUE

procedure WaitFatigue(t: Double; Exp: Double=0.2);
begin
System.Wait(Trunc(2*t * (1-Power(System.Max(0.0001, Bot.Antiban.EnergyLevel()/100),Exp))));
end;

procedure Wait(min, max:Double; weight:EWaitDir=wdMean); override;
var t: Double;
begin
t := PerformanceTimer();
inherited(min, max, weight);
WaitFatigue(PerformanceTimer()-t);
end;

procedure WaitEx(mean, dev:Double); override;
var t: Double;
begin
t := PerformanceTimer();
inherited(mean, dev);
WaitFatigue(PerformanceTimer()-t);
end;


// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// FISHER

procedure TFisher.DeclarePlayers();
begin
with Players.New()^ do
begin
LoginName := LOGIN_NAME;
Password := LOGIN_PASS;
IsActive := True;
IsMember := IS_MEMBER;
World := RS_WORLD;
end;
Players.SetCurrent(0);
end;

procedure TFisher.DoAntiban();
begin
srl.DismissRandom();
if Self.Antiban.DoAntiban() then
Players.GetCurrent()^.Login(); // if we got logged out, and not logged back in
end;

procedure TFisher.PostAction(AntiBan:Boolean=True);
begin
WaitEx(450,70);
if AntiBan then Self.DoAntiban;
end;


procedure TFisher.ProcessWhileWaiting();
begin
if GetTickCount() - StatsDebugTick > 2000 then
begin
ClearDebug();
ClearDebug();
WriteLn('+---| STATS |----------------------------------------');
WriteLn('|- Script Runtime : ', SRL.MsToTime(GetTimeRunning, Time_Short));
WriteLn('|- Time Since Break : ', SRL.MsToTime(Antiban.TimeSinceBreak(), Time_Short));
//WriteLn('|- Recent Break Len : ', SRL.MsToTime(Antiban.ResidualBreakValue(), Time_Short));
WriteLn('|- Energy Level : ', Round(Antiban.EnergyLevel,2));
WriteLn('+----------------------------------------------------');
Self.StatsDebugTick := GetTickCount();
end;
Self.DoAntiban;
end;


// Find fishingspots by finding the edges of the water, over and over again
// Then do some fancy stuff to remove land->water borders.
// what's left is an accurate TPA of the fishingspot
function TFisher.FindFishingSpot(scanTime: Int32=450): T2DPointArray;
var
i: Int32;
SUM,TPA: TPointArray;
R: TRectangle;
t: TCountDown;
begin
t.Init(scanTime);
while not t.IsFinished do
begin
srl.FindColors(TPA, CTS2(8875103,16,0.2,0.7), Mainscreen.GetBounds);
SUM += TPA.Edges();
end;

SUM.ClearDuplicates();
SUM := ClearTPAFromTPA(Sum, Sum.Edges());
Result := SUM.Cluster(5);
Result.FilterSize(12, __GT__);

{$ifdecl TWindowOverlay}
Debug.Clear();
for i:=0 to High(Result) do
Debug.DrawTPA(Result[i], Random($FFFFFF));
{$endif}
end;

// Basically we find the fishingrod by checking the two tiles infront of
// our character. It can fail if your character covers most of the rod
function TFisher.IsFishing(): Boolean;
var
rect1,rect2: TRectangle;
TPA1,TPA2: TPointArray;
begin
Rect1 := Minimap.StaticToMsRect([646,84],1);
Rect2 := Minimap.StaticToMsRect([649,84],1);
{$ifdecl TWindowOverlay}
Debug.DrawRect(Rect1, $FFFFFF);
Debug.DrawRect(Rect2, $FFFFFF);
{$endif}
if srl.FindColors(TPA1, CTS2(6694,10), Rect1.Bounds) > 12 then
Result := srl.FindColors(TPA2, CTS2(6694,10), Rect2.Bounds) > 5;
end;

// Finds fishing spots, click one, and waits while we are fishing
//
function TFisher.Fish(): Boolean;
var
ATPA: T2DPointArray;
TPA: TPointArray;
begin
if (not Inventory.Contains(FishingRod)) or
(not Inventory.Contains(Feathers)) then
TerminateScript('No feathers or fly fishing rod');

ATPA := Self.FindFishingSpot();
ATPA.SortByMiddle(mainscreen.GetMiddle);
for TPA in ATPA do
begin
mouse.Move(TPA.Bounds);
if not MainScreen.IsUpText(['Fishing spot']) then
Continue;

if mouse.Click(ctRed) then
begin
Wait(700,1000);
Minimap.WaitPlayerMoving();
Wait(1400,1700);

Self.FindFishingSpot(); //update drawing.
while Self.IsFishing() do
begin
Self.ProcessWhileWaiting();
Chatbox.HandleLevelUp();
WaitEx(70,10);
end;
Exit(True);
end else
begin
Wait(700,1200);
Minimap.WaitPlayerMoving();
Wait(700,1200);
Exit(False);
end;
end;
end;

// Waits while we are cooking.
// Cooking is determined by checking if the number of raw fish in our inventory
// is reducing. It must reduce by at least 1 within 5.5 seconds.
function TFisher.WaitCooking(): Boolean;
var
c, currCount: Int32;
t: TCountDown;
begin
c := Inventory.Count(RawTrout) + Inventory.Count(RawSalmon);

t.Init(5500);
repeat
if Chatbox.GotLevelUp then
Break;

currCount := Inventory.Count(RawTrout) + Inventory.Count(RawSalmon);
if currCount <> c then
begin
c := currCount;
t.Restart(50);
end;
Self.ProcessWhileWaiting();
Wait(70);
until t.IsFinished() or (c = 0);
Result := True;
end;

// Do the cooking!
// 1. Walks to a point near the eternal fire.
// 2. Searches for the fire and uses a fish on the fire
// If it fails to find the fire it rotates the screen and tries again.
// 3. Cooks it, and waits til we dont cook any more, or till we level up.
// Repeats #2->#3 until there are no more fish in our inventory.
function TFisher.Cook(): Boolean;
var
idx: Int32;
arr: TIntArray;
rect: TRectangle;
Objs: T2DPointArray;
Fire: TPointArray;
FoundFire: Boolean;
begin
Inventory.Open();
if (not Inventory.Contains(RawTrout)) and (not Inventory.Contains(RawSalmon)) then
Exit;

if Distance(Point(4230,2718), RSW.GetMyPos) > 8 then
RSW.WebWalk(Point(4230,2718), 2);

repeat
arr := Inventory.FindItem(RawTrout) + Inventory.FindItem(RawSalmon);
if(arr = []) then Break;

FoundFire := False;

srl.FindColors(Fire, CTS2(12348,15), MainScreen.GetBounds);
Objs := Fire.Cluster(5);
Objs.FilterSize(16, __GT__);
Objs.SortByMiddle(Mainscreen.GetMiddle);

Inventory.Use(arr[0]);
for Fire in Objs do
begin
rect := Fire.MinAreaRect();
mouse.Move(rect);

Wait(60,100); //wait for game to refresh
if MainScreen.IsUpText('Fire') then
mouse.Click(mouse_Left)
else if MainScreen.IsUpText('options') then
begin
if not ChooseOption.Select('Fire') then
begin
Wait(60,200);
Continue;
end
end else
continue;

FoundFire := True;
Chatbox.ClickButtonId('How many', 1, 'Cook', 3000);
if Self.WaitCooking() then
Break;
end;

if(not FoundFire) then
Minimap.SetCompassAngle([0,90,180,270][Random(4)]+Random(-15,15));
until False;
end;


// Clear the inventory by dropping, or banking fish.
//
procedure TFisher.DoInventory();
var
dtms, slots: TIntArray;
dtm: Int32;
t: TCountDown;

// Deposits all the fish in our inventory, cooked, raw and burnt.
procedure Deposit();
begin
RSW.WebWalk(locEdgevilleBank, 3);
for 0 to 2 do
if BankScreen.Open(blEdgeville) then
Break
else
Wait(800,100);

if not BankScreen.IsOpen() then
TerminateScript('No bank');

dtms := [SalmonDTM, TroutDTM, BurntDTM, RawTrout, RawSalmon];
for dtm in dtms do
begin
slots := Inventory.FindItem(dtm);
if Length(slots) > 0 then
begin
BankScreen.DepositItem(slots[0], True);
t.Init(2000);
while (not t.IsFinished) and Inventory.IsSlotUsed(slots[0],False) do
Wait(70,160);
end;
end;
end;

// drop all the fish in our inventory, cooked, raw and burnt.
procedure Drop();
var
Ptrn: TIntArray;
i: Int32;
begin
dtms := [SalmonDTM, TroutDTM, BurntDTM, RawTrout, RawSalmon];
for dtm in dtms do
slots += Inventory.FindItem(dtm);

for i:=0 to 27 do
if slots.Find(i) <> -1 then
Ptrn += i;

// same as Inventory.DropItems(ptrn) except we add some errors to the order
Inventory.DropItems(Inventory.ErrorPattern(ptrn));
end;
begin
if STYLE in [FishCookDrop, FishDrop] then
Drop()
else
Deposit();
end;

// Runs the bot
//
procedure TFisher.Run();
begin
MainScreen.SetAngle(True);

while srl.IsLoggedIn() do
begin
if Inventory.IsFull() then
begin
if STYLE <> FishDrop then
begin
self.Cook();
self.PostAction();
end;
self.DoInventory();
self.PostAction();
end;

if not self.Fish() then
begin
if RSW.GetMyPos.DistanceTo([4245, 2716]) > 20 then
RSW.WebWalk(Point(4245, 2716),3)
else
RSW.WebWalk(Point(4223, 2748),3);
Wait(700,1200);
end;

{$ifdecl TWindowOverlay}
Debug.Clear();
{$endif}
Self.ProcessWhileWaiting();
end;
end;

procedure TFisher.SetupAntiban();
begin
Antiban.Init(SKILL_FISHING, 4);

Antiban.AddTask([@Antiban.LoseFocus, ONE_MINUTE*5]);
Antiban.AddTask([@Antiban.HoverPlayers, ONE_MINUTE*8]);
Antiban.AddTask([@Antiban.CheckSkill, ONE_MINUTE*9]);
Antiban.AddTask([@Antiban.CheckStats, ONE_MINUTE*10]);
Antiban.AddTask([@Antiban.OpenRandomTab, ONE_MINUTE*10]);
Antiban.AddTask([@Antiban.VeryShortBreak,ONE_MINUTE*25]);
Antiban.AddTask([@Antiban.DoMiscStuff, ONE_MINUTE*25]);
Antiban.AddTask([@Antiban.RandomCompass, ONE_MINUTE*45]);

Antiban.AddBreak([45 * ONE_MINUTE, 05 * ONE_MINUTE, 0.05]);
Antiban.AddBreak([02 * ONE_HOUR, 10 * ONE_MINUTE, 0.15]);
Antiban.AddBreak([04 * ONE_HOUR, 45 * ONE_MINUTE, 0.85]);
Antiban.AddBreak([17 * ONE_HOUR, 07 * ONE_HOUR, 0.99]);
end;

procedure TFisher.Init();
begin
RSW.Init('world.png');
{$ifdecl TWindowOverlay}
Overlay := TWindowOverlay.Create();
Overlay.PaintInterval(100);
Debug := Overlay.ToMufasaBitmap();
{$endif}

self.DeclarePlayers();
self.SetupAntiban();

Inventory.ShiftDrop := True;

Players.LoginCurrent();
end;

procedure TFisher.Free();
begin
RSW.Free();
{$ifdecl TWindowOverlay}
Overlay.Free();
Debug.Free();
{$endif}
FreeDTMs([SalmonDTM, TroutDTM, BurntDTM, RawTrout, RawSalmon, Feathers, FishingRod]);
end;


begin
{$ifdecl RSClient}
srl.SetupForClient([soDebugAntiban]);
RSClient.SetFocus();
{$else}
srl.Setup([]);
{$endif}

bot.Init();
AddOnTerminate(@bot.Free);
bot.Run();
end.


Before you ask:

No, it doesn't 3 tick fish or whatever you call it. It's a bot, it's pointless to have the bot be maximum efficient (it's free XP).. And higher XP/H can have side-effects resulting in higher ban-rate, that is since it very easily will be too perfect in comparison to a human that feels fatigue, can be sloppy at times, etc. So it's a lot of extra work, for very little gain.

WARNING: Use at your own risk.

icyxen
02-17-2018, 01:20 AM
Nice thanks for the release

Flight
02-17-2018, 04:22 AM
Really clean, wide display of usage of the include, and simplicity mixed with efficiency; I like it. Again, happy to see more light shed on such a useful tool. Keep up the good work, Slacky!

P1nky
02-19-2018, 02:41 PM
Slacky, awesome release. I'll be taking a look at this in-depth once I am off work :)... Thanks!

Smalfinn
02-23-2018, 03:58 PM
Any plans to make this an AIO fishing script?

slacky
02-24-2018, 03:43 AM
Any plans to make this an AIO fishing script?
nope.

Smalfinn
02-24-2018, 12:25 PM
nope.

Any reason or just dont want to?

slacky
02-24-2018, 12:56 PM
Any reason or just dont want to?
It's not "free" to just expand it, it requires numerous changes, solving numerous new complications, requires a ton of boring work and testing, and increases the complexity and the time it takes to keep it alive by an order of magnitude.

Smalfinn
02-24-2018, 01:58 PM
It's not "free" to just expand it, it requires numerous changes, solving numerous new complications, requires a ton of boring work and testing, and increases the complexity and the time it takes to keep it alive by an order of magnitude.

Ah I see. If you're ever that bored I'd be happy to pay you for your time :-)

Walking W
02-27-2018, 07:33 PM
I'm trying to learn more about this Simba language.

28385

I keep getting this error, after following your instructions. I have the latest SRL (updated on Github 2/24 or 2/23), I have your fixed version of Simba, and I have the latest 1.04 RSWalker version. Any help would really be appreciated.

28384

slacky
02-27-2018, 11:20 PM
I'm trying to learn more about this Simba language.

28385

I keep getting this error, after following your instructions. I have the latest SRL (updated on Github 2/24 or 2/23), I have your fixed version of Simba, and I have the latest 1.04 RSWalker version. Any help would really be appreciated.

28384
If you did follow my instructions, and is still lost:
Some basic knowledge that I would expect people here to have is: Opening the script by double clicking that script-file will not load Simba 1.2 (Simba1200.6-fixes.x86.exe), that will as per usual just open it with the `Simba.exe` that was installed, Simba 1.2 was not installed, was it? It was just an executable that you dropped into the Simba-folder.

If you want scripts to open by double clicking into Simba 1.2, you'd have to rename the executable to Simba.exe, and rename your old Simba.exe to something like Simba1100.exe

Walking W
02-28-2018, 12:08 AM
My guy, I have placed your fixed version onto the Simba folder. I have the script saved onto the scripts folder(if this even matters). I have closed the program completely and before opening the script, I right-click and select the fixed version to open up the script. I have the latest SRL from Github and latest RSWalker. I’m not sure what you mean about the install of the regular simba version.

slacky
02-28-2018, 09:53 AM
My guy, I have placed your fixed version onto the Simba folder. I have the script saved onto the scripts folder(if this even matters). I have closed the program completely and before opening the script, I right-click and select the fixed version to open up the script. I have the latest SRL from Github and latest RSWalker. I’m not sure what you mean about the install of the regular simba version.
You say you did that, but as I made clear, what you have there in those images is Simba 1.1 (the regular Simba version). Start Simba 1.2, and open the script from within it

If you wonder what Simba version you are within: Menu -> Help -> About
https://image.prntscr.com/image/6w-9M49iRIKvpHiA6iWIow.png

Walking W
02-28-2018, 12:38 PM
You say you did that, but as I made clear, what you have there in those images is Simba 1.1 (the regular Simba version). Start Simba 1.2, and open the script from within it

If you wonder what Simba version you are within: Menu -> Help -> About
https://image.prntscr.com/image/6w-9M49iRIKvpHiA6iWIow.png

I've got it working. I decided to uninstall everything and install it again. Followed the instructions once more and followed another pair of instructions (How to use Simba with RuneScape). It seems to be working. I get an error with the pathfinder, which I got yesterday , but decided to look into it more. As you stated, it will try to find its way to the area. So I moved closer to a fishing area in the new continent, and it was randomly clicking on fishing spots without the fly fishing option. Again, as you stated, this is just a rough draft.

slacky
02-28-2018, 03:11 PM
So I moved closer to a fishing area in the new continent, and it was randomly clicking on fishing spots without the fly fishing option. Again, as you stated, this is just a rough draft.
https://image.prntscr.com/image/iJutwH8AQGSUu3V347pjkw.png
I do feel I made it clear that it's a barbarian fly-fisher script.

ineedbot
04-18-2018, 07:15 PM
Great work! The script works really good! I love the style and consistency with SRL/SRL. I've been using it for a long while now with only one hiccup, it couldn't detect the feather DTM one time when the feather count being at a certain amount (I forget, 4xxx i think).

slacky
04-19-2018, 09:35 AM
Great work! The script works really good! I love the style and consistency with SRL/SRL. I've been using it for a long while now with only one hiccup, it couldn't detect the feather DTM one time when the feather count being at a certain amount (I forget, 4xxx i think).
I see, probably a point in the Feathers DTM that got covered. I'll see if I can update it, unless someone else find the time to post one here that doesn't contain feature points that would / could be covered up by text.

Hoodz
04-19-2018, 12:57 PM
I see, probably a point in the Feathers DTM that got covered. I'll see if I can update it, unless someone else find the time to post one here that doesn't contain feature points that would / could be covered up by text.

its better to use points below the middle of the item :)

slacky
04-19-2018, 02:33 PM
its better to use points below the middle of the item :)
And why is that?

ghost619
04-19-2018, 09:08 PM
I'm guessing this works with barbarian fishing too right?

slacky
04-20-2018, 03:12 AM
I'm guessing this works with barbarian fishing too right?
nyet, ney, it does not.

Hoodz
04-23-2018, 02:41 PM
And why is that?

because the number of the (stackable) items are on top and they may cover a dtm point.

slacky
04-23-2018, 03:13 PM
because the number of the (stackable) items are on top and they may cover a dtm point.
Lol, I follow now, what caught me off was "bellow middle" that seems like a strong exaggeration. The text only covers the uppermost portion of the upper half.
But I get it, your message meant to say that points bellow where the text is are smartest to use.

thr0wback
05-01-2018, 04:39 PM
Thanks for the script Slacky.

Very nice work, using this as a refence for the future.

https://thumb.ibb.co/k9df9S/Capture.png (https://ibb.co/k9df9S)

Praizey
05-06-2018, 11:46 AM
[00:00:00]:[FATAL]: Failed to setup RSClient
Successfully executed.
The following DTMs were not freed: [0, 1, 2, 3, 4, 5, 6]

Why is it failing to setup the client?

Olly
05-06-2018, 01:19 PM
[00:00:00]:[FATAL]: Failed to setup RSClient
Successfully executed.
The following DTMs were not freed: [0, 1, 2, 3, 4, 5, 6]

Why is it failing to setup the client?

What client are you using?

Praizey
05-07-2018, 03:39 AM
What client are you using?

Oldschool Runescape Launcher 1.2.7

EDIT: Sorry, I didn't realize you had to open the client and drag the select tool to detect the window while you are logged in. This is my first time back to botting in almost 3 years.

slacky
05-07-2018, 05:54 AM
Oldschool Runescape Launcher 1.2.7

EDIT: Sorry, I didn't realize you had to open the client and drag the select tool to detect the window while you are logged in. This is my first time back to botting in almost 3 years.
It's a good thing there's a note in the top of the script telling you to do just that if you are having issues :frusty:

Praizey
05-07-2018, 08:54 AM
I spoke too soon. Same error, uninstalled and reinstalled a few times. Still no luck.

28447

slacky
05-07-2018, 11:32 AM
I spoke too soon. Same error, uninstalled and reinstalled a few times. Still no luck.

28447

Just fyi, that's not the same error as you posted earlier "[00:00:00]:[FATAL]: Failed to setup RSClient".
For that new issue you are having I have added a quickfix to SRL for the performance timer returning false. So just update SRL to latest.

Praizey
05-08-2018, 01:07 AM
Thanks for that fix, its working perfectly. From 20-50 in no time at all. You are an absolute legend. Sorry for being a noob.

randy marsh
05-13-2018, 12:44 AM
Hi me again for some reason it keeps on clicking every other second or so on fishing spot? i have restarted client etc.

slacky
05-13-2018, 01:53 AM
Hi me again for some reason it keeps on clicking every other second or so on fishing spot? i have restarted client etc.
1) This is for barbarian village fishing, no where else, so I hope you aren't wasting my time now.
2) Make sure to be fully zoomed out and have max brightness.
3) if that still happens, then perhaps see what happens if you rotate your camera. Could be that the angle you are at makes the fishingrod just disappear at times [fixable by searching for a short period instead]

randy marsh
05-14-2018, 02:53 PM
By changing the angle it helped, thanks.

enigma958
05-15-2018, 04:00 AM
Tried this today. Works good!

Praizey
05-29-2018, 06:31 AM
Went from level 20 to level 90 fishing and 92 cooking in 2-3 weeks botting off and on. Awesome script, thanks a lot!

JSmooth
05-31-2018, 03:33 PM
Went from level 20 to level 90 fishing and 92 cooking in 2-3 weeks botting off and on. Awesome script, thanks a lot!

What fishing spot? Cool to hear

Praizey
06-01-2018, 02:18 AM
It only works at barbarian village :)

Pythius
03-06-2019, 08:21 PM
+---| STATS |----------------------------------------
|- Script Runtime : 01h 46m 46s
|- Time Since Break : 10m 10s
|- Dismissed Randoms : 0
|- Loads Done : 19
|- Energy Level : 96.41
+----------------------------------------------------
Successfully executed.



+---| STATS |----------------------------------------
|- Script Runtime : 06h 25m 12s
|- Time Since Break : 12m 21s
|- Dismissed Randoms : 1
|- Loads Done : 56
|- Energy Level : 82.38
+----------------------------------------------------
Successfully executed.

Left it overnight.

Ran the script in increments of 2hrs and half an hour of breaks in the middle and got to 50 Cooking and fishing in no time.

Thanks for the script!

P.S.
Added loads done and dismissing randoms to the script spliced from other scripts

ravensdruid
04-01-2019, 12:36 PM
Hello there, not too sure I'm using the outdated SRL, but I have changed "Inventory.FindItem(dtm)" to "Inventory.FindDTM(dtm)", just so if anyone is having trouble running the codeline. Cheers!

Pntbllfrk
06-28-2019, 01:20 PM
Script works great!



+---| STATS |----------------------------------------
|- Script Runtime : 05h 37m 01s
|- Time Since Break : 22m 25s
|- Energy Level : 61.7
+----------------------------------------------------

Emarian
01-18-2021, 03:05 PM
Script still works wonderfully, even today. @ slacky, your stuff is amazing. I don't know much, but what I do I learned it from your stuff. You're the best dude

I adjusted this for catching caskets! An easy way to get that cosmic talisman on an ironman. This is an updated version that can be adjusted to anywhere.



program BarbFlyFisher_V004;
{$I SRL/OSR.simba}
{$I RSWalker/Walker.simba}
{.$I SRL/utils/rsclient.simba}
{.$I SRL/utils/rsclient_overrides.simba}
{.$I WindowOverlay/WindowOverlay.simba}
{$H-}

const
LOGIN_NAME = 'yourname';
LOGIN_PASS = 'yourpass';
RS_WORLD = -1; // preferred world, -1 = random world
IS_MEMBER = FALSE; // TRUE or FALSE

type
TFisher = record
StatsDebugTick, failsafe, casketwait, casketcount: Int64;
Antiban: TAntiban;
end;

var
Bot: TFisher;
RSW: TRSWalker;

{$ifdecl TWindowOverlay}
Overlay: TWindowOverlay;
Debug: TMufasaBitmap;
{$endif}
var
CasketDTM := DTMFromString('mlwAAAHicY2dgYChgYmBIA+IqKM4H4iQgjg PiZ0D520D8EIhfA/F7IH4HxE+B+OxTKSDJiBXLMVAEAOyLC04=');
NetDTM := DTMFromString('mggAAAHicY2NgYDjExMBwDoh3AfFOID7GBB F7BJR7DMR3gfglEL8H4ptAHOFrByQZMbAcAzkAAE4fCvc=');
TaliDTM := DTMFromString('mrAAAAHic42BgYJjKxMAwHYjnA/E8IJ4CxD1A3AvlPwaquQXEN4D4ARB/AuJ3QPwQiJ8D8eSODiDJiBPLMVAHAAD6wA2y');
TenKGold := DTMFromString('mggAAAHicY2NgYHBiYmAIAGIfILYGYmMofg qUew7En4D4IwOE/xaIH2yTApKMGFiOgRwAADx1COY=');
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// OVERRIDES AND METHODS FOR FATIGUE

procedure WaitFatigue(t: Double; Exp: Double=0.2);
begin
System.Wait(Trunc(2*t * (1-Power(System.Max(0.0001, Bot.Antiban.EnergyLevel()/100),Exp))));
end;

procedure Wait(min, max:Double; weight:EWaitDir=wdMean); override;
var t: Double;
begin
t := PerformanceTimer();
inherited(min, max, weight);
WaitFatigue(PerformanceTimer()-t);
end;

procedure WaitEx(mean, dev:Double); override;
var t: Double;
begin
t := PerformanceTimer();
inherited(mean, dev);
WaitFatigue(PerformanceTimer()-t);
end;


// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// FISHER

procedure TFisher.DeclarePlayers();
begin
with Players.New()^ do
begin
LoginName := LOGIN_NAME;
Password := LOGIN_PASS;
IsActive := True;
IsMember := IS_MEMBER;
World := RS_WORLD;
end;
Players.SetCurrent(0);
end;

procedure TFisher.DoAntiban();
begin
srl.DismissRandom();
if Self.Antiban.DoAntiban() then
Players.GetCurrent()^.Login(); // if we got logged out, and not logged back in
end;

procedure TFisher.PostAction(AntiBan:Boolean=True);
begin
WaitEx(450,70);
if AntiBan then Self.DoAntiban;
end;


procedure TFisher.ProcessWhileWaiting();
begin
if GetTickCount() - StatsDebugTick > 2000 then
begin
ClearDebug();
ClearDebug();
WriteLn('+---| STATS |----------------------------------------');
WriteLn('|- Script Runtime : ', SRL.MsToTime(GetTimeRunning, Time_Short));
WriteLn('|- Time Since Break : ', SRL.MsToTime(Antiban.TimeSinceBreak(), Time_Short));
//WriteLn('|- Recent Break Len : ', SRL.MsToTime(Antiban.ResidualBreakValue(), Time_Short));
WriteLn('|- Energy Level : ', Round(Antiban.EnergyLevel,2));
WriteLn('|- Caskets Opened: : ', IntToStr(casketcount));
WriteLn('|- # Waiting For : ', IntToStr(casketwait + 1));
WriteLn('+----------------------------------------------------');
Self.StatsDebugTick := GetTickCount();
end;
Self.DoAntiban;
end;


// Find fishingspots by finding the edges of the water, over and over again
// Then do some fancy stuff to remove land->water borders.
// what's left is an accurate TPA of the fishingspot
function TFisher.FindFishingSpot(scanTime: Int32=450): T2DPointArray;
var
i: Int32;
SUM,TPA: TPointArray;
R: TRectangle;
t: TCountDown;
begin
t.Init(scanTime);
while not t.IsFinished do
begin
srl.FindColors(TPA, CTS2(8875103,16,0.2,0.7), Mainscreen.GetBounds);
SUM += TPA.Edges();
end;

SUM.ClearDuplicates();
SUM := ClearTPAFromTPA(Sum, Sum.Edges());
Result := SUM.Cluster(5);
Result.FilterSize(12, __GT__);

{$ifdecl TWindowOverlay}
Debug.Clear();
for i:=0 to High(Result) do
Debug.DrawTPA(Result[i], Random($FFFFFF));
{$endif}
end;

// Basically we find the fishingrod by checking the two tiles infront of
// our character. It can fail if your character covers most of the rod
function TFisher.IsFishing(): Boolean;
var
x, y: Integer;
begin
if findColorTolerance(x, y, 65280, 10, 20, 150, 50, 3) then
Result := True;
end;

// Finds fishing spots, click one, and waits while we are fishing
//
function TFisher.Fish(): Boolean;
var
ATPA: T2DPointArray;
TPA: TPointArray;
begin
if (not Inventory.Contains(NetDTM)) or
(not Inventory.Contains(TenKGold)) then
TerminateScript('Need big net and at least 10k gold, terminating..');

ATPA := Self.FindFishingSpot();
ATPA.SortByMiddle(mainscreen.GetMiddle);
for TPA in ATPA do
begin
mouse.Move(TPA.Bounds);
if not MainScreen.IsUpText(['Fishing spot']) then
Continue;

if mouse.Click(ctRed) then
begin
Wait(700,1000);
Minimap.WaitPlayerMoving();
Wait(10000,20000);
failsafe := 0;
Self.FindFishingSpot(); //update drawing.
while Self.IsFishing() do
begin
Self.ProcessWhileWaiting();
Chatbox.HandleLevelUp();
WaitEx(70,10);
end;
Wait(100, 15000, wdLeft);
Exit(True);
end else
begin
Wait(700,1200);
Minimap.WaitPlayerMoving();
Wait(700,1200);
Exit(False);
end;
end;
end;


// Clear the inventory by dropping, or banking fish.
//
procedure TFisher.DoInventory();
var
dtms, slots: TIntArray;
dtm: Int32;
t: TCountDown;
Ptrn, arr: TIntArray;
i: Int32;

begin
if Inventory.Count(CasketDTM) > casketwait then
begin
casketwait := Random(4);
casketcount += Inventory.Count(CasketDTM);
repeat
arr := Inventory.FindDTM(CasketDTM);
if(arr = []) then Break;

Inventory.MouseSlot(arr[0]);
if MainScreen.IsUpText('Casket') then
mouse.Click(mouse_Left);
WaitEx(1500,200);
until False;

if Inventory.Contains(TaliDTM) then
TerminateScript('Job complete, found talisman');

end else
begin
dtms := [CasketDTM, NetDTM, TenKGold];
for dtm in dtms do
slots += Inventory.FindDTM(dtm);

for i:=0 to 27 do
if slots.Find(i) <> -1 then
Ptrn += i;

Inventory.DropItemsExcept(ptrn);
Exit;
end;
end;


// Runs the bot
//
procedure TFisher.Run();
begin
MainScreen.SetAngle(True);
casketwait := Random(4);

while srl.IsLoggedIn() do
begin
if failsafe > 5 then
TerminateScript('Failsafe reached, ending script');

if Inventory.IsFull() then
begin
self.DoInventory();
self.PostAction();
end;

if not self.Fish() then
begin
if RSW.GetMyPos.DistanceTo([2390,1608]) > 30 then
RSW.WebWalk(Point(2390, 1608),10,0.8)
else
inc(failsafe);
WaitEx(1000,200);
end;

{$ifdecl TWindowOverlay}
Debug.Clear();
{$endif}
Self.ProcessWhileWaiting();
end;
end;

procedure TFisher.SetupAntiban();
begin
Antiban.Init(SKILL_FISHING);

Antiban.AddTask([@Antiban.LoseFocus, ONE_MINUTE*6, 0.65]);
Antiban.AddTask([@Antiban.VeryShortBreak, ONE_MINUTE*12, 0.65]);

end;

procedure TFisher.Init();
begin
RSW.Init('world.png');
{$ifdecl TWindowOverlay}
Overlay := TWindowOverlay.Create();
Overlay.PaintInterval(100);
Debug := Overlay.ToMufasaBitmap();
{$endif}

self.DeclarePlayers();
self.SetupAntiban();

Inventory.ShiftDrop := True;

Players.LoginCurrent();
end;

procedure TFisher.Free();
begin
RSW.Free();
{$ifdecl TWindowOverlay}
Overlay.Free();
Debug.Free();
{$endif}
FreeDTMs([CasketDTM, NetDTM, TaliDTM, TenKGold]);
end;


begin
{$ifdecl RSClient}
srl.SetupForClient([soDebugAntiban]);
RSClient.SetFocus();
{$else}
srl.Setup([]);
{$endif}

bot.Init();
AddOnTerminate(@bot.Free);
bot.Run();
end.

saml1991
06-01-2021, 12:29 PM
Hi all,

In my attempts to learn RS Simba code I adapted Slackys script to work with Simba 1400 and SRL-Development. This code got me from 15 cooking and fishing up to 60 about 3 months ago (I haven't used it since but account still going strong! :) )

Adaptations I made in future scripts were to reference the TRSItem ID in const section (such as BRONZE_BAR: TRSITEM = '2349'; https://www.osrsbox.com/tools/item-search/ is a cool tool for this)

The below code uses
https://github.com/ollydev/Simba/releases/tag/autobuild-simba1400
and
https://github.com/ollydev/SRL-Development


program BarbFlyFisher_V003;
{$DEFINE SRL_USE_REMOTEINPUT}
{$I SRL/osr.simba}
{$H-}
{$i diagnostics.simba}

{.$loadlib libwindowoverlay}
{================================================= =============================]
| Barbarian FlyFisher ™ Written by slacky, butchered by Sam to work with SRL-Development
|
| Steps to use:
| 1. For longer runs you need to declare user details bellow
| 2. Start the script wherever, just have fishing rod and feathers in your inv
|
| Any issues starting it: Re-target RS, and try again, may help if you log
| in manually before starting it.
|
| Banking might not work very well.
[================================================== ============================}
type
TFisherStyle = (FishCookBank, FishCookDrop, FishDrop);

const
LOGIN_NAME = '';
LOGIN_PASS = '';
RS_WORLD = - 1;
// preferred world, -1 = random world
IS_MEMBER = FALSE;
// TRUE or FALSE
STYLE = FishCookDrop;
// FishCookBank or FishCookDrop, FishDrop
type
TFisher = record
StatsDebugTick: Int64;
Antiban: TAntiban;
end;

var
Bot: TFisher;
RSW: TRSWalker;
{$ifdecl TWindowOverlay}
Overlay: TWindowOverlay;
// Debug: TMufasaBitmap;
{$endif}

procedure TFisher.DeclarePlayers();
begin
Login.AddPlayer(LOGIN_NAME, LOGIN_PASS, 'pin');
end;

procedure TFisher.DoAntiban();
begin
Antiban.DismissRandom();
if Self.Antiban.DoAntiban() then
login.LoginPlayer;
// if we got logged out, and not logged back in
end;

procedure TFisher.PostAction(AntiBan: Boolean = True);
begin
WaitEx(850, 900);
if AntiBan then
Self.DoAntiban;
end;

procedure TFisher.ProcessWhileWaiting();
begin
if GetTickCount() - StatsDebugTick > 20000 then
begin
// WriteLn('+---| STATS |----------------------------------------');
// WriteLn('|- Script Runtime : ', SRL.MsToTime(GetTimeRunning, Time_Short));
// WriteLn('|- Time Until Break : ', Antiban.TimeUntilBreak - GetTimeRunning());
//WriteLn('|- Recent Break Len : ', SRL.MsToTime(Antiban.ResidualBreakValue(), Time_Short));
//WriteLn('|- Energy Level : ', Round(Antiban.EnergyLevel,2));
// WriteLn('+----------------------------------------------------');
// Self.StatsDebugTick := GetTickCount();
end;
Self.DoAntiban;
end;
// Find fishingspots by finding the edges of the water, over and over again
// Then do some fancy stuff to remove land->water borders.
// what's left is an accurate TPA of the fishingspot
function TFisher.FindFishingSpot(scanTime: Int32 = 450): T2DPointArray;
var
i: Int32;
SUM, TPA: TPointArray;
R: TRectangle;
t: TCountDown;
begin
t.Init(scanTime);
while not t.IsFinished do
begin
srl.FindColors(TPA, CTS2(8875103, 16, 0.2, 0.7), mainscreen.Bounds);
SUM += TPA.Edges();
end;
SUM.ClearDuplicates();
SUM := ClearTPAFromTPA(Sum, Sum.Edges());
SUM += Sum.Edges();
Result := SUM.Cluster(5);
Result.FilterSize(12, __GT__);
{$ifdecl TWindowOverlay}
Debug.Clear();
for i := 0 to High(Result) do
Debug.DrawTPA(Result[i], Random($FFFFFF));
{$endif}
end;
// Basically we find the fishingrod by checking the two tiles infront of
// our character. It can fail if your character covers most of the rod
function TFisher.WaitFishing(): Boolean;
var
c, currCount: Int32;
t: TCountDown;
begin
c := Inventory.CountItem('Raw Trout') + Inventory.CountItem('Raw Salmon') + Inventory.CountItem('Raw Shrimps');
t.Init(35500);
repeat
inventory.Open;
if Chat.leveledup then
Break;
currCount := Inventory.CountItem('Raw Trout') + Inventory.CountItem('Raw Salmon') + Inventory.CountItem('Raw Shrimps');
if currCount <> c then
begin
c := currCount;
t.Restart(50);
end;
Self.ProcessWhileWaiting();
Wait(70);
until t.IsFinished() or (inventory.IsFull);
Result := True;
end;
// Finds fishing spots, click one, and waits while we are fishing
//
function TFisher.Fish(): Boolean;
var
ATPA: T2DPointArray;
TPA: TPointArray;
TMP: TIntegerArray;
begin
if (not Inventory.FindItems(['Fly fishing rod', 'Feather', 'Small fishing net'], tmp)) then
TerminateScript('No feathers or fly fishing rod or net');
ATPA := Self.FindFishingSpot();
ATPA.SortByMiddle(mainscreen.GetPlayerBox.Middle);
for TPA in ATPA do
begin
mouse.Move(TPA.Bounds);
if not MainScreen.IsUpText(['Fishing spot']) then
Continue;
mouse.click(mouse_left);
if mainscreen.DidRedClick then
begin
Wait(700, 1000);
Minimap.WaitPlayerMoving();
Wait(1400, 1700);
self.WaitFishing;
end
else
begin
Wait(700, 1200);
Minimap.WaitPlayerMoving();
Wait(700, 1200);
Exit(False);
end;
end;
end;
// Waits while we are cooking.
// Cooking is determined by checking if the number of raw fish in our inventory
// is reducing. It must reduce by at least 1 within 5.5 seconds.
function TFisher.WaitCooking(): Boolean;
var
c, currCount: Int32;
t: TCountDown;
begin
c := Inventory.CountItem('Raw Trout') + Inventory.CountItem('Raw Salmon') + Inventory.CountItem('Raw Shrimps');
t.Init(5500);
repeat
if Chat.leveledup then
Break;
currCount := Inventory.CountItem('Raw Trout') + Inventory.CountItem('Raw Salmon') + Inventory.CountItem('Raw Shrimps');
if currCount <> c then
begin
c := currCount;
t.Restart(50);
end;
Self.ProcessWhileWaiting();
Wait(70);
until t.IsFinished() or (c = 0);
Result := True;
end;
// Do the cooking!
// 1. Walks to a point near the eternal fire.
// 2. Searches for the fire and uses a fish on the fire
// If it fails to find the fire it rotates the screen and tries again.
// 3. Cooks it, and waits til we dont cook any more, or till we level up.
// Repeats #2->#3 until there are no more fish in our inventory.
function TFisher.Cook(): Boolean;
var
idx: Int32;
arr: TIntegerArray;
rect: TRectangle;
ATPA: T2DPointArray;
TPA: TPointArray;
FoundFire: Boolean;
begin
wait(600, 10000);
Inventory.Open();
if (not Inventory.FindItems(['Raw trout', 'Raw Salmon', 'Raw Shrimps', 'Raw anchovies'], arr)) then
Exit;
while ((Inventory.FindItems(['Raw trout', 'Raw Salmon', 'Raw Shrimps', 'Raw anchovies'], arr))) do
begin
arr := [];
Inventory.FindItems(['Raw Trout', 'Raw Salmon', 'Raw Shrimps', 'Raw anchovies'], arr);
//arr wasn't updating above
FoundFire := False;
srl.FindColors(TPA, CTS2(12348, 15), MainScreen.Bounds);
ATPA := TPA.Cluster(5);
ATPA.FilterSize(16, __GT__);
ATPA.SortByMiddle(mainscreen.GetPlayerBox.Middle);
if length(arr) > 0 then
begin
inventory.Open;
waitex(850, 200);
Inventory.Clickslot(arr[0]);
for TPA in ATPA do
begin
rect := TPA.MinAreaRect();
mouse.Move(rect);
Wait(60, 100);
if MainScreen.IsUpText(['Fire']) then
begin
mouse.Click(mouse_Left);
wait(1000, 40);
minimap.IsPlayerMoving();
waitex(1900, 400);
FoundFire := True;
keyboard.presskey(VK_SPACE);
end
else if MainScreen.IsUpText(['options']) then
begin
if not ChooseOption.Select('Fire') then
begin
Wait(60, 200);
Continue;
end
wait(1000, 40);
minimap.IsPlayerMoving();
waitex(1900, 400);
FoundFire := True;
keyboard.presskey(VK_SPACE);
end
else
continue;
if Self.WaitCooking() then
Break;
end;
if (not FoundFire) then
begin
if Distance(Point(4230, 2718), RSW.GetMyPos) > 8 then
RSW.WebWalk(Point(4230, 2718), 2);
Minimap.SetCompassAngle([0, 90, 180, 270][Random(4)] + Random(- 15, 15));
end;
end;
end;
end;
// Clear the inventory by dropping, or banking fish.
//
procedure TFisher.DoInventory();
var
dtms, slots: TintegerArray;
dtm: Int32;
t: TCountDown;
// drop all the fish in our inventory, cooked, raw and burnt.
procedure Drop();
var
Ptrn, orderedptrn, PATTERN: TintegerArray;
index: integer;
begin
Inventory.FindItems(['Raw Trout', 'Raw Salmon', 'Trout', 'Salmon', 'Raw Shrimps', 'Raw anchovies', 'Shrimps', 'Anchovies', 'Burnt Shrimp', 323, 343, 357, 367, 369, 20854, 23873], Ptrn);
for Index in [DROP_PATTERN_SNAKE, DROP_PATTERN_SNAKE_R, DROP_PATTERN_TOPDOWN, DROP_PATTERN_TOPDOWN_R, DROP_PATTERN_REGULAR, DROP_PATTERN_REGULAR_R, DROP_PATTERN_SPIRAL][Random(0, 6)] do
begin
if ptrn.Find(Index) <> - 1 then
Pattern += Index;
end
Inventory.ShiftDrop(Inventory.ErrorPattern(Pattern ));
end;

begin
if STYLE in [FishCookDrop, FishDrop] then
Drop()
else
TerminateScript('I havent wewritten banking');
//Deposit();
end;
// Runs the bot
//
procedure TFisher.Run();
begin
// MainScreen.SetupAlignment;
while RSClient.IsLoggedIn() do
begin
if Inventory.IsFull() then
begin
if STYLE <> FishDrop then
begin
self.Cook();
self.PostAction();
end;
self.DoInventory();
self.PostAction();
end;
if not self.Fish() and not inventory.IsFull() then
begin
if RSW.GetMyPos.DistanceTo([4245, 2716]) > 20 then
RSW.WebWalk(Point(4245, 2716), 3)
else
RSW.WebWalk(Point(4223, 2748), 3);
Wait(700, 1200);
end;
{$ifdecl TWindowOverlay}
Debug.Clear();
{$endif}
Self.ProcessWhileWaiting();
end;
end;

procedure TFisher.Antiban_Randomness;
begin
case Random(5) of
0: Antiban.RandomRotate();
1: Antiban.RandomTab();
2: Antiban.HoverSkills();
3: Antiban.SmallRandomMouse();
4: Antiban.AdjustZoom();
end;
end;

procedure TFisher.SetupAntiban();
begin
Antiban.Skills := [ERSSKILL.FISHING];
Antiban.MinZoom := 0;
Antiban.MaxZoom := 75;
Antiban.AddSleep('04:00', 6 * ONE_HOUR);
Antiban.AddBreak(30 * ONE_MINUTE, 5 * ONE_MINUTE, 0.30, 0.10);
Antiban.AddBreak(45 * ONE_MINUTE, 1 * ONE_MINUTE, 0.30, 0.10);
Antiban.AddBreak(60 * ONE_MINUTE, 5 * ONE_MINUTE, 0.30, 0.10);
Antiban.AddBreak(120 * ONE_MINUTE, 20 * ONE_MINUTE, 0.30);
Antiban.AddTask(2 * ONE_MINUTE, @ Antiban.LoseFocus);
Antiban.AddTask(20 * ONE_MINUTE, @ Antiban.LoseFocus);
Antiban.AddTask(20 * ONE_MINUTE, @ Self.Antiban_Randomness);
Antiban.AddTask(40 * ONE_MINUTE, @ Self.Antiban_Randomness);
end;

procedure TFisher.Init();
begin
RSW.Setup('world');
{$ifdecl TWindowOverlay}
Overlay := TWindowOverlay.Create();
Overlay.PaintInterval(100);
Debug := Overlay.ToMufasaBitmap();
{$endif}
self.DeclarePlayers();
self.SetupAntiban();
diagnostics.init();
diagnostics.preventOutOfBounds := false;
//using losefocus antiban
// Inventory.ShiftDrop := True;
login.LoginPlayer;
end;

procedure TFisher.Free();
begin
RSW.Free();
{$ifdecl TWindowOverlay}
Overlay.Free();
Debug.Free();
{$endif}
end;

begin
{$ifdecl RSClient}
// srl.SetupForClient([soDebugAntiban]);
// RSClient.SetFocus();
{$else}
srl.Setup([]);
{$endif}
bot.Init();
AddOnTerminate(@ bot.Free);
bot.Run();
end.