Jump to content

How To Smelt Bars


Recommended Posts

Posted

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.

Posted

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

 

Posted

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");

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
  • Recently Browsing   0 members

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