Jump to content

Can someone show me the proper way to bank and withdraw my items?


shaba123

Recommended Posts

This is what i am using to bank and withdraw my items, it works but i know its not the proper way. 

This is what i use :

 

 	if (chestArea.contains(myPosition()) & !getBank().isOpen() & !getInventory().contains(bankItems)) {
    		getObjects().closest("Bank chest").interact("Use");
                new ConditionalSleep(5000) { 						// If in bank area and bank isnt open and inventory contains -
				 public boolean condition() {						// certain items, open the bank.
                      return getBank().isOpen(); }
                  }.sleep();}

    	else
    		log("Banking");
                 
                  if (getBank().contains(amuletFilter)) {					//If the bank contains amulet then -
                	  bank.depositAll();									// deposit everything
                	  inventItems.forEach((e) -> bank.withdraw(e, 1));		// withdraw my array of items	
                	  getBank().withdraw(amuletFilter, 1);					// withdraw amulet
                	  getBank().withdraw(duelRing, 1);						// withdraw ring
                	  if (!getEquipment().isWearingItem(EquipmentSlot.RING, "Ring of wealth")) { 		// if im not wearing a ring of wealth then
                		  getBank().withdraw(ringOfWealth, 1);											// withdraw a ring of wealth aswell as the other items
                	  }
                	    getBank().close();									//close the bank
                	} else {
                	    log("Out of supplies!");     						//else if any of that is not possible, stop script.
                	    stop();
                	}

 

Link to comment
Share on other sites

You want to check if your the bank contains your players position in a separate if statement, so you can else it with a walk to bank function and nest the isopen() check inside that.

if(bank.contains(myPlayer())){

    if(bank.isopen()){

        depositall();

    }

    else

        openbank();

}

else

    walktobank();

 

also for withdrawing items I would just type the string of the item name, unless you have a reason for it? 

getBank().withdraw("Ring of dueling", 1);
Edited by Cloxygen
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...