Jump to content

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


shaba123

Recommended Posts

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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