sp3cpk 0 Share Posted September 5, 2018 So say I want my bot to get all the items in the bank and store it/cache it (as in remember the items in the bank when the bank is closed) how exactly would I do that? Link to comment Share on other sites More sharing options...
Milasoft 202 Share Posted September 5, 2018 The getBank().all() method will return a List of all items in the bank. Link to comment Share on other sites More sharing options...
sp3cpk 0 Author Share Posted September 5, 2018 9 minutes ago, Milasoft said: The getBank().all() method will return a List of all items in the bank. you store it in an array? can you show me an example? Link to comment Share on other sites More sharing options...
Milasoft 202 Share Posted September 5, 2018 Each Item is stored in the List. List<Item> bankItems = getBank().all(); Link to comment Share on other sites More sharing options...
sp3cpk 0 Author Share Posted September 5, 2018 15 minutes ago, Milasoft said: Each Item is stored in the List I tried List<Item> bankItems = new ArrayList<>(getBank().all()); if(bankItems.stream().anyMatch(lol -> lol.getName().equalsIgnoreCase("Coins"))){ getKeyboard().type("lol"); sleep(2000); } Seems to only know coins are in the bank > when bank is open I want the bot to recognize if it had specific items in the bank, even when it is closed Link to comment Share on other sites More sharing options...
Milasoft 202 Share Posted September 5, 2018 Declare the list as an instance variable then. So put List<Item> bankItems; at the top of your class, and then in the method do bankItems = getBank().all(); Link to comment Share on other sites More sharing options...
rubex 28 Share Posted September 5, 2018 getBank().getBankHistoryCache() DreamBot already does this for you Link to comment Share on other sites More sharing options...
sp3cpk 0 Author Share Posted September 5, 2018 2 hours ago, Milasoft said: Declare the list as an instance variable then. So put List<Item> bankItems; at the top of your class, and then in the method do bankItems = getBank().all(); Tried this and still getting the same issue 2 hours ago, PolyesterZest said: getBank().getBankHistoryCache() DreamBot already does this for you Never knew this existed, tried it and getting same issue. in what format are the items stored in the list? id? string? Link to comment Share on other sites More sharing options...
rubex 28 Share Posted September 5, 2018 It is a List<Item>, so you can get the name, id, and amount of each item. It will only get filled once the bank is opened for the first time during the script's run though Link to comment Share on other sites More sharing options...
sp3cpk 0 Author Share Posted September 5, 2018 1 minute ago, PolyesterZest said: It is a List<Item>, so you can get the name, id, and amount of each item. It will only get filled once the bank is opened for the first time during the script's run though this is what I have so far List<Item> bankItems = getBank().getBankHistoryCache(); if(bankItems.stream().anyMatch(lol -> lol.getName().contentEquals("Coins"))){ getKeyboard().type("2"); } as soon as the bank is closed it'll stop spamming "2". Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.