PDA

View Full Version : [Fishing] Mark's OSR Fisher



Mark
01-09-2018, 04:12 PM
Marks OSR PowerFisher

https://s13.postimg.org/80f2bdvh3/Untitled.png

About:
Not much to shout about here simple script to help bring me back up2 speed with all what has changed since i took a break.
what this does right now is simply fishes to full inventory drop rinse repeat.
ive not wrote any break handling or anything to stop this script running once started tho if much interest or requests i will continue to work o this and add more ive also removed cooking from this for now as im unsure whether to just post for Jr members

Setup:
First two Inventory slots are reserved for fly fishing rod and feathers
Start anywhere next to a fishing spot either Barb fishing above the waterfall or fly fishing at barbarian village

Requirements---> Sake Of Repetition Read Quote below


As a core developer of the latest SRL for OSRS (https://github.com/SRL/SRL/) it is my duty to recommend it over AeroLib! Flight :p

To get started with SRL for OSRS you need the following:
> Simba 1.2rc with leakfixes (https://github.com/slackydev/Simba/releases/tag/Simba-1.2.0-rc6_fixes) (drop the .exe in Simba folder, and use it instead of Simba.exe)
> SRL for OSRS (https://github.com/SRL/SRL/)
> RSWalker (https://villavu.com/forum/showthread.php?t=111914)
> A hamburger (https://scontent-sea1-1.cdninstagram.com/t51.2885-15/s480x480/e35/14607150_328038767588050_4281905205236203520_n.jpg ?ig_cache_key=MTM1NTA4MTc1NTMyOTk4ODgwMA%3D%3D.2)
> A buckload of Redbull (https://img1.exportersindia.com/product_images/bc-full/dir_108/3220922/red-bull-energy-drinks-250-ml-1334757.jpeg)
> A shovel (https://media.tractorsupply.com/is/image/TractorSupplyCompany/1023426?$300$), a mattock (https://images-na.ssl-images-amazon.com/images/I/710wjI5I6lL._SX355_.jpg) and a lantern (https://images.halloweencostumes.com/products/12276/1-1/light-up-old-lantern.jpg) as well (in case you give up (https://whenthoughtsaredeep.files.wordpress.com/2015/08/grave-digging.jpg)).
> And finally a fair bit of patience


Update:0.2
Updated a couple of suggested things but still reading up..... slacky
Changes:
Left cooking in and is turned on by default you can change this yourself on line 12
DoCooking = True;//can be changed to false
added fire detection
few failsafes
changes to logic see how it goes

All small minor updates will be added to this as a write them so copy paste over any downloaded version you have
Current v0.2b

V0.3
more improvements to the logic improved finding by 4 seconds but we do lose out on accuracy.
The auto color functions where causing big hangs in my code so im trying to work out more solutions tho ive not noticed any problems with the new improvements.


program new;
//{$DEFINE SMART}
{$I SRL/osr.simba}
(*
TODO:
BreakHandler:
--just started
Debug:
Needs Salmon and trout counting fixing.
Make pretty.
ScreenSorting:
Works without fail but can take upto 1.3 second.s

Cooking:
works but ugly as hell
*)



type TCell = Record
Cell : TBox;
Points : TPointArray;
NumP : Integer;
end;

const
UsePixelShift = True;//Used to Increase accuracy at the cost of speed Note you need this at barb village and for cooking
DoCooking = true;//well do you want to Cook

type TFFinder = Record
Grid : Array of Array of Tcell;
SGrid : Array of Tcell;
FishingAt : Tcell;
FireCell : Tcell;
Rows, Cols : Integer;

BestFound : Integer;
RandomsIgnored : Integer;
LevelUpFishing : Integer;
LevelUpCooking : Integer;
SalmonCooked : Integer;
TroutCooked : Integer;

FireLogColor : Integer;
SFireLogCol : TColorSettings;
FireColor : Integer;
SFireCol : TColorSettings;

WaterColor : Integer;
SWaterCol : TColorSettings;
FSpeckle : Integer;
SSpeckleCol : TColorSettings;

DebugImage : TMufasaBitmap;
end;

var
LastAngle : Integer;
FFinder, EFinder : TFFinder;
FishCaught, InvCountTimer, LastInvCount : Integer;
MapAngle : array [0..2] of Integer;

function TFFinder.SettupScreen(W, H : Integer) : Array of Array of Tcell;
var i, j : integer;
begin
Rows := Round(514 / W);
Cols := Round(336 / H);
SetLength(Result , Rows, Cols);
for i := 0 to Rows-1 do
for j := 0 to Cols-1 do
Result[i][j].Cell := pointtobox(Point((W * i), (H * j)), Point((W+W) + (W * i), H + (H * j)));
end;

{removed grabing of speckle colors}
Function TFFinder.SortByColorAndArea(BoxesToSort : Array of array of TCell) : Array of TCell;
var
j, i, X, Y, C, B, Dist, TDist : Integer;
SpeckleTPA, FireTPA : TPointArray;
TempArrayA, TempArrayB : Array of TCell;
begin
for i := 0 to Rows-1 do
begin
for j := 0 to Cols-1 do
if (CountColorTolerance(WaterColor, BoxesToSort[i][j].Cell, 9, SWaterCol) > 4) then
begin
SetLength(TempArrayA, C + 1);
TempArrayA[C].Cell := BoxesToSort[i][j].Cell;
inc(C);
end else
begin
if DoCooking then
begin
if (CountColorTolerance(FireColor, BoxesToSort[i][j].Cell, 14, SFireCol) > 2) and (FindColorsTolerance(FireTPA, FireLogColor, BoxesToSort[i][j].Cell, 15, SFireLogCol))then
begin
if (srl.GetPixelShift(BoxesToSort[i][j].Cell, 75) > 2) then
begin
if FFinder.FireCell.NumP < 1 then
begin
writeln('found fire');
FFinder.FireCell.Points := FireTPA;
FFinder.FireCell.NumP := Length(FFinder.FireCell.Points);
FFinder.FireCell.Cell := IntToBox(BoxesToSort[i][j].Cell.X1, BoxesToSort[i][j].Cell.Y1, BoxesToSort[i][j].Cell.X2 + 8, BoxesToSort[i][j].Cell.Y2 + 8);
end;
end;
end;
end;
end;
end;
for C := 0 to Length(TempArrayA)-1 do
begin
if (FindColorTolerance(x, y, 15123625, TempArrayA[C].Cell, 16{, SSpeckleCol}))then
begin
SetLength(TempArrayB, B + 1);
//TempArrayB[B].Points := SpeckleTPA;
// TempArrayB[B].NumP := Length(TempArrayA[C].Points);
TempArrayB[B].Cell := TempArrayA[C].Cell;
Inc(B);
end;
end;
B := 0;
for C := 0 to Length(TempArrayB)-1 do
begin
if (srl.GetPixelShift(TempArrayB[C].Cell, 75) > 2) then
begin
// if PointInBox(TempArrayB[C].Points[0], IntToBox(TempArrayB[C].Cell.X1, TempArrayB[C].Cell.Y1, TempArrayB[C].Cell.X2 + 10, TempArrayB[C].Cell.Y2 + 10))then
SetLength(Result, B + 1);
// Result[B].Points := TempArrayB[C].Points;
//Result[B].NumP := TempArrayB[C].NumP;
Result[B].Cell := TempArrayB[C].Cell;
inc(B);
end;
end;
TDist := 9999;
for i := 0 to Length(Result)-1 do
begin
Dist := Distance(Result[i].Cell.Middle, MainScreen.GetMiddle);
if Dist < TDist then
begin
TDist := Dist;
FFinder.BestFound := i;
FFinder.FishingAt := Result[i];
FFinder.FishingAt.Cell := IntToBox(Result[i].Cell.X1, Result[i].Cell.Y1, Result[i].Cell.X2 + 10, Result[i].Cell.Y2 + 10);
// FFinder.FishingAt.Cell.Middle
end;
end;
end;
{
//Draws and Offsets the text to be centred at given position

Offset Normal
^ ^
}
procedure TMufasaBitmap.DrawText(Text : String; At : TPoint; Color: TColor; Centred : Boolean); overload;
begin
if Centred then Self.DrawText(Text, Point((At.X - Length(Text) * 3), At.Y), Color)
else Self.DrawText(Text, 'StatChars', At, True, Color);
end;

//drawTextMulti
procedure TMufasaBitmap.drawTextMulti(Text1, Text2 : String; At : TPoint; Color1, Color2: TColor);
begin
Self.DrawText(Text1, At, Color1);
Self.DrawText(Text2, Point((At.X + Length(Text1) * 5), At.Y), Color2);
end;

//spam mouse
procedure TMouse.Click(Middle: TPoint; Radius, Button: Int32; NumClicks : Integer = 1); overload;
var
i : Integer;
begin
for i := 1 to NumClicks do
Self.Click(srl.RandomPoint(Middle, Radius), Button);
end;

procedure PrintDebug;
var
i, j, Debugim : Integer;
begin
FFinder.DebugImage := GetMufasaBitmap(BitmapFromClient(MainScreen.GetBou nds));
FFinder.DebugImage.SetSize(527, 400);
for i := 0 to Length(FFinder.SGrid)-1 do
begin
FFinder.DebugImage.DrawCross(FFinder.SGrid[i].Cell.Middle, 5, clRed);
FFinder.DebugImage.DrawBox(FFinder.SGrid[i].Cell, False, clGreen);
if PointInbox(FFinder.FireCell.Cell.Middle, MainScreen.FBounds)then FFinder.DebugImage.DrawBox(FFinder.FireCell.Cell, False, clRed);
end;
FFinder.DebugImage.DrawBox(FFinder.FishingAt.Cell, False, clBlue);
FFinder.DebugImage.DrawText('Marks OSR PowerFisher', Point(Round(FFinder.DebugImage.GetWidth / 2)-50, 340) , clGreen);
FFinder.DebugImage.DrawText('Time Running = ' + SRL.TimeRunning , Point(Round(FFinder.DebugImage.GetWidth / 2), 20) , clAqua, true);
FFinder.DebugImage.drawTextMulti('Fish Caught = ', IntToStr(FishCaught), Point(385, 350) , clRed, clWhite);
FFinder.DebugImage.drawTextMulti('Fishing Lvls Gained = ', IntToStr(FFinder.LevelUpFishing), Point(385, 362) , clRed, clWhite);
if DoCooking then
begin
FFinder.DebugImage.DrawText('Fish Cooked = ' + 'Salmon : ' + IntToStr(FFinder.SalmonCooked) + ' Trout : ' + IntToStr(FFinder.TroutCooked), Point(0, 350) , clRed);
FFinder.DebugImage.drawTextMulti('Cooking Lvls Gained = ', IntToStr(FFinder.LevelUpCooking), Point(0, 363) , clRed, clWhite);
FFinder.DebugImage.drawTextMulti('Fish Cooked H/R = ', IntToStr(Round((FishCaught * 3600) / (GetTimeRunning / 1000))), Point(0, 375) , clRed, clWhite);
end else FFinder.DebugImage.drawTextMulti('Fish Caught H/R = ', IntToStr(Round((FishCaught * 3600) / (GetTimeRunning / 1000))), Point(385, 375) , clRed, clWhite);
FFinder.DebugImage.drawTextMulti('Randoms Avoided = ', IntToStr(FFinder.RandomsIgnored), Point(0, 385) , clRed, clWhite);
// FFinder.DebugImage.Debug;//this shit flickers????why
Debugim := BitmapFromString(FFinder.DebugImage.GetWidth, FFinder.DebugImage.GetHeight, FFinder.DebugImage.ToString);
DrawBitmapDebugImg(DebugIm);
DisplayDebugImgWindow(FFinder.DebugImage.GetWidth, FFinder.DebugImage.GetHeight);
FreeBitMap(DebugIm);
FFinder.DebugImage.Free;
end;

function IsFishSpotActive(WaitTime : Integer) : Boolean;
var X, Y : Integer;
begin
if (srl.GetPixelShift(FFinder.FishingAt.Cell, WaitTime) > 1) and (FindColorTolerance(X, Y, FFinder.FSpeckle, FFinder.FishingAt.Cell, 16, FFinder.SSpeckleCol)) then
Result := True
else Result := False;
end;

procedure TFFinder.Free;
begin
FFinder.Grid := EFinder.Grid;
FFinder.FishingAt := EFinder.FishingAt;
FFinder.FireCell := EFinder.FireCell;
FFinder.SGrid := EFinder.SGrid;
end;

procedure TFFinder.Find;
var X, Y, SortTimer : Integer;
begin
SortTimer := GetTimeRunning;

if (IsFishSpotActive(Random(75, 150))) and FindColorTolerance(X, Y, FFinder.FireColor, FFinder.FireCell.Cell, 15, FFinder.SFireCol) then exit;
FFinder.Free;
{* Color Setup}
WaterColor := 8153439;
SWaterCol := ColorSetting(2, 0.12, 0.53);
FSpeckle := 14461113;//Fishing Spot Speckle
SSpeckleCol := ColorSetting(2, 0.97, 1.58);

FireColor := 2269658;
SFireCol := ColorSetting(2, 0.16, 1.20);
FireLogColor := 11576;
SFireLogCol := ColorSetting(2, 0.19, 0.00);

{* Grid Setup}
FFinder.Grid := FFinder.SettupScreen(9, 9);

{* Find Spot}
FFinder.SGrid := FFinder.SortByColorAndArea(FFinder.Grid);

WriteLn('Took ' + FloatToStr((GetTimeRunning - SortTimer) / 1000) + ' Seconds to find spot');
PrintDebug;
end;

procedure AntiBan;
var R, Ra, Rb : Integer;
begin
R := Random(100, 200);
if not Inrange(R, 123, 152) then Mouse.Move(Point(Random(0, 600), Random(0, 500)));
case R of
123..152 : Begin
Rb := Random(2);
repeat
inc(Ra);
mouse.Speed := Random(12, 16);
Mouse.Move(Point(Random(0, 600), Random(0, 500)));
//mouse.Click(1);
Until Ra > Rb;
Ra := 0;
end;
173..176 : begin
MiniMap.SetCompassAngle(Random(-360, 360), True);
end;
end;
end;

procedure FlipAngle;
begin
MiniMap.SetCompassAngle(Random(-360, 360), True);
{ case LastAngle of
1 : begin
MiniMap.SetCompassAngle(Random(85, 95), True);
LastAngle := Random(2, 3);
end;
2 : begin
MiniMap.SetCompassAngle(Random(250, 270), True);
repeat
LastAngle := Random(2);
until(LastAngle = 1) or (LastAngle = 3);
end;
3 : begin
MiniMap.SetCompassAngle(Random(-15, 15), True);
LastAngle := Random(1, 2);
end
end;}
end;

function TFFinder.ClickCellUpText(Cell : TCell; UpText : TStringArray; ClickType : Integer): Boolean;
begin
FFinder.Find;
if Assigned(Cell) then
begin
case Random(1,2) of
1 : mouse.Move(Cell.Cell);
2 : Mouse.Miss(Cell.Cell.Middle, True, Random(0, 150));
end;
if MainScreen.IsUpText(UpText)then
begin
Mouse.Click(ClickType);
True;
end else
begin
Mouse.Click(2);
if ChooseOption.Select(UpText, 1, true, true) then True
else False;
end;
end else False;
while MiniMap.isFlagPresent do wait(75);
end;

function TFFinder.Click : Boolean; //
var X, Y : Integer;
begin
mouse.Speed := Random(13, 17);
if (FFinder.FishingAt.Cell.X1 > 0) and (FindColorTolerance(X, Y, FFinder.FSpeckle, FFinder.FishingAt.Cell, 16, FFinder.SSpeckleCol)) then
begin
case Random(1,2) of
1 : mouse.Move(Point(X, Y));
2 : Mouse.Miss(Point(X, Y), True, Random(0, 150));
end;
if MainScreen.IsUpText(['ure', 'od'])then
begin
mouse.Click(1);
MiniMap.WaitPlayerMoving();
Result := True;
AntiBan;
end else
begin
WriteLn('Failed To Find Fishing Spot');
Result := False;
end;
end else Result := False;
PrintDebug;
end;

procedure FindFish;
begin
if Inventory.IsFull then Exit;
if IsFishSpotActive(Random(75, 150)) then Exit;
if not FFinder.Click then FFinder.Find;
end;

//DropItemsExcept not working correctly take a look
procedure DropAll;
var i : integer;
DropOrder : TIntegerArray = [2, 3, 7, 6, 5, 4, 8, 9, 10, 11, 15, 14, 13, 12, 16, 17, 18, 19, 23, 22, 21, 20 ,24, 25, 26, 27];
begin
for i := 0 to 25 do
if inventory.IsSlotUsed(DropOrder[i], False)then
begin
KEYBOARD.KeyDown(VK_SHIFT);
Mouse.Move(Point(Random(inventory.GetSlotBox(DropO rder[i]).Middle.X-5, inventory.GetSlotBox(DropOrder[i]).Middle.X+5) ,Random(inventory.GetSlotBox(DropOrder[i]).Middle.Y-5, inventory.GetSlotBox(DropOrder[i]).Middle.Y+5)));
mouse.Click(1);
wait(Random(77,265));
KEYBOARD.KeyUp(VK_Shift);
end;
//Inventory.DropItemsExcept([1,2], DROP_PATTERN_SNAKE);//does not work correctly
end;

//rewrite this
function TFFinder.Cook(UpText : String;DTM, ChatButtonCol : Integer) : Boolean;
var
TPA : TPointArray;
X, Y, TimeOut : Integer;
begin
FFinder.Find;
FindDTMs(DTM, TPA, Inventory.FBounds);
if not PointInbox(FFinder.FireCell.Cell.Middle, MainScreen.FBounds)then
begin
FlipAngle;
Result := False;
exit;
end;
If Length(TPA) > 0 then
begin
if Inventory.GetActiveSlot <> 0 then Mouse.Move(TPA[0]);
if (MainScreen.IsUpText(UpText))then
begin
if Inventory.GetActiveSlot <> 0 then Mouse.Click(1);
Mouse.Move(FFinder.FireCell.Cell);
if MainScreen.IsUpText('Fire')then //chooseoption.Select add right click option
begin
mouse.Click(1);
MiniMap.WaitPlayerMoving();
Timeout := GetTimeRunning;
Repeat
if GetTimeRunning - TimeOut > 8000 then Exit;
Until FindColorTolerance(X, Y, ChatButtonCol, ChatBox.FBounds, 15);
mouse.Click(X, Y, 1);
Timeout := GetTimeRunning;
FindDTMs(DTM, TPA, Inventory.FBounds);
Repeat
if GetTimeRunning - TimeOut > Random(31344, 51241) then
begin
Result := False;
Exit;
end;
FindDTMs(DTM, TPA, Inventory.FBounds);
writeln(UpText+' Left to cook: ' + IntToStr(Round(Length(TPA) / 9)));
Result := True;
if ChatBox.HandleLevelUp then
begin
Inc(FFinder.LevelUpCooking);
Result := False;
Exit;
end;
Until Length(TPA) < 1;
end else
begin
FlipAngle;
Result := False;
Exit;
end;
end else
begin
Result := False;
Exit;
end;
end else
begin
Result := False;
Exit;
end;
end;

procedure Cook;//rewrite
var
RawTroutDTM, RawSalmonDTM, CookTimer, a, b : Integer;
begin
RawTroutDTM := DTMFromString('mFQEAAHicvcuxCoJQAIXh/+YQFErYq7o2Oil4h5tCEVJLbUKbttXiIg2BQvQs0QFbeoEOfMs 5HB/IJ7CXg5Syk40U4iSTRFKxspaZgbe+nhlNzdj5spBQlhLI/LufT0e21lI6R54mXOuae9vy6DqaquLZ97yGgdulIYtjVlGEbn/xkw/VvSQC');
RawSalmonDTM := DTMFromString('mKgEAAHic42NgYDjIxMCwFYhPAfF+IN4HxH uAeCcQbwPiHVDxI0B8DIgPAfFJIH4G1PsOiG8D8QMgfswAEXsB xK+gcm+hYiC5h1B1m4pSGQ4uXcDQmp/NkB4axFDi6cTQFe7HMC0hlGHzlH6GIyuWMCzrbGU431rKsKEgh SHFwZJhZU4CA9BKsjAjmRgVAAAdsywG');
CookTimer := GetTimeRunning;
repeat
if GetTimeRunning - CookTimer > 60000 then break;
if FFinder.Cook('almon', RawSalmonDTM, 6977467) then a := 1;
if FFinder.Cook('rout', RawTroutDTM, 12040385)then b := 1;
Until( a = 1) and (b = 1);

if ((GetTimeRunning - CookTimer) > 60000) then writeln('Failed To Cook After' + IntToStr(Round((GetTimeRunning - CookTimer) / 1000 )) + ' Seconds');
FreeDTMs([RawSalmonDTM, RawTroutDTM]);
end;

procedure HandleInventory;
begin
if Inventory.IsFull then
begin
if DoCooking then Cook; ///cooking needs more work
DropAll;
Inc(FishCaught, 26);
if not IsFishSpotActive(Random(400, 743)) then
begin
FindFish;
end else FFinder.Click;
end;
if ChatBox.HandleLevelUp then
begin
Inc(FFinder.LevelUpFishing);
end;
ChatBox.ClickContinue;
if GetTimeRunning - InvCountTimer > Random(6852, 7152) then
begin
InvCountTimer := GetTimeRunning;
if LastInvCount = Inventory.Count then
begin
LastInvCount := Inventory.Count;
if not IsFishSpotActive(Random(400, 743)) then
begin
FindFish;
end else FFinder.Click;
end;
LastInvCount := Inventory.Count
end;
end;


{In minutes}
function SetBreakTime(Minutes : Integer): Integer;
begin

Result := Minutes * 60000;
end;

//make an advanced breaking handling fatigue style example toilet, drink, food, browse net allow to timeout
(*procedure BreakHandling;
var
player : Tplayer;
begin
if GetTimeRunning - WhenToBreak > WhenToBreak then
begin
Case Random(121,1212) of
0..121 : begin
Wait(Random(SetBreakTime(Random(1,15))));
{Browse the net for 1 - 15 minutes
Allow to time out dont log out
LogBack In
}
if LoginScreen.IsOpen then
begin
if not player.Login then
begin
writeln('failed to log back in do something');
TerminateScript;
end;
end;

//player.Login
WhenToBreak := SetBreakTime(Random(6,77)) + GetTimeRunning;//6 to 77 minutes sets a new time to break at
end;
122..555 :
556..824 :
825..1012 :
1013..1212 :
end;
end;
end; *)

begin
SRL.Setup;
Inventory.ShiftDrop := true;
InvCountTimer := GetTimeRunning;
LastInvCount := Inventory.Count;
FFinder.Find;
findfish;
MapAngle := [Random(85, 95), Random(-15, 15), Random(175, 185)];
LastAngle := Random(3);
repeat
//FFinder.Find;///working
PrintDebug;
if SRL.DismissRandom then Inc(FFinder.RandomsIgnored);
if not IsFishSpotActive(Random(400, 743)) then
begin
FlipAngle;
findfish;
end;
HandleInventory;
until false;
end.

KeepBotting
01-09-2018, 04:50 PM
Congrats on the release!

Mark
01-09-2018, 06:54 PM
Congrats on the release!
Cheers pal far from finished buts it's a working start.

P1nky
01-09-2018, 07:01 PM
Awesome release! Keep going :)

Evening Breakfast
01-09-2018, 08:54 PM
Tested with my computer, working fine with debug console as shown. But when I use VM Windows 7, official OSRS client freezes. May I know why? Is there a way I can use this script without having my mouse being all over the place?

slacky
01-09-2018, 09:01 PM
Gratz on a release! :)


A few notes I made myself:
Could probably simplify some stuff by getting more familiar with SRL. And naming the include-folder OSR will cause some issues with certain plugins. But I fully understand it, you are one of the first to publicly deploy SRL for a script, so not much to build upon.

Anyhow: Drop patterns, we have them all, and functions that take such a pattern are also defaulted to the "regular" pattern:
https://github.com/SRL/SRL/blob/master/osr/interfaces/gametabs/inventory.simba#L48
I also saw you commented out the DropItemsExcept, and wrote your own one, DropItemsExcept should work here, at least if your SRL is up to date, then it's just a matter of setting `Inventory.ShiftDrop := True` on script startup.

Perhaps use IsUpText to check for a string instead of GetUpText alongside Pos
https://github.com/SRL/SRL/blob/master/osr/interfaces/mainscreen.simba#L96
Line 196: `if (Pos('Lure', MainScreen.GetUpText)) or (Pos('rod', MainScreen.GetUpText))then`
Can be made to: `if MainScreen.IsUpText(['Lure', 'rod']) then`


Other than that, a lot of functions have default values, so you don't have to specify it. Specially if you are unsure what actually goes into it.
Like, you did `MiniMap.isPlayerMoving(2)`, but that will be overly sensitive, and return true if just a player walks past you. Leaving it default by calling it like: `MiniMap.isPlayerMoving()` is probably a good idea, or use that default value as guidance.

Other than that, have a look at the Mouse.simba (https://github.com/SRL/SRL/blob/master/shared/mouse.simba#L168-L242)-file you will find that there are plenty of overloads making randomness easier for you to achieve.

Hope it helps, happy scripting :)

Dan the man
01-09-2018, 09:32 PM
Gratz on the release. Always nice to see a new public script :)

Mark
01-10-2018, 02:49 AM
Awesome release! Keep going :)
cheers pal, ive now decided to try get 99 with my test account =] so i will be updating until then...

Gratz on a release! :)


A few notes I made myself:
Could probably simplify some stuff by getting more familiar with SRL. And naming the include-folder OSR will cause some issues with certain plugins. But I fully understand it, you are one of the first to publicly deploy SRL for a script, so not much to build upon.

Anyhow: Drop patterns, we have them all, and functions that take such a pattern are also defaulted to the "regular" pattern:
https://github.com/SRL/SRL/blob/master/osr/interfaces/gametabs/inventory.simba#L48
I also saw you commented out the DropItemsExcept, and wrote your own one, DropItemsExcept should work here, at least if your SRL is up to date, then it's just a matter of setting `Inventory.ShiftDrop := True` on script startup.

Perhaps use IsUpText to check for a string instead of GetUpText alongside Pos
https://github.com/SRL/SRL/blob/master/osr/interfaces/mainscreen.simba#L96
Line 196: `if (Pos('Lure', MainScreen.GetUpText)) or (Pos('rod', MainScreen.GetUpText))then`
Can be made to: `if MainScreen.IsUpText(['Lure', 'rod']) then`


Other than that, a lot of functions have default values, so you don't have to specify it. Specially if you are unsure what actually goes into it.
Like, you did `MiniMap.isPlayerMoving(2)`, but that will be overly sensitive, and return true if just a player walks past you. Leaving it default by calling it like: `MiniMap.isPlayerMoving()` is probably a good idea, or use that default value as guidance.

Other than that, have a look at the Mouse.simba (https://github.com/SRL/SRL/blob/master/shared/mouse.simba#L168-L242)-file you will find that there are plenty of overloads making randomness easier for you to achieve.

Hope it helps, happy scripting :)

thanks alot mate slacky i did notice the DropItemsExcept but it was too late i already wrote that :) thankyou tho for reminding me about using git for referencing the OSR include very tired right now to completely read and rewrite but i will continue this till 99 fishing =]



Gratz on the release. Always nice to see a new public script :)

thanks, had alot of spare time over the holidays ended getting hooked again :)...


Tested with my computer, working fine with debug console as shown. But when I use VM Windows 7, official OSRS client freezes. May I know why? Is there a way I can use this script without having my mouse being all over the place?
you could try adding $DEFINE SMART} before {$I osr.simba} at the top of the script.

slacky
01-10-2018, 06:21 AM
Didn't make myself clear about the include name :3 C:/Simba/Includes/srl/ (https://github.com/slackydev/Simba-Misc/blob/master/Universal_Miner.simba#L3) is where the include goes `{$I SRL/osr.simba}` is how it should look done right.
This is mainly so that certain alternative plugins will work (https://github.com/SRL/SRL/blob/master/utils/slacktree.simba#L1)

Overdrive
01-13-2018, 04:34 PM
Thanks for the release!

Maestrom1
01-15-2018, 04:38 PM
I used to run bots all the day, but since moving to a new PC I can't get anything to work. Even when I've check all the paths in settings its telling mg : Error: File "SRL/osr.simba" not found Anyone an idea?

Mark
01-15-2018, 05:21 PM
As a core developer of the latest SRL for OSRS (https://github.com/SRL/SRL/) it is my duty to recommend it over AeroLib! Flight :p

To get started with SRL for OSRS you need the following:
> Simba 1.2rc with leakfixes (https://github.com/slackydev/Simba/releases/tag/Simba-1.2.0-rc6_fixes) (drop the .exe in Simba folder, and use it instead of Simba.exe)
> SRL for OSRS (https://github.com/SRL/SRL/) copied into your SRL include folder
> RSWalker (https://villavu.com/forum/showthread.php?t=111914)
> A hamburger (https://scontent-sea1-1.cdninstagram.com/t51.2885-15/s480x480/e35/14607150_328038767588050_4281905205236203520_n.jpg ?ig_cache_key=MTM1NTA4MTc1NTMyOTk4ODgwMA%3D%3D.2)
> A buckload of Redbull (https://img1.exportersindia.com/product_images/bc-full/dir_108/3220922/red-bull-energy-drinks-250-ml-1334757.jpeg)
> A shovel (https://media.tractorsupply.com/is/image/TractorSupplyCompany/1023426?$300$), a mattock (https://images-na.ssl-images-amazon.com/images/I/710wjI5I6lL._SX355_.jpg) and a lantern (https://images.halloweencostumes.com/products/12276/1-1/light-up-old-lantern.jpg) as well (in case you give up (https://whenthoughtsaredeep.files.wordpress.com/2015/08/grave-digging.jpg)).
> And finally a fair bit of patience

Please read the setup instructions.

Have made many changes is now on 0.6a will upload later on phone now??

Edit: have updated
more improvements still work in progress 77/99 fishing 63/99 cooking tho cooking could do with a rewrite when i have time.

Evening Breakfast
01-19-2018, 03:21 PM
Latest script does not work. Once fish are full in inventory, it will just rotate the screen.

Mark
01-19-2018, 06:55 PM
Will have to test when I'm home see what's happening on phone right now so can't test maybe an update??
Can you check the debug screen and make sure it's finding the fire.

icyxen
02-15-2018, 06:00 PM
Waiting patiently for an update to help find the fire more easily if there are a couple people surrounding the fire it waste a lot of time until it eventually goes back to fishing.

Mark
02-15-2018, 11:08 PM
Waiting patiently for an update to help find the fire more easily if there are a couple people surrounding the fire it waste a lot of time until it eventually goes back to fishing.

I will add an option to right click the fire instead for if/when a player maybe stood over it.
about to sit down and chill so will be tomorrow i add this.

jsand
02-15-2018, 11:17 PM
Hey Mark,

Not sure what i'm doing wrong but I'm getting this error: UError: Unknown declaration "Self" at line 35
Compiling failed.

Mark
02-15-2018, 11:48 PM
Hey Mark,

Not sure what i'm doing wrong but I'm getting this error: UError: Unknown declaration "Self" at line 35
Compiling failed.

you need to follow the setup again download slacky's fixes and you should be set.

jsand
02-15-2018, 11:49 PM
you need to follow the setup again download slacky's fixes and you should be set.

I figured it was something like that so i uninstalled and am currently re-installing everything. Thanks

jsand
02-16-2018, 12:01 AM
Got it working Mark thanks! Will post any proggies I get.

Edit: When the invent is full, it left clicks the first fish and uses it on the 2nd fish >_<

Dan the man
02-16-2018, 02:03 AM
Got it working Mark thanks! Will post any proggies I get.

Edit: When the invent is full, it left clicks the first fish and uses it on the 2nd fish >_<

The script might use shift drop. Make sure that's enabled on your client.

icyxen
02-16-2018, 08:04 PM
I will add an option to right click the fire instead for if/when a player maybe stood over it.
about to sit down and chill so will be tomorrow i add this.

Awesome, appreciate it