Jump to content

Help with my first script


SafronMalady

Recommended Posts

Look at what Acerd posted, this is for you to help with opening the bank.

To let it walk to the bank, you need to check if your inventory is full and your player is not in the bank area.

If the player is not in the bank area --> walking.webwalk(BANK_AREA):

If the player is in the bank area -->

Execute bank code

Link to comment
Share on other sites

Paste with comments to explain things.

//we check if our inventory is full and we are in bank area.
if (getInventory().isFull() && Banks.VARROCK_WEST.contains(myPlayer())) {
    //We are in the bank are, doing banking.
    //check if bank is open
    if(getBank().isOpen()){
        //Bank open, we are depositing it
        getBank().depositAll();
    }else{
        //if bank is closed, open it.
        getBank().open();
    }
}else{
    //We are walking to the bank area, because we are not in it.
    getWalking().webWalk(Banks.VARROCK_WEST);
}

Raw paste:

if (getInventory().isFull() && Banks.VARROCK_WEST.contains(myPlayer())) {
    if(getBank().isOpen()){
        getBank().depositAll();
    }else{
        getBank().open();
    }
}else{
    getWalking().webWalk(Banks.VARROCK_WEST);
}

 

Good luck tongue.png

Edited by Vilius
  • Like 2
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...