Jump to content

Barbarian Village Fisher & Cooker


Recommended Posts

Posted (edited)

AUnnTzY.png

Fly fishes trout and salmon at Barbarian Village then cooks the raw fish on the permanent fire.

Option to drop cooked fish or to bank them.

Current Version 1.1

Download: http://www.mediafire.com/file/35ftk4721uz144f/BarbVilleFisher%26Cooker.zip/file

 

Progress Reports:

Spoiler

090fad9c7d432ea0985b8a166578388e.png

image.png.3eff95cd0d0b91a90a572d36609ec739.png

image.png.72fb998ab7371a5ca1efb2f0371234f0.png

Change Log:

Spoiler

1.0 - Initial release

1.1 - Fixed the bot occasionally not picking up the fire on default zoom, optimised script

 

Edited by memelord123
  • Like 1
Posted (edited)

Good job on the release... I would try and refactor your code a little to be more maintainable. Rather than have a giant onLoop() you can break it down to functions and boolean checks. 

if ( ! myPlayer().isAnimating() ){
  if ( !getInventory().isFull() ){
    fish(); 
  } else {
    if ( shouldBank() ){
      bank(); 
    } else { 
      cook(); 
    }
  }
} else { 
  // Wait as we are fishing or cooking
} 

Also wrap your interactions in conditionals

if ( fishingSpot.interact("Lure") ){
  status = "Fishing"; 
  //handle post interaction logic
}

This ensures you can check for interaction success / failure. 

Look into walking#walkPath as you shouldn't need to use webWalk for this.  

Edited by jca
  • Like 1
Posted
34 minutes ago, jca said:

Good job on the release... I would try and refactor your code a little to be more maintainable. Rather than have a giant onLoop() you can break it down to functions and boolean checks. 


if ( ! myPlayer().isAnimating() ){
  if ( !getInventory().isFull() ){
    fish(); 
  } else {
    if ( shouldBank() ){
      bank(); 
    } else { 
      cook(); 
    }
  }
} else { 
  // Wait as we are fishing or cooking
} 

Also wrap your interactions in conditionals


if ( fishingSpot.interact("Lure") ){
  status = "Fishing"; 
  //handle post interaction logic
}

This ensures you can check for interaction success / failure. 

Look into walking#walkPath as you shouldn't need to use webWalk for this.  

Thanks for the advice. I plan on breaking the onLoop down to a few methods but as I initially wrote it like this I kept it like this in the thread so others can easily read it without scrolling to each method. Second point makes total sense and I should be putting booleans like that in conditional statements but as I viewed it as "just an action" I didn't really think to write it the way you describe. Finally, I just used webWalk because I knew about it so I didn't look into any other methods of walking but I realised while using webWalk that it's not ideal, so I'll definitely look into walkPath.

 

20 minutes ago, Juggles said:

Start the bracket { on the line above please. 
Easier to read xD

Imo it looks prettier and easier to follow the way I do it and doesn't break the code conventions. But I realise most people write like the way you described and to them it probably seems like a lot of brackets flying around :D

  • Like 1
  • 9 months later...
Posted

[INFO][Bot #1][10/13 04:53:22 PM]: Terminating script BarbVilleFisher&Cooker...
[WARN][Bot #1][10/13 04:53:27 PM]: Event executor is taking too long to suspend; terminating now...
[INFO][Bot #1][10/13 04:53:27 PM]: Time ran: 15:28:54
[INFO][Bot #1][10/13 04:53:27 PM]: Fishing Xp gained: 365,250
[INFO][Bot #1][10/13 04:53:27 PM]: Cooking Xp gained: 471,640
[INFO][Bot #1][10/13 04:53:27 PM]: Script BarbVilleFisher&Cooker has exited!

Ran for nearly 15.5 hours good script

  • Like 1
  • 4 weeks later...
  • 8 months later...
  • 4 months later...
  • 1 year later...
  • 6 months later...
  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...