Hashtag 9073 Posted November 29, 2016 Here is a snippet that enables closing interfaces with ESC button. I hope this saves you some time *This is from a class that extends TaskNode, which requires you to have execute method. The variable s is reference to my TaskScript class. @Override public boolean accept() { return !getClient().isESCEnabled(); } @Override public int execute() { WidgetChild w = getWidgets().getWidgetChild(121, 103); if (w != null && w.isVisible()) { if (w.interact()) { getKeyboard().closeInterfaceWithESC(); } } else { w = getWidgets().getWidgets(widget -> widget != null && widget.getParentID() == 261 && widget.getActions() != null && widget.getActions()[0].equals("Keybinding")).get(0); if (w != null && w.isVisible()) { if (w.interact()) { tries++; } } else if (getTabs().open(Tab.OPTIONS)) { w = getWidgets().getWidgetChild(261, 1, 6); if (w != null && w.isVisible()) { w.interact(); } } } return 500; } @Override public String toString() { return "Enabling ESC"; }
Neffarion 486 Posted February 28, 2017 Here is a snippet that enables closing interfaces with ESC button. I hope this saves you some time *This is from a class that extends TaskNode, which requires you to have execute method. The variable s is reference to my TaskScript class. @Override public int execute() { if (!getClient().isESCEnabled()) { WidgetChild w = getWidgets().getWidgetChild(121, 103); if (w != null && w.isVisible()) { w.interact(); } else { w = getWidgets().getWidgetChild(261, 58); if (w != null && w.isVisible()) { w.interact(); } else if (getTabs().open(Tab.OPTIONS)) { w = getWidgets().getWidgetChild(261, 1, 6); if (w != null && w.isVisible()) { w.interact(); } } } } else { if (getKeyboard().closeInterfaceWithESC()) s.removeNodes(this); } return 500; } You should update the widgets. w = getWidgets().getWidgetChild(261, 58); should be w = getWidgets().getWidgetChild(261, 60);
Hashtag 9073 Author Posted March 1, 2017 You should update the widgets. w = getWidgets().getWidgetChild(261, 58); should be w = getWidgets().getWidgetChild(261, 60); Thanks.
Hashtag 9073 Author Posted March 10, 2017 changed to w = getWidgets().getWidgetChild(261, 62); last update Thanks
Hashtag 9073 Author Posted March 25, 2017 64 now I've modified the whole shit to not use the id because it seems to change almost every update...
Nito 0 Posted April 5, 2017 I've modified the whole shit to not use the id because it seems to change almost every update... How'd you manage to do that? Mind updating the snippet?
Hashtag 9073 Author Posted April 6, 2017 How'd you manage to do that? Mind updating the snippet? The code above is updated already.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.