Jump to content

[Help] Banking


lolpl0xme

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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