Jump to content

it just keeps opening bank


mousbros

Recommended Posts

it seems it doesnt know the depositbox is open, it just closes the bank again and tries to bank againd without depositing.

thanks guys in advance 

case "BANKING":
            final Area BANKING_AREA = new Area (3044,3233,3050,3236);
            
            
                if(BANKING_AREA.contains(myPosition())){
                    Entity depobox = objects.closest("Bank deposit box");
                    if (depobox != null) {
                        sleep(random(757,2345));
                        if (depobox.interact("Deposit")) {
                            if (depositBox.isOpen()) {                                                                                                  
                                log("Try opening bank");
                                    depositBox.depositAllExcept("Bronze pickaxe");
                                
                            }
                        }
                    }
                }
            
        break;

Link to comment
Share on other sites

@mousbros Why not use the depsoitBox API method open to open the depositbox?

Also to expand off what Agentcallooh said

	if (getDepositBox().isOpen()) {
            if (getDepositBox().depositAllExcept("Bronze pickaxe")) {
                //sleep
            }
        } else if (getDepositBox().open()) {
            //sleep till open
        } else {
            //walk to deposit box area
        }

I would do it like this^ If the box is open it will go to the next if and only if that boolean returns true will it sleep. So it doesn't sleep for  10 seconds or whatever if the action failed. Continue to the else if statement, the API method will look and see if there is a deposit box nearby to attempt to open it. If it does it will then continue to the sleep or whatever you wanna do after. Else walk to the box.

  • Like 1
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...