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.

withdraw all items on a list

Featured Replies

i am looking to withdraw items A, B, C, D, E from the bank for example.

what would be the best way to do this?

 

would i check individually for each item i.e

 

if A is in bank

withdraw A

If B is in bank

withdraw B

etc

 

or would i be able to do a list for example:

 

if Items is in bank

withdraw Items

 

Edit:

 

i want to withdraw ALL not X/all but one etc

Edited by Lewis

  • Author

You could maybe try to loop through the items in a for loop by making a list/array and loop through every item in that list/array

 

could you give me a code example please?

 

ArrayList listTest = new ArrayList(

listTest.add( "first item" );

listTest.add( "second item" );

listTest.add( "third item" );

listTest.add( "fourth item" );

 

for example

Edited by Lewis

could you give me a code example please?

 

ArrayList listTest = new ArrayList(

listTest.add( "first item" );

listTest.add( "second item" );

listTest.add( "third item" );

listTest.add( "fourth item" );

 

for example

 

Send me a message on skype

Edited by Eagle Scripts

  • Author

Send me a message on skype

thank you, not on skype currently but ill be on soon

You can try:

array items

if the bank is open:
    loop through items
        if the bank contains items[x] and inventory does not:
            withdraw item[x]
        else continue/stop
else if the bank is not open and my player is near the bank:
    open bank
else
    go to the bank

Edited by Lordsthan

still needing help with this

 

if(getBank().isOpen()){

if (getBank().contains("itemA")) {

 getBank().withdraw("itemA", 5); //Will withdraw 5 of Item A

}

if (getBank().contains("itemB")) {

 getBank().withdrawAll("ItemB"); //will withdraw ALL of Item B

}

if (getBank().contains("itemC")) {

 getBank().withdraw("itemC", 5); //Will withdraw 5 of Item C

}

if (getBank().contains("itemD")) {

 getBank().withdrawAll("ItemD"); //will withdraw ALL of Item D

}

}

 

 

--This might not be the best way but hope it can help!

I'd imagine its possible to make a list or array work, but straight up use won't work. 

 

EDIT: Adding in failsafes to what i've written below would be an improvement, if statements like how bamboozled wrote it is a step in the right direction. 

private String items[] = new String[] {"Death rune", "Nature rune", "Battlestaff",  };

bank.withdrawAll(items); // this won't work.

/////////////////////////////////////////////////////////////////////////// This is how i would write it.

getBank().enableMode(Bank.BankMode.WITHDRAW_NOTE);
bank.withdrawAll(A);
new ConditionalSleep(10000) {
	@[member='Override']

	public boolean condition() throws InterruptedException {
		return inventory.contains(A);
	}
}.sleep();
bank.withdrawAll(B);
new ConditionalSleep(10000) {
	@[member='Override']

	public boolean condition() throws InterruptedException {
		return inventory.contains(B);
	}
}.sleep();
bank.withdrawAll(C);
new ConditionalSleep(10000) {
	@[member='Override']

	public boolean condition() throws InterruptedException {
		return inventory.contains(C);
	}
}.sleep();

Edited by PlagueDoctor

To get you started:

// Google "ArrayList"
List<String> itemNames = new ArrayList<>();

// Add items to ArrayList
itemNames.add("nature rune");
itemNames.add("dragon dagger");

// Use Lambda expressions to loop through list and withdraw items
// (e) is the individual (e)lement of the list
itemNames.forEach((e) -> bank.withdrawAll(e));

There's NO validation in this. It's a simple assumption-based botting; we're assuming we'll be able to withdraw each item.

if(getBank().isOpen()){

if (getBank().contains("itemA")) {

 getBank().withdraw("itemA", 5); //Will withdraw 5 of Item A

}

if (getBank().contains("itemB")) {

 getBank().withdrawAll("ItemB"); //will withdraw ALL of Item B only if A is already withdrawn

}

if (getBank().contains("itemC")) {

 getBank().withdraw("itemC", 5); //Will withdraw 5 of Item C only if A and B are already withdrawn.

}

if (getBank().contains("itemD")) {

 getBank().withdrawAll("ItemD"); //will withdraw ALL of Item D only if A,B, and C are already withdrawn.

}

}

 

 

--This might not be the best way but hope it can help!

 

Would be better to do else if instead of just using an if

else if

causes the previous step to become false until it moves onto the next step.

Example:

if (getBank().contains("itemA")) {
 getBank().withdraw("itemA", 5); //Will withdraw 5 of Item A
} else if (getBank().contains("itemB")) {
 getBank().withdrawAll("ItemB"); //will withdraw ALL of Item B
}else if (getBank().contains("itemC")) {
 getBank().withdraw("itemC", 5); //Will withdraw 5 of Item C
}else if (getBank().contains("itemD")) {
 getBank().withdrawAll("ItemD"); //will withdraw ALL of Item D
}

Edited by Juggles

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.