Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Bank not closing && Mining [Banking FIXED]

Featured Replies

Running into two problems with my Mining script at the moment. 

Firstly:

Spoiler

private void bankOre() throws InterruptedException {
    if(!Banks.VARROCK_EAST.contains(myPosition()) && getInventory().isFull() && !myPlayer().isAnimating() && !getBank().isOpen() && !getDialogues().isPendingContinuation()) {
        log("Walking to VARROCK_EAST...");
        getWalking().webWalk(Banks.VARROCK_EAST);
    }else if(Banks.VARROCK_EAST.contains(myPosition()) && !getBank().isOpen()) {
        log("Opening Bank..");
        getBank().open();
    }else if(getBank().isOpen() && getInventory().contains("Iron ore") && Banks.VARROCK_EAST.contains(myPosition())) {
        log("Depositing Ore..");
        getBank().depositAll("Iron ore");
    }else if(getBank().isOpen() && !getInventory().contains("Iron ore") && Banks.VARROCK_EAST.contains(myPosition())) {
        log("Closing Bank..");
        getBank().close();
    }
}

getbank().close; is not being executed... don't understand why.

 

Secondly:

Spoiler

if(!myPlayer().isAnimating() && !getDialogues().isPendingContinuation() && miningSpot.contains(myPosition()) && ironOre != null && ironOre.interact("Mine")) {
    log("Mining Ore...");
    new ConditionalSleep(5000) {
        @Override
        public boolean condition() {
            return myPlayer().isAnimating();
        }
    }.sleep();

Trying to find a way to make bot interact with another rock  if rock I'm mining is taken by another player already

 

Any suggestions would be greatly appreciated :)

 

Edit: Just removed close; for now. Works fine w/o just wanna understand why it's not executing.

Edited by Imthabawse

3 hours ago, Imthabawse said:

Running into two problems with my Mining script at the moment. 

Firstly:

  Hide contents


private void bankOre() throws InterruptedException {
    if(!Banks.VARROCK_EAST.contains(myPosition()) && getInventory().isFull() && !myPlayer().isAnimating() && !getBank().isOpen() && !getDialogues().isPendingContinuation()) {
        log("Walking to VARROCK_EAST...");
        getWalking().webWalk(Banks.VARROCK_EAST);
    }else if(Banks.VARROCK_EAST.contains(myPosition()) && !getBank().isOpen()) {
        log("Opening Bank..");
        getBank().open();
    }else if(getBank().isOpen() && getInventory().contains("Iron ore") && Banks.VARROCK_EAST.contains(myPosition())) {
        log("Depositing Ore..");
        getBank().depositAll("Iron ore");
    }else if(getBank().isOpen() && !getInventory().contains("Iron ore") && Banks.VARROCK_EAST.contains(myPosition())) {
        log("Closing Bank..");
        getBank().close();
    }
}

getbank().close; is not being executed... don't understand why.

 

Secondly:

  Reveal hidden contents


if(!myPlayer().isAnimating() && !getDialogues().isPendingContinuation() && miningSpot.contains(myPosition()) && ironOre != null && ironOre.interact("Mine")) {
    log("Mining Ore...");
    new ConditionalSleep(5000) {
        @Override
        public boolean condition() {
            return myPlayer().isAnimating();
        }
    }.sleep();

Trying to find a way to make bot interact with another rock  if rock I'm mining is taken by another player already

 

Any suggestions would be greatly appreciated :)

 

Edit: Just removed close; for now. Works fine w/o just wanna understand why it's not executing.

Is "Closing bank.." shown in logger?

  • Author
2 hours ago, SyntaxRS said:

Is "Closing bank.." shown in logger?

Nope just sits there with bank open. I had it working before I changed up my mining code dunno what would of thrown it off.

47 minutes ago, Imthabawse said:

Nope just sits there with bank open. I had it working before I changed up my mining code dunno what would of thrown it off.

remove the else if, to simply if statements.

Because else will only be executed if the prior if statement is false.

 

So basically what was happening is you weren't at the bank, so the first if statement was true, and therefore it walked to the bank, which then dismissed any other statements because you used " else ", which in simple terms is basically saying if A is not true, then do B, but because A is true, B is dismissed..

 

       

private void bankOre() throws InterruptedException {
    if(!Banks.VARROCK_EAST.contains(myPosition()) && getInventory().isFull() && !myPlayer().isAnimating() && !getBank().isOpen() && !getDialogues().isPendingContinuation()) {
        log("Walking to VARROCK_EAST...");
        getWalking().webWalk(Banks.VARROCK_EAST);
    }
    if(Banks.VARROCK_EAST.contains(myPosition()) && !getBank().isOpen()) {
        log("Opening Bank..");
        getBank().open();
    }
    if(getBank().isOpen() && getInventory().contains("Iron ore") && Banks.VARROCK_EAST.contains(myPosition())) {
        log("Depositing Ore..");
        getBank().depositAll("Iron ore");
    }
    if(getBank().isOpen() && !getInventory().contains("Iron ore") && Banks.VARROCK_EAST.contains(myPosition())) {
        log("Closing Bank..");
        getBank().close();
    }
}

 

Edited by SyntaxRS

  • Author
32 minutes ago, SyntaxRS said:

remove the else if, to simply if statements.

Because else will only be executed if the prior if statement is false.

 

So basically what was happening is you weren't at the bank, so the first if statement was true, and therefore it walked to the bank, which then dismissed any other statements because you used " else ", which in simple terms is basically saying if A is not true, then do B, but because A is true, B is dismissed..

 

       


private void bankOre() throws InterruptedException {
    if(!Banks.VARROCK_EAST.contains(myPosition()) && getInventory().isFull() && !myPlayer().isAnimating() && !getBank().isOpen() && !getDialogues().isPendingContinuation()) {
        log("Walking to VARROCK_EAST...");
        getWalking().webWalk(Banks.VARROCK_EAST);
    }
    if(Banks.VARROCK_EAST.contains(myPosition()) && !getBank().isOpen()) {
        log("Opening Bank..");
        getBank().open();
    }
    if(getBank().isOpen() && getInventory().contains("Iron ore") && Banks.VARROCK_EAST.contains(myPosition())) {
        log("Depositing Ore..");
        getBank().depositAll("Iron ore");
    }
    if(getBank().isOpen() && !getInventory().contains("Iron ore") && Banks.VARROCK_EAST.contains(myPosition())) {
        log("Closing Bank..");
        getBank().close();
    }
}

 

Makes sense. Thanks for the reply! 

52 minutes ago, Imthabawse said:

Makes sense. Thanks for the reply! 

Let me know if that fixed the issue though please :).

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.