Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Furnace crafting widget

Featured Replies

Hello guys, I'm currently trying to code a script to craft gold necklace at a furnace and need some help. The problem is that my script can't seem to get a hold of the gold necklace widget.

Here's the code.

 

    private int goldBarID = 2357;
    private int goldNecklaceID = 1654;

    RS2Widget furnaceCraftWidget = getWidgets().singleFilter(446 , rs2Widget -> rs2Widget != null && rs2Widget.getItemId() == goldNecklaceID);
    if (furnaceCraftWidget != null)
    {
      log("test");
    }
    if (furnaceCraftWidget != null && furnaceCraftWidget.interact("Make"))
    {
      log("it works");
      new ConditionalSleep(90000)
      {
        @Override
        public boolean condition()
      {
          return !inventory.contains(goldBarID) || getDialogues().isPendingContinuation();
        }
      }.sleep();
    }

At first I thought it might be the interact method that didn't work so I added the first test to check if I could get a hold of any widget at all but still nothing prints to the logger.

The other thing I tried is using this instead of the singleFilter function

RS2Widget furnaceCraftWidget = getWidgets().get(446, 22);

But even by using childID i couldn't get a hold of the right widget. Only "test" printed in the logger, but the script didn't interact to craft gold necklaces. When I tried this I also got this error with many more all related to awt and swing which I am not using.

Unless it's the in game interface that is using awt and swing?

ERROR][06/02 05:19:55 PM]: Uncaught exception!
java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location

I tried searching on the forum and couldn't find anything to understand what I'm doing wrong. Thanks for the help guys.

 

If you use the widget debugger, you'll find it's child ID 23 not 22

l6pD8Ma.png

  • Author

Wow I didn't know that debugger existed thanks a lot. I tried 23 also and it only printed "test", but the debugger listed the action as "Make Gold necklace" and not just "Make" like I initially thought so changing this fixed it. I'll figure something so I don't have to hard code all the values though. Thanks 

  • Author
3 hours ago, Czar said:

Slightly unrelated but a quick tip: you could optionally do myWidget.interact(); and give no parameters to select the first option that it has, can help in some situations :doge: 

Thanks I'll keep that in mind, it could be a potential fix for some things later on haha.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.