Jump to content

Bank returns not null even though im no where near it.


Recommended Posts

Posted

api.bank will never be null, so the code will just be trying to call api.bank.open() 24/7 even if its away from a bank.

api.bank is the reference to the osbot's bank class (which holds all functions like bank.open, bank.close, bank.withdraw)

you must replace the api.bank != null line with a way to check if we're near a bank, so you can do if (getNpcs().closest("Banker") != null) { as an example,

of course the best way is to have a list of banks and check if distance is < 15 to any of the banks in the list.

  • Like 1

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