Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • ESC enabler


    Hashtag

    Recommended Posts

    Posted

    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";
        }
    
    • 2 months later...
    Posted
     

     

     

    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);
    Posted

     

     

     

     

    You should update the widgets.

    w = getWidgets().getWidgetChild(261, 58); 

    should be

    w = getWidgets().getWidgetChild(261, 60);

    Thanks.

    • 2 weeks later...
    Posted

     

     

    changed to

    w = getWidgets().getWidgetChild(261, 62);

    last update

     

    Thanks <3

    • 2 weeks later...
    Posted

    64 now :P

    I've modified the whole shit to not use the id because it seems to change almost every update... :P

    • 2 weeks later...
    Posted

    I've modified the whole shit to not use the id because it seems to change almost every update... :P

     

    How'd you manage to do that? Mind updating the snippet?

    Posted

    How'd you manage to do that? Mind updating the snippet?

    The code above is updated already.

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.