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
  • Cipher's guide to using widgets


    Decipher
     Share

    Recommended Posts

    Cipher's Guide on how to use Widgets!

     

     

    Chapter I: Finding widgets

    To interact with a widget, we must first find the widget. There are 2 ways of doing this:

     

    Method 1:  "Widget Hover" Tool (not recommended)

     

     

    To use the widget hover tool, in your client go to Tools tab -> Debugging -> Click on "Tool: Widget Hover". It may take a couple of seconds for it to load, and it looks like this:

    bbe708429d2e0336da11d2810fc5b118.png

    The widget parents and childs (and grandchilds) are shown in the menu on the left. The boxes around the widgets you are hovering indicates which color it has in the menu. We will learn to use these in chapter II.

     

     

     

    Method 2: Debug Tool

     

     

    To open the debug tool, click the Tools tab -> Game Debugger. Once it opens click on the Widgets tab. You should see folders with numbers popping up:

    DX0dDIr.png

    These are the widget parents. To find the widget you want to use, you can look for it by putting in something in one (or both) of the text fields, and hitting refresh. The "text" is usually something like "Ball of Wool" (aka what you can see) and the "action" is something like "Make All" (options that pop up when you right click on something). To expand the folders click the small node next to the folder icon, and select the file(s) to see the widgets information. Example:

    oeuWijs.png

    As you can see, a lot of information pops up. By looking at the Text and Actions you can determine if you found the correct widget.

     

     

     

    Chapter II: Using your widgets

     

    To interact with a widget, we must first check if it exists. If not you will get a null pointer exception, and your script wont work. To do this, simply use this:

    if (getWidgets().getWidget(parent).getChild(child) !=null)
    

    to use grand child, simply add another .getChild(grandchild)

     

    If you want to interact with it:

    //to click the widget:
    getWidgets().getWidget(parent).getChild(child).interact();
    //to click a specific action:
    getWidgets().getWidget(parent).getChild(child).interact("Make X");
    

    Sidenote: if you are using the same widget multiple times, you can make a widgetChild object to save time:

    WidgetChild x = getWidgets().getWidget(parent).getChild(child);
    

    Now you only need to type "x" instead of the full line of code.

     

    A full example:

    WidgetChild x = getWidgets().getWidget(parent).getChild(child);
    if (x !=null){
    x.interact();
    sleepUntil(() -> !getInventory().contains("Wool"), 30000);
    }
    

    Above code will check if the widget exists, and if it does click it and sleep until inventory doesnt contain "Wool", or 30000 milliseconds has passed.

     

    Edited by Decipher
    Link to comment
    Share on other sites

    WidgetChild x = getWidgets().getWidget(parent).getChild(child);
    

    Is the same as

    WidgetChild x = getWidgets().getWidgetChild(parent, child); //Can use as parent, child, child2, child4, etc...
    

    But other than that good tutorial.

    Link to comment
    Share on other sites

    you should check if parent is null before checking if the child is null, otherwise you can get a npe. good stuff anyway

    WidgetChild x = getWidgets().getWidget(parent);
    if (x !=null){
       if (x.getChild(child) != null){
          x.getChild(child).interact();
          sleepUntil(() -> !getInventory().contains("Wool"), 30000);
       }
    }
    
    Edited by Neffarion
    Link to comment
    Share on other sites

    WidgetChild x = getWidgets().getWidget(parent).getChild(child);
    

    Is the same as

    WidgetChild x = getWidgets().getWidgetChild(parent, child); //Can use as parent, child, child2, child4, etc...
    

    But other than that good tutorial.

     

    that's what I use :D

    Link to comment
    Share on other sites

     

    you should check if parent is null before checking if the child is null, otherwise you can get a npe. good stuff anyway

    WidgetChild x = getWidgets().getWidget(parent);
    if (x !=null){
       if (x.getChild(child) != null){
          x.getChild(child).interact();
          sleepUntil(() -> !getInventory().contains("Wool"), 30000);
       }
    }
    

    If you use getWidgetChild there is no need to check if parent is null. See my post above.

    Link to comment
    Share on other sites

    • 2 weeks later...

    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.