feggit Posted October 9, 2018 Share Posted October 9, 2018 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. 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? Quote Link to comment Share on other sites More sharing options...
Juggles Posted October 9, 2018 Share Posted October 9, 2018 The action is "Tan All". Get root ID, filter 2 Quote Link to comment Share on other sites More sharing options...
feggit Posted October 9, 2018 Author Share Posted October 9, 2018 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. Quote Link to comment Share on other sites More sharing options...
Cruciburo Posted October 10, 2018 Share Posted October 10, 2018 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"); Quote Link to comment Share on other sites More sharing options...
smy Posted October 10, 2018 Share Posted October 10, 2018 (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): Edited October 10, 2018 by smy Quote Link to comment Share on other sites More sharing options...
Ragboys is back Posted October 12, 2018 Share Posted October 12, 2018 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! Quote Link to comment Share on other sites More sharing options...