Jump to content

Tanning at Al-Kharid


feggit

Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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