November 19, 20169 yr SOLVED THANKES TO Juggles__________________________________________________________________________________________________________ I'm making a script that involves checking the amount of coins a player has in their inventory. At the moment it doesn't do anything. It doesn't even open the bank.Here is my code case BANK: if (!getBank().isOpen()){ getBank().open(); } else if (inventory.getAmount("Coins") < 500) { getBank().withdrawAll("Coins"); } else { getBank().close(); } break; It's pretty similar to this, so I'm not sure what I'm doing wrong. http://osbot.org/forum/topic/68196-get-the-amount-of-items-in-inventory/ Thanks. Edited November 19, 20169 yr by Lexhanatin
November 19, 20169 yr I'm making a script that involves checking the amount of coins a player has in their inventory. At the moment it doesn't do anything. It doesn't even open the bank. Here is my code case BANK: // If inventory contains less than 500 coins, withdraw coins if (inventory.getAmount("Coins") < 500) { getBank().withdrawAll("Coins"); } else { getBank().close(); } break; It's pretty similar to this, so I'm not sure what I'm doing wrong. http://osbot.org/forum/topic/68196-get-the-amount-of-items-in-inventory/ Thanks. You need to open the bank first. if (getBank() == null) { // walk to bank } else if (!getBank().isOpen()) { if (getBank().open()) { new ConditionalSleep(5000) { @ Override public boolean condition() throws InterruptedException { return getBank().isOpen(); } }.sleep(); } } else { getBank().withdrawAll("Coins"); }
November 19, 20169 yr Author because you need to use getBank().open() ? I had that already, I just forgot to add it into the code example. Sorry.
November 19, 20169 yr Author Check your state. It's probably not calling the case Thank you so much. You were right.
Create an account or sign in to comment