lolpl0xme Posted March 5, 2015 Share Posted March 5, 2015 (edited) Hello guys i am wondering how to do this properly i am trying to do banking and have looked at some tutorials and cant seem to get it working am i doing this right or wrong?. I removed the non-bank code / other stuff so only my banking code is here is there anything wrong / i am missing? i just want to make my own script for private use. NOTE LIKE ABOVE I SAID I REMOVED THE OTHER NON-BANKING CODE JUST TO MAKE IT EASIER TO SEE. private int BankIDs[] = {11744}; private static final Area Bank_Area = new Area(3272, 3162, 3269, 3173); private enum State { BANK }; private State getState() { RS2Object bankBooth = objects.closest(BankIDs); if (bankBooth != null) return State.BANK; return State.BANK; } public int onLoop() throws InterruptedException { switch (getState()) { case BANK: RS2Object bankBooth = objects.closest(BankIDs); if (bankBooth != null) { if (bankBooth.interact("Bank")) { while (!bank.isOpen()) sleep(250); bank.withdrawAll("Trout"); } } break; } return random(90); } public void onPaint(Graphics2D g) { // add paint later } } Edited March 5, 2015 by lolpl0xme Quote Link to comment Share on other sites More sharing options...
organicjello Posted March 5, 2015 Share Posted March 5, 2015 (edited) why can't you just debug it yourself...what results do you get? I'm assuming your script opens the bank and nothing happens. If so, I assume it has to do with the withdrawAll function not executing due to sleep timers. Don't use a while loop, I would just sleep for a couple of seconds after you open the bank. To debug yourself, put some logs in your code to see what loops get skipped and what loops are entered...(Ex: log("Entered the loop")); Edited March 5, 2015 by organicjello Quote Link to comment Share on other sites More sharing options...