Jump to content

Welcome to DreamBot!

Download for Free

Supercharge Your Bots

Run unlimited bots today using DreamBot's Covert Mode and
stay more protected.

Upgrade Now
Frequently Asked Questions
  • Are you not able to open the client? Make sure you have Java 8 installed
  • 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 gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
OSRS Gambling

Interested in advertising your business? Reach out today!

Download the DreamBot client today!
Decipher

Cipher's guide to using widgets

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...