May 2, 20178 yr 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")
May 14, 20178 yr 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?
May 14, 20178 yr int numberOfPogChamps; if (getBank().isOpen()){ numberOfPogChamps += getBank().getAmount("PogChamp"); } //onPaint g.drawString("# of Pogchamps: " + numberOfPogChamps, 20, 50);
May 14, 20178 yr 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, 20178 yr by LoudPacks
May 14, 20178 yr 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
Create an account or sign in to comment