sp3cpk 0 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?
Milasoft 202 Posted September 5, 2018 The getBank().all() method will return a List of all items in the bank.
sp3cpk 0 Author 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?
Milasoft 202 Posted September 5, 2018 Each Item is stored in the List. List<Item> bankItems = getBank().all();
sp3cpk 0 Author 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
Milasoft 202 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();
sp3cpk 0 Author 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?
rubex 28 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
sp3cpk 0 Author 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".
Recommended Posts
Archived
This topic is now archived and is closed to further replies.