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
  • Try asking for help in the chatbox
  • ESC enabler


    Hashtag
     Share

    Recommended Posts

    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

    • 2 months later...
     

     

     

    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

     

     

     

     

    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

    • 2 weeks later...
    • 2 weeks later...
    • 2 weeks later...

    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?

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    ×
    ×
    • 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.