farmerGold Posted May 2, 2017 Share Posted May 2, 2017 Tell me please How to check if there is a thing in the bank ? Quote Link to comment Share on other sites More sharing options...
Chris Posted May 2, 2017 Share Posted May 2, 2017 public class Bank extends ItemContainer Represents the API regarding bank functionality. https://osbot.org/api/org/osbot/rs07/api/util/ItemContainer.html contains public boolean contains(java.util.List<Item> items) Determines whether or not this containers contains any of the specified items. Parameters: items - The items to match. Returns: True if the containers contains at least one item matched. getBank().contains("TriHard") 3 Quote Link to comment Share on other sites More sharing options...
Charlotte Posted May 2, 2017 Share Posted May 2, 2017 getBank().contains("item") 1 Quote Link to comment Share on other sites More sharing options...
Saiyan Posted May 2, 2017 Share Posted May 2, 2017 only check if the bank contains an item if the bank tab is open 1 Quote Link to comment Share on other sites More sharing options...
farmerGold Posted May 2, 2017 Author Share Posted May 2, 2017 Many thanks to all. Long time did not write scripts) Quote Link to comment Share on other sites More sharing options...
Phaibooty Posted May 14, 2017 Share Posted May 14, 2017 On 5/1/2017 at 9:58 PM, Chris said: public class Bank extends ItemContainer Represents the API regarding bank functionality. https://osbot.org/api/org/osbot/rs07/api/util/ItemContainer.html contains public boolean contains(java.util.List<Item> items) Determines whether or not this containers contains any of the specified items. Parameters: items - The items to match. Returns: True if the containers contains at least one item matched. getBank().contains("TriHard") Hi, Using that, how would I display # of a item in paint? I just need to be able to call it? Maybe, puclic int = getbank... something... Or would it be more complicated than that? Where I have to update a number every time I open the bank? 1 Quote Link to comment Share on other sites More sharing options...
Chris Posted May 14, 2017 Share Posted May 14, 2017 int numberOfPogChamps; if (getBank().isOpen()){ numberOfPogChamps += getBank().getAmount("PogChamp"); } //onPaint g.drawString("# of Pogchamps: " + numberOfPogChamps, 20, 50); 1 Quote Link to comment Share on other sites More sharing options...
LoudPacks Posted May 14, 2017 Share Posted May 14, 2017 (edited) 11 hours ago, Chris said: int numberOfPogChamps; if (getBank().isOpen()){ numberOfPogChamps += getBank().getAmount("PogChamp"); } //onPaint g.drawString("# of Pogchamps: " + numberOfPogChamps, 20, 50); This will add the bank amount each time you open the bank. So if you have 200 and open the bank twice it will say 400 instead of 200. You should update the var like: numberOfPogChamps += getBank().getAmount("PogChamp") - numberOfPogChamps; //or numberOfPogChamps = getBank().getAmount("PogChamp") This way it will only update the changes. Edited May 14, 2017 by LoudPacks 1 Quote Link to comment Share on other sites More sharing options...
Chris Posted May 14, 2017 Share Posted May 14, 2017 6 hours ago, LoudPacks said: This will add the bank amount each time you open the bank. So if you have 200 and open the bank twice it will say 400 instead of 200. You should update the var like: numberOfPogChamps += getBank().getAmount("PogChamp") - numberOfPogChamps; //or numberOfPogChamps = getBank().getAmount("PogChamp") This way it will only update the changes. yeah u rite but i figured he would know that after a few tests xD 1 Quote Link to comment Share on other sites More sharing options...
okaymate Posted May 27, 2017 Share Posted May 27, 2017 needed this, tanks ! big up Quote Link to comment Share on other sites More sharing options...