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.

[Resolved] Widgets - Containing text on settings

Featured Replies

Im trying to make my script more friendly by making it search for the widgets rather than using fixed ids, after a while on the api i found getWidgetContainingText, so i went to the code that changes the settings on start. Im trying to change the roof setting, so the first widget it goes for is the Display tab, but with some testing if the chat tab is open it will go towards the display name option.

image.png.c1d53d4add2b443ff3729e68b746ecae.png

Is there any other method i could use without using a widget list?

Edit: Started messing with the widget debugger and found its sprite id :)

Edited by Mountain Troll

10 minutes ago, Mountain Troll said:

Im trying to make my script more friendly by making it search for the widgets rather than using fixed ids, after a while on the api i found getWidgetContainingText, so i went to the code that changes the settings on start. Im trying to change the roof setting, so the first widget it goes for is the Display tab, but with some testing if the chat tab is open it will go towards the display name option.

image.png.c1d53d4add2b443ff3729e68b746ecae.png

Is there any other method i could use without using a widget list?

I'm not entirely sure what your exact question is so I'm not sure if my reply will answer it.

Look into filters.

e.g.:

public class WidgetMessagesFilter implements Filter<RS2Widget> {

    private final String[] messages;

    public WidgetMessagesFilter(final String... messages) {
        this.messages = messages;
    }

    @Override
    public final boolean match(final RS2Widget rs2Widget) {
        if (rs2Widget == null || !rs2Widget.isVisible() || rs2Widget.getMessage() == null) {
            return false;
        }

        return Arrays.stream(messages).anyMatch(m -> rs2Widget.getMessage().contains(m));
    }
}

Usage:

final RS2Widget loveEagleFilter = s.getWidgets().singleFilter(s.getWidgets().getAll(), new WidgetMessageFilter("TEXT HERE"));

 

Edited by Eagle Scripts

  • Author
35 minutes ago, Eagle Scripts said:

I'm not entirely sure what your exact question is so I'm not sure if my reply will answer it.

Look into filters.

e.g.:


public class WidgetMessagesFilter implements Filter<RS2Widget> {

    private final String[] messages;

    public WidgetMessagesFilter(final String... messages) {
        this.messages = messages;
    }

    @Override
    public final boolean match(final RS2Widget rs2Widget) {
        if (rs2Widget == null || !rs2Widget.isVisible() || rs2Widget.getMessage() == null) {
            return false;
        }

        return Arrays.stream(messages).anyMatch(m -> rs2Widget.getMessage().contains(m));
    }
}

Usage:


final RS2Widget loveEagleFilter = s.getWidgets().singleFilter(s.getWidgets().getAll(), new WidgetMessageFilter("TEXT HERE"));

 

Thank you, although i found a different solution the help is appriciated. :)

1 hour ago, Mountain Troll said:

Thank you, although i found a different solution the help is appriciated. :)

No problem at all. Mind sharing the solution with us?

  • Author
7 minutes ago, Eagle Scripts said:

No problem at all. Mind sharing the solution with us?

Of course i dont mind. I think it was more of my own error as i was looking for a widget using text when there wasnt any. I had read about using sprite ids but had no clue how to get them, when i was just messing with the client options i found the widget debuggeder and then a way to find the sprite ids.

All in all i believe is was my fault for not fully reading into what i was doing.

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.