Jump to content

[Help] Banking


Recommended Posts

Posted (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 by lolpl0xme
Posted (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 by organicjello

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...