Jump to content
RS123

Banking at GE

Recommended Posts

This code does not open or deposit items into the GE bank. Please help! Thank you.

    if (!bank.isOpen()) {
            NPC banker = npcs.closest("Banker");
            if (banker != null) {
                if (banker.isOnScreen()) {
                    banker.interact("Bank");
                    sleep(random(450,1000));
                    if (!getBank().isOpen()) {
                        getBank().open();
                    
                    }
                } else {
                    camera.toEntity(banker);
                }
            } else {
                bank.depositAll();
                sleep(random(250,450));
                
            }
        }

 

Link to comment
Share on other sites

What errors are you getting?

Easiest way to do it would be something like

if (Banks.GRAND_EXCHANGE.constains(myPlayer()) {
	if (bank.isOpen) {
      	bank.depositAll();
      	CONDITIONAL_SLEEP_UNTIL_INVENTORY_EMPTY // Search in forums for code to do this
    } else {
      try {
      	bank.open();
      } catch (Exception e) {
      }
    }
} else {
  walking.webwalk(Banks.GRAND_EXCHANGE);
}

Didn't check code or syntax

Link to comment
Share on other sites

28 minutes ago, Butters said:

What errors are you getting?

Easiest way to do it would be something like


if (Banks.GRAND_EXCHANGE.constains(myPlayer()) {
	if (bank.isOpen) {
      	bank.depositAll();
      	CONDITIONAL_SLEEP_UNTIL_INVENTORY_EMPTY // Search in forums for code to do this
    } else {
      try {
      	bank.open();
      } catch (Exception e) {
      }
    }
} else {
  walking.webwalk(Banks.GRAND_EXCHANGE);
}

Didn't check code or syntax

if (Banks.GRAND_EXCHANGE.contains(myPlayer())) {
            if (bank.isOpen()) {
                  bank.depositAll();
                  new ConditionalSleep(1900, 5100) {
                      @Override
                      public boolean condition() throws InterruptedException {
                          return true;
                      }
                  };
            } else {
              try {
                  bank.open();
              } catch (Exception e) {
              }
            }
        } else {
          walking.webWalk(Banks.GRAND_EXCHANGE);
        }

 

fixed some errors But it's not working

Link to comment
Share on other sites

7 minutes ago, RS123 said:

if (Banks.GRAND_EXCHANGE.contains(myPlayer())) {
            if (bank.isOpen()) {
                  bank.depositAll();
                  new ConditionalSleep(1900, 5100) {
                      @Override
                      public boolean condition() throws InterruptedException {
                          return true;
                      }
                  };
            } else {
              try {
                  bank.open();
              } catch (Exception e) {
              }
            }
        } else {
          walking.webWalk(Banks.GRAND_EXCHANGE);
        }

 

fixed some errors But it's not working

Replace conditional sleep with something like this

new ConditionalSleep(5000 250) {
                      @Override
                      public boolean condition() throws InterruptedException {
                          return inventory.isEmpty();
                      }
                  };

And reading some examples/playing around would help.

What's not working?

Link to comment
Share on other sites

8 minutes ago, Butters said:

Replace conditional sleep with something like this


new ConditionalSleep(5000 250) {
                      @Override
                      public boolean condition() throws InterruptedException {
                          return inventory.isEmpty();
                      }
                  };

And reading some examples/playing around would help.

What's not working?

Hmm... code didn't work. It will not open the grand exchange bank and deposit

Link to comment
Share on other sites

I'd do something like                           

 



NPC banker = npcs.closest("Banker");
            if (banker != null) {
                banker.interact("Bank");
new ConditionalSleep( ) {
                      @Override
                      public boolean condition() throws InterruptedException {
                          return getBank().isOpen
                      }
                }.sleep();
                  
          if getBank().isOpen()
              getBank().depositAll();
        }
                

 

Don't know whats up with the black lines 

Edited by Dab in a Lab
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.

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...