March 12, 20187 yr Is there any way I could check whether a specific bank item is visible in the search tab or not? Example: In the search tab, I write coins The widget will only contain 1 item. How do I get the currently visible item(s) in the widget? Edited March 14, 20187 yr by inababila
March 13, 20187 yr Need a little more information as to what you're getting at. It's probably do-able fairly simply with Widgets though.
March 13, 20187 yr Not sure why you need to do this, the osbot bank withdraw api method automatically does all scrolling and tab changing necessary to withdraw an item even if it's not visible. But if for some reason you still need to do this, each bank slot has a widget, use the widget debugger and you should be able to figure out how to do this.
March 13, 20187 yr Author 2 hours ago, Juggles said: getbank.withdraw will withdraw automatically. I never said I want to withdraw, did I? And that is not the target. My request is obvious, read again, please! 5 hours ago, d0zza said: Not sure why you need to do this, the osbot bank withdraw api method automatically does all scrolling and tab changing necessary to withdraw an item even if it's not visible. But if for some reason you still need to do this, each bank slot has a widget, use the widget debugger and you should be able to figure out how to do this. I tried getting widget items but it gives the whole bank items and absolute slot gives the overall slot of the item like 120 for coins when it is the first or second in the search tab. If that was not what you mean, please clarify! Edited March 13, 20187 yr by inababila
March 13, 20187 yr 4 hours ago, inababila said: I never said I want to withdraw, did I? And that is not the target. My request is obvious, read again, please! I tried getting widget items but it gives the whole bank items and absolute slot gives the overall slot of the item like 120 for coins when it is the first or second in the search tab. If that was not what you mean, please clarify! Open osbot settings, go into the Debug tab and click the Widgets checkbox, now you'll be able to see that each bank slot is made up of a widget.
March 13, 20187 yr get the root id of the bank area when you have something searched then try messing with the childs of that root. then call the getItems() method.
March 13, 20187 yr Author 4 hours ago, d0zza said: Open osbot settings, go into the Debug tab and click the Widgets checkbox, now you'll be able to see that each bank slot is made up of a widget. 3 hours ago, Chris said: get the root id of the bank area when you have something searched then try messing with the childs of that root. then call the getItems() method. Indeed.. I already tried those stuff but it gives the whole bank items. Edited March 13, 20187 yr by inababila
March 13, 20187 yr I'd assume you could try searching for a widget based on the text you've entered into the search box, and then grab the position of said widget and interact with it accordingly.
March 13, 20187 yr 6 hours ago, inababila said: Indeed.. I already tried those stuff but it gives the whole bank items. Use the widget debugger to get some more information on that widget, you can definitely do what you want with it.
March 13, 20187 yr public boolean isSearching() { return getWidgets().getWidgetContainingText("Showing items: ") != null; } public List<RS2Widget> getVisibleSearchItems(final String... itemNames) { return !isSearching() ? new LinkedList<>() : getWidgets().getAll().stream() .filter(w -> w != null && w.isVisible()) .filter(w -> Arrays.stream(itemNames).anyMatch(stripFormatting(w.getSpellName())::equals)) .collect(Collectors.toList()); } returns empty list if no matching item name otherwise bunch of rs2widgets that do match not sure if that's what u need?
March 14, 20187 yr Author 20 hours ago, Stimpack said: public boolean isSearching() { return getWidgets().getWidgetContainingText("Showing items: ") != null; } public List<RS2Widget> getVisibleSearchItems(final String... itemNames) { return !isSearching() ? new LinkedList<>() : getWidgets().getAll().stream() .filter(w -> w != null && w.isVisible()) .filter(w -> Arrays.stream(itemNames).anyMatch(stripFormatting(w.getSpellName())::equals)) .collect(Collectors.toList()); } returns empty list if no matching item name otherwise bunch of rs2widgets that do match not sure if that's what u need? Thanks for helping. I was at the hospital Here was what I attempted to do yesterday.. public boolean searchWidget() { RS2Widget search = getWidgets().getWidgetContainingText("Showing items:"); return search != null && search.isVisible(); } public boolean visible(String name) { if (!searchWidget()) return false; RS2Widget item = getWidgets().get(12, 12, getBank().getSlot(name)); if (item != null && item.isVisible() && !item.isHidden()) return true; return false; } I think they are similar and work in the same way. However, both of them log that the item exists if nothing is written in the search box, and if there is something written, it will only check existence for a specific item, and not all. I planned to run a for loop to check for each item's sub-child-id and return an array with found ones. The search box should have at least one letter written. Edited March 14, 20187 yr by inababila
March 14, 20187 yr 5 hours ago, inababila said: I think they are similar and work in the same way. However, both of them log that the item exists if nothing is written in the search box, and if there is something written, it will only check existence for a specific item, and not all. I planned to run a for loop to check for each item's sub-child-id and return an array with found ones. The search box should have at least one letter written. good catch. ideally call the method after having typed a search keyword because empty search box implies match all items
Create an account or sign in to comment