Jump to content

Tanning at Al-Kharid


Recommended Posts

Posted
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.

Posted (edited)
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
Posted

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

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...