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.

Tanning at Al-Kharid

Featured Replies

I'm trying to make a tanning script at Al-Kharid. However, I am trying find the widget for each of the hides you can tan.

image.png.3c0840e1369b02c38a0e976abc21ca13.png

 

However, I cannot find them. When I get all widgets and I try to look at actions if there is one with "Tan" in it, but I also cannot find any. How can I find the widget?

  • Author
1 hour ago, Juggles said:

The action is "Tan All". Get root ID, filter

What I meant was:

List<RS2Widget> list = getWidgets().getAll();
for (RS2Widget widget : list) {
    String[] actions = widget.getInteractActions();
    if (actions != null) {
        for (String action : widget.getInteractActions()) {
            if (action != null && action.toLowerCase().contains("tan")) {
                log(widget.getRootId() + ", " + widget.getSecondLevelId());
            }
        }
    }
}

But this didn't work. So I followed your advice and tried this:

for (int i = 0; i <= 999; i ++) {
    List<RS2Widget> list = getWidgets().containingActions(i, "Tan All");
    if (list.size() > 0) {
        log(i);
    }
}

But this gives a ArrayIndexOutOfBoundsException (At 616) before outputting anything. I even tried to bruteforce with rootID, secondLevelID, thirdLevelID between 0 and 999 and it still returns nothing.

1. Trade Ellis

2. Check that the widget is visible

getWidgets().get(rootid, childid).isVisible();

For Green D'Hides it's (324, 3)

3. Then interact with the widget using "Tan all"

getWidgets().get(324,3).interact("Tan all");

 

15 hours ago, feggit said:

What I meant was:


List<RS2Widget> list = getWidgets().getAll();
for (RS2Widget widget : list) {
    String[] actions = widget.getInteractActions();
    if (actions != null) {
        for (String action : widget.getInteractActions()) {
            if (action != null && action.toLowerCase().contains("tan")) {
                log(widget.getRootId() + ", " + widget.getSecondLevelId());
            }
        }
    }
}

But this didn't work. So I followed your advice and tried this:


for (int i = 0; i <= 999; i ++) {
    List<RS2Widget> list = getWidgets().containingActions(i, "Tan All");
    if (list.size() > 0) {
        log(i);
    }
}

But this gives a ArrayIndexOutOfBoundsException (At 616) before outputting anything. I even tried to bruteforce with rootID, secondLevelID, thirdLevelID between 0 and 999 and it still returns nothing.

Hey, I don't thing that would work, because what if you want to only tan a black dh and it would tan a green one.

The way I do it is with a static ids(last time I check you can only use Widged ids as a static):

private RS2Widget getRightWidget()
{
	if(api.inventory.contains(Utils.DRAGONHIDES[0]))
		return api.widgets.get(324, 96);
	if(api.inventory.contains(Utils.DRAGONHIDES[1]))
		return api.widgets.get(324, 97);
	if(api.inventory.contains(Utils.DRAGONHIDES[2]))
		return api.widgets.get(324, 98);
	if(api.inventory.contains(Utils.DRAGONHIDES[3]))
		return api.widgets.get(324, 99);
	return null;
}

You can see for your self(a white square):

Untitled.png

Edited by smy

Instead of using widgets with ID, you could try using Widget's Text.

My first script was a simple hard/soft leather Tanner at al kharid and the part I handled the widgets took me a long time to resolve, but with some help I was able to do something like this

 

public void tanAll() throws InterruptedException{
        RS2Widget tanningScreen = getWidgets().getWidgetContainingText("Hard leather");
        tanningScreen.interact("Tan All");
    }

Hope it helps you. I'm willing to send you all my code if you wish to take a look at the whole process.

Cheers!

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.