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.

Drop 5 of a certain item

Featured Replies

Can't seem to figure this out, I have 15 of a certain item in my inv and I want to only drop 5 of that item.

Edited by mlrkey

	public boolean dropOnlyThis(String[] blackList) throws IllegalArgumentException, InterruptedException {
		if (getInventory().contains(blackList)) {
			List<Item> list = getInventory().filter(new ContainsNameFilter<Item>(blackList));
			for (Item item: list) {
				if (item != null) {
					item.interact("drop");
					sleep(gRandom(400,100));
				}
			}
		}
		return !getInventory().contains(blackList);
	}

tell me if this helps

  • Author
	public boolean dropOnlyThis(String[] blackList) throws IllegalArgumentException, InterruptedException {
		if (getInventory().contains(blackList)) {
			List<Item> list = getInventory().filter(new ContainsNameFilter<Item>(blackList));
			for (Item item: list) {
				if (item != null) {
					item.interact("drop");
					sleep(gRandom(400,100));
				}
			}
		}
		return !getInventory().contains(blackList);
	}

tell me if this helps

 

 

I should have been more specific. I have 15 of a certain item in my inv and I want to only drop 5 of that item.

Smth like this?

 

inventory.dropForFilter(item -> item.getName().equals("Item Name") && inventory.getAmount("Item Name") > 10);

10 can obv be replaced with getAmount-5 before you use this statement if you want

Just do something like

 

if(getInventory().getAmount("Item") > 10) {

    getInventory().drop("Item");

}

 

If you're using a non-sequential framework, it should get repeated in every loop cycle until you've dropped 5

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.