Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • getBank().all() adds 8x inventory+equipped to list


    yetanotherbot
     Share

    Recommended Posts

    I'm trying to list all items in the bank:

    List<Item> bankItems = getBank().all((item) -> item != null && !item.isPlaceholder());

    But the result looks like I wrote this:

    List<Item> bankItems = getBank().all((item) -> item != null && !item.isPlaceholder());
    for(int i = 0; i < 8; i++){
        bankItems.addAll(getInventory().all());
        bankItems.addAll(getEquipment().all())
    }

    (bug?)

    Is there a way to get only the bank contents?

    Thanks

    Link to comment
    Share on other sites

    Using the code you posted, I don't get the same result that you do. It only includes bank items. Are you sure there isn't something else in your code affecting this.

    Not sure if this would change anything, but make sure Dreambot is updated to the latest version and that you are using fresh start in Dreambot's settings.

    Link to comment
    Share on other sites

    4 hours ago, yetanotherbot said:

    That's so strange. I've restarted the client and it is now working as intended. No changes to code.

    Consider the matter resolved. I'll post if it comes up again.

    Are you running the code in multiple tabs at the same time?

    Link to comment
    Share on other sites

    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
     Share

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.