Jump to content

How To Smelt Bars


cheavyrun
 Share

Recommended Posts

RS2Object furnace = objects.closest("Furnace");

RS2Widget options = widgets.get(311, 8);

furnace.interact("Smelt");

if (options != null) {

mouse.click(random(290, 325), random(393, 420), true);

sleep(random(1000, 1500));

menu.selectAction("Smelt X Gold");

sleep(random(1000,1500);

keyboard.typeString("" + random(29, 99), true);

}

Should be something like this.

Add an extra null check on the keyboard type string.

Link to comment
Share on other sites

RS2Object furnace = objects.closest("Furnace");

RS2Widget options = widgets.get(311, 8);

furnace.interact("Smelt");

if (options != null) {

mouse.click(random(290, 325), random(393, 420), true);

sleep(random(1000, 1500));

menu.selectAction("Smelt X Gold");

sleep(random(1000,1500);

keyboard.typeString("" + random(29, 99), true);

}

Should be something like this.

Add an extra null check on the keyboard type string.

 

Thank´s for your help. By the way nice profile pic.wink.png

 

Link to comment
Share on other sites

Oh that works, thank´s a lot for your helpwink.png.

 

If you want to smelt a specific quantity you can do something like:

// Select smelt X option for Bronze
getWidgets().getWidgetContainingText("Bronze").interact("Smelt X Bronze");
        
// Sleep until the widget "Enter amount:" is visible (or for 5 seconds)
new ConditionalSleep(5000) {
    @Override
    public boolean condition() throws InterruptedException {

        RS2Widget amountWidget = getWidgets().get(162, 32);
        return amountWidget != null && amountWidget.isVisible();
    }
}.sleep();

// Check that the widget is visible, if it is type the number 23 and enter
RS2Widget amountWidget = getWidgets().get(162, 33);
if(amountWidget != null && amountWidget.isVisible()) getKeyboard().typeString("23");
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.

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.

 Share

  • Recently Browsing   0 members

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