Hashtag 8692 Share 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"; } Link to comment Share on other sites More sharing options...
Neffarion 486 Share 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); Link to comment Share on other sites More sharing options...
Hashtag 8692 Author Share Posted March 1, 2017 You should update the widgets. w = getWidgets().getWidgetChild(261, 58); should be w = getWidgets().getWidgetChild(261, 60); Thanks. Link to comment Share on other sites More sharing options...
Neffarion 486 Share Posted March 10, 2017 changed to w = getWidgets().getWidgetChild(261, 62); last update Link to comment Share on other sites More sharing options...
Hashtag 8692 Author Share Posted March 10, 2017 changed to w = getWidgets().getWidgetChild(261, 62); last update Thanks Link to comment Share on other sites More sharing options...
Excel 1 Share Posted March 15, 2017 nice Link to comment Share on other sites More sharing options...
Neffarion 486 Share Posted March 25, 2017 64 now Link to comment Share on other sites More sharing options...
Hashtag 8692 Author Share 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... Link to comment Share on other sites More sharing options...
Nito 0 Share 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? Link to comment Share on other sites More sharing options...
Hashtag 8692 Author Share Posted April 6, 2017 How'd you manage to do that? Mind updating the snippet? The code above is updated already. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.