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.

Item hasAction doesn't change if the banking interface is open. Alternative?

Featured Replies

Hi!

Wondering if anyone else ran into this problem before.

I thought of a way to check if a runecrafting pouch is empty or not (during banking). If the banking interface is open the rune pouch has either the option "Fill" or "Empty". I wanted to create a check to see if the item has the action (when the banking interface is open).

I thought I could do it like underneath, but that provides you with all the items that would normally have that action (with the banking interface closed).

getInventory().filter(item -> item.hasAction("Fill")

How would I go on to read the (current) actions of an object? Or if anyone knows of a better way to check/know if the pouch is filled or not, please let me know since old strategies don't work anymore.

  • Author
15 hours ago, Muffins said:

I believe the rune pouch config/id changes based on what's in it, if it's degraded etc.

 

This post is old but should provide some guidance.

 

https://osbot.org/forum/topic/10309-pouch-algorithm-for-adding-pouch-support-to-your-script/

Thanks for your reply. 

I actually read that post and tried to implement a varbits method, but I couldn't get it to work. After that I remembered runelite having a plugin to count the essence so I went looking on their GitHub and there they mentioned that the varbits that track the amount of essence in a pouch were removed. Which explains why the varbits method I used always returned 0. 

So far no luck. Any other creative ideas?

Not sure if maybe something like this would work? //ignore the lack of format, it was fine in Eclipse, not sure why it messed up when I posted. ^^

	private String[] pouches = new String[] { "Small pouch", "Medium pouch", "Large pouch", "Giant pouch" };

public void pouch() throws InterruptedException {
	for (String pouch : pouches) {
    if  (!getInventory().contains(pouch); {
		  getBank().withdraw(pouch, 1);
        } else if (getInventory().contains(pouch)){
				if(pouch.hasAction("Fill")){
            		pouch.interact("Fill");
            		sleep(random(50, 500));    
        }
        new ConditionalSleep(1500, 20) {
            @Override
            public boolean condition() throws InterruptedException {
                return (pouch.hasAction("Empty"));
            }
        }.sleep();
    }
  }

 

Edited by Lol_marcus

On 6/6/2020 at 2:36 PM, Wolk said:

Hi!

Wondering if anyone else ran into this problem before.

I thought of a way to check if a runecrafting pouch is empty or not (during banking). If the banking interface is open the rune pouch has either the option "Fill" or "Empty". I wanted to create a check to see if the item has the action (when the banking interface is open).

I thought I could do it like underneath, but that provides you with all the items that would normally have that action (with the banking interface closed).


getInventory().filter(item -> item.hasAction("Fill")

How would I go on to read the (current) actions of an object? Or if anyone knows of a better way to check/know if the pouch is filled or not, please let me know since old strategies don't work anymore.

Try this, haven't tested it.

Item pouch = (Item) Arrays.stream(getInventory().getItems()).filter((i) -> i.getName().contains("pouch") && i.hasAction("Fill")).toArray()[0];
  • Author

Thanks @Lol_marcus and @BravoTaco!

Sadly neither of those work since they use the same logic that I used/tried.

Item.hasAction("Fill")

always returns true for runecrafting pouches even when the option isn't available.

Edited by Wolk

1 hour ago, Wolk said:

Thanks @Lol_marcus and @BravoTaco!

Sadly neither of those work since they use the same logic that I used/tried.


Item.hasAction("Fill")

always returns true for runecrafting pouches even when the option isn't available.

Is the option visible even when its full? If so you will probably have to use configs than.

  • Author
53 minutes ago, BravoTaco said:

Is the option visible even when its full? If so you will probably have to use configs than.

The option isn't visible when you have the banking interface open. Otherwise it's always visible.

  • Author
1 hour ago, Khaleesi said:

Setting 261 is what you need 😉

Today I learned about the config debugger... Thank you!

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.