July 31, 20178 yr Title tells it all. I'm using bank.getItem("String") My code opens the bank, but it just closes it without grabbing what I need, and just repeats itself. if (!inventory.contains("Small fishing net")) { if(banker.isVisible()) { camera.toEntity(banker); banker.interact("Bank"); sleep(random(700,1000)); bank.getItem("Small fishing net"); sleep(random(500,1000)); } else { getWalking().walk(bank_location); } I'm not sure if I'm using sleep properly by the way. Could somebody also explain why sleep is needed?
July 31, 20178 yr bank.getItem("Small fishing net"); That does not withdraw an item getBank.withdraw("item", amount); Also check if bank is open before withdrawing
July 31, 20178 yr if (!getInventory().contains("Small fishing net")) { if (banker != null && banker.exists) { if (banker.isVisible()) { banker.interact("Bank"); new ConditionalSleep(5000) { // ConditionalSleep will sleep for 5 seconds or until the bank is open public boolean condition() { return getBank().isOpen(); } }.sleep(); bank.withdraw(1, "Small fishing net"); new ConditionalSleep(5000) { public boolean condition() { return getInventory().contains("Small fishing net"); } }.sleep() } else { getWalking().walk(bank_location); } there might be a few missing brackets }, but u can just add those in
July 31, 20178 yr getItems(), would get array of items stored in the container. In this case, you should be using withdraw().
July 31, 20178 yr Author 10 minutes ago, Charlotte said: getItems(), would get array of items stored in the container. In this case, you should be using withdraw(). derp, thanks bruv. 15 minutes ago, Juggles said: bank.getItem("Small fishing net"); That does not withdraw an item getBank.withdraw("item", amount); Also check if bank is open before withdrawing Thanks, I just started to learn to code. I'm not sure what kind of checks I should be doing, there's a lot to think about - _ -
July 31, 20178 yr 50 minutes ago, kingbutton said: derp, thanks bruv. Thanks, I just started to learn to code. I'm not sure what kind of checks I should be doing, there's a lot to think about - _ - It's mostly logic. If you were playing and want to withdraw something from the bank, wouldn't you first wait for the bank to open before withdrawing something? That's how it goes
Create an account or sign in to comment