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
  • Issues Adding Items to Bank Cache


    Recommended Posts

    Hey all!

    Running into an issue with the Bank class's item caching; not sure if it's intended behavior or not, but thought I'd at least ask. I'm trying to store a persistent list of items in the bank so without even visiting the bank on startup, the bot already knows what items are present in it. I know the Bank API supports caching, but the contains method doesn't seem to return the correct value after manually adding an item to the cache. Is this intended behavior?


    Item itemObj = new Item(20997, 1, 200);
    MethodProvider.log("Bank has Twisted Bow? = " + Bank.contains(20997));

    I would expect Bank.contains(20997) to return true since I've enabled bank caching and added the item to the bank history cache, but it returns false.

    My issues extend to the getBankHistoryCache() method as well. The following code also returns false:

    Item itemObj = new Item(20997, 1, 200);
    boolean hasBow = false;
    List<Item> cachedBankItems = Bank.getBankHistoryCache();
    for (Item it : cachedBankItems) {
    	if (it != null && it.getID() == id) {
    		hasBow = true;
    MethodProvider.log("Bank has Twisted Bow? = " + hasBow);

    So, with that in mind, any thoughts or tips on the correct way to add items to the bank cache, and the correct way to get whether a given item is present in the cached bank?

    ( btw, I'm not actually using a Twisted Bow with my bot, just thought I'd use it for the example :D )



    Ah! I realized after posting that addToBankHistoryCache() is returning false, presumably because a cache doesn't yet exist. Is there any way to initialize a cache without actually moving the bot to the bank and having them open it?

    Link to comment
    Share on other sites

    Cache is stored per client instance / account if I remember correctly. However you can save the bank cache to a text file and then just load that / update it yourself whenever the bank is opened again. This would save you from having to open the bank each time you start a new client session, however the bank will need to be opened at least once at some point or another.

    Link to comment
    Share on other sites


    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.