Lexhanatin Posted November 19, 2016 Share Posted November 19, 2016 (edited) 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, 2016 by Lexhanatin 1 Quote Link to comment Share on other sites More sharing options...
Chris Posted November 19, 2016 Share Posted November 19, 2016 because you need to use getBank().open() ? Quote Link to comment Share on other sites More sharing options...
Explv Posted November 19, 2016 Share Posted November 19, 2016 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"); } Quote Link to comment Share on other sites More sharing options...
Lexhanatin Posted November 19, 2016 Author Share Posted November 19, 2016 because you need to use getBank().open() ? I had that already, I just forgot to add it into the code example. Sorry. Quote Link to comment Share on other sites More sharing options...
Juggles Posted November 19, 2016 Share Posted November 19, 2016 Check your state. It's probably not calling the case 2 Quote Link to comment Share on other sites More sharing options...
Lexhanatin Posted November 19, 2016 Author Share Posted November 19, 2016 Check your state. It's probably not calling the case Thank you so much. You were right. 1 Quote Link to comment Share on other sites More sharing options...
sp3cpk Posted November 24, 2016 Share Posted November 24, 2016 Thanks this helped me as well Quote Link to comment Share on other sites More sharing options...