Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • 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/Crypto gold? You can purchase vouchers from other users
  • How to correctly wait until actions have happend?


    jordyownn

    Recommended Posts

    if(FurnaceArea.contains(getLocalPlayer())){
                GameObject Furnace = getGameObjects().closest("Furnace");
    
                if (Furnace != null) {
                    sleepUntil(() -> getInventory().get("Bucket of sand").useOn(Furnace), 10000);
    
    
                    WidgetChild child = getWidgets().getWidgetChildrenContainingText("Molten glass").get(0);
                    if (child.isVisible() && child != null) {
                        child.interact("Make All");
                    }
    
                }
    
            } else {
                if (getWalking().walk(FurnaceArea.getCenter())) {
                    sleep(Calculations.random(3000,6000));
                }
            }
    

    Hi,

     

    I am a new scripter, this is my first script.

    I'm experiecing some problems correctly waiting untill things have happend.

     

    I am standing at the Furnace with the correct supplies in my inventory.

     

    I use the Bucket of sand on the furnace, but the script automaticly spams this action, how do i make the script verify that that action is correctly executed? And then ofcourse not do that same action again!

     

    Next, how do i check that the Furnace interaction bar is visible i tried checking if child.isVisible() but this doesn't seem to work properly.

     

     

    Thanks in advance,

     

    Jordy

     

    Link to comment
    Share on other sites

    You should use sleep while your inventory has bucket of sand. For example:

            if (child.isVisible() && child != null) {
                if (child.interact("Make All")) {
                    sleepWhile( () -> getInventory().contains("Bucket of sand"), Calculations.random(35000, 40000));
                }
            }
    
    Link to comment
    Share on other sites

    You also might want to sleep until you are in dialogue (I assume making molten glass gives exp) to avoid the script waiting for dozens of seconds in the level up screen.

    Link to comment
    Share on other sites

    You also might want to sleep until you are in dialogue (I assume making molten glass gives exp) to avoid the script waiting for dozens of seconds in the level up screen.

    this

    Link to comment
    Share on other sites

     

    You should use sleep while your inventory has bucket of sand. For example:

            if (child.isVisible() && child != null) {
                if (child.interact("Make All")) {
                    sleepWhile( () -> getInventory().contains("Bucket of sand"), Calculations.random(35000, 40000));
                }
            }
    

    you forgot the exclamation mark in the sleepWhile() method.

    Link to comment
    Share on other sites

    you forgot the exclamation mark in the sleepWhile() method.

    I believe it sleeps while condition is true. It it were sleepUntil() then the mark would be needed.

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.