Wolk Posted June 6, 2020 Share Posted June 6, 2020 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. Quote Link to comment Share on other sites More sharing options...
Muffins Posted June 6, 2020 Share Posted June 6, 2020 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/ Quote Link to comment Share on other sites More sharing options...
Wolk Posted June 7, 2020 Author Share Posted June 7, 2020 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? Quote Link to comment Share on other sites More sharing options...
Lol_marcus Posted June 8, 2020 Share Posted June 8, 2020 (edited) 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 June 8, 2020 by Lol_marcus Quote Link to comment Share on other sites More sharing options...
BravoTaco Posted June 8, 2020 Share Posted June 8, 2020 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]; Quote Link to comment Share on other sites More sharing options...
Wolk Posted June 8, 2020 Author Share Posted June 8, 2020 (edited) 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 June 8, 2020 by Wolk Quote Link to comment Share on other sites More sharing options...
BravoTaco Posted June 8, 2020 Share Posted June 8, 2020 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. Quote Link to comment Share on other sites More sharing options...
Wolk Posted June 8, 2020 Author Share Posted June 8, 2020 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. Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted June 8, 2020 Share Posted June 8, 2020 4 minutes ago, Wolk said: The option isn't visible when you have the banking interface open. Otherwise it's always visible. Setting 261 is what you need Quote Link to comment Share on other sites More sharing options...
Wolk Posted June 8, 2020 Author Share Posted June 8, 2020 1 hour ago, Khaleesi said: Setting 261 is what you need Today I learned about the config debugger... Thank you! 1 Quote Link to comment Share on other sites More sharing options...