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.

Bank item visible?

Featured Replies

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 by inababila

Need a little more information as to what you're getting at. It's probably do-able fairly simply with Widgets though.

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.

  • 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 by inababila

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.

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.

  • 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 by inababila

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.

 

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. 



    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?

  • 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 by inababila

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

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.