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
  • getBank().all() adds 8x inventory+equipped to list


    yetanotherbot

    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

    Archived

    This topic is now archived and is closed to further replies.

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