Jump to content

roguehippo's Basket Filler


Recommended Posts

Posted (edited)

Hello everyone, I am thinking about applying for scripter status and decided to show the community what i can do. Here is a script i quickly made to fill baskets! :) 

works by any banker npc just have the empty baskets and whatever object you want to fill them with in the bank.

includes: 

easy to use gui

all fruit / vegetable options 

 

let me know if any bugs are found, thanks!

( I updated with gui of time spent and baskets made)

the baskets made / hr will be around 1600 and can profit from like 150k - 300k depending on prices

BasketFiller.jar

Edited by roguehippo
updated file
  • Like 2
  • 4 weeks later...
  • 1 month later...
  • 2 months later...
Posted

I used a decompiler to take a look at your code and there are a few things I can see that could use some fixing up before applying for scripter status.

1) OSbot's API methods can fail and so you should be checking if they return true before sleeping after calling them. Example:

if (bank.depositAll()) {
	sleep;
}

2) You should be using conditional sleeps instead of just random sleeps so that the script waits till the condition has passed.

3) I don't know why you're declaring String arrays every time you want to interact with something. 

NPC banker = (NPC)this.getNpcs().closest(new String[]{"Banker"});

should be

NPC banker = (NPC)this.getNpcs().closest("Banker");

And even then, it's a good idea to store things as variables and even final variables if you know the value is never going to change.

Posted
1 hour ago, d0zza said:

I used a decompiler to take a look at your code and there are a few things I can see that could use some fixing up before applying for scripter status.

1) OSbot's API methods can fail and so you should be checking if they return true before sleeping after calling them. Example:


if (bank.depositAll()) {
	sleep;
}

2) You should be using conditional sleeps instead of just random sleeps so that the script waits till the condition has passed.

3) I don't know why you're declaring String arrays every time you want to interact with something. 


NPC banker = (NPC)this.getNpcs().closest(new String[]{"Banker"});

should be

NPC banker = (NPC)this.getNpcs().closest("Banker");

And even then, it's a good idea to store things as variables and even final variables if you know the value is never going to change.

i didnt even know that osbot functions returned true if they were successful, i can think of so many places where this would get rid of some bugs. thanks so much for the helpful information!

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...