Jump to content

Furnace crafting widget


Teamwork

Recommended Posts

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.

 

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...