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
  • bot keeps on eating tomatoes instead of using them


    krypt1c

    Recommended Posts

    public void makeUncookedPizza() {
        if (Inventory.interact("Tomato", "Use")) {
            sleep(Calculations.random(5000, 10000));
            if (Inventory.slotInteract(1, "Use")) {
                sleep(Calculations.random(5000, 10000));
                Keyboard.type(" ");
                sleep(Calculations.random(10000, 15000));
                if (Inventory.interact("Cheese", "Use")) {
                    sleep(Calculations.random(5000, 10000));
                    if (Inventory.slotInteract(1, "Use")) {
                        sleep(Calculations.random(5000, 10000));
                        Keyboard.type(" ");
                        sleep(Calculations.random(10000, 15000));
                    }
                }
            }
        }
    }

    Title says pretty much all, sometimes the bot will eat the tomato instead of using it.
    I assume its because either the "Use" is really close to the "Eat" interaction, or the bot is going too fast.

    Is there anyway to make it so the bot doesn't eat the tomato? been driving me crazy lol

    Link to comment
    Share on other sites

    2 hours ago, Hashtag said:

    There is no "Use" action on items. You need to use Item#useOn

    what do you mean by there is no "Use" action on items?
    image.png.1e54e92bd4995ac9e033e6b5d5506a2c.png

    Link to comment
    Share on other sites

    if(Inventory.get("Tomato").useOn(Inventory.get("Cheese")))
    {
    	sleepUntil(() -> Widgets.getWidgetChild(0,0) != null && Widgets.getWidgetChild(0,0).isVisible(), Calculations.random(2000, 5000));
    }

    Replace the zeros with the correct widgets for the make all interface and handle the wait for making the rest. I'd recommend looking into onItemChange function from the Inventorylistener class if it's not depreciated. I haven't scripted since DB2 lol

    Link to comment
    Share on other sites

    2 hours ago, NovaGTX said:
    
    if(Inventory.get("Tomato").useOn(Inventory.get("Cheese")))
    {
    	sleepUntil(() -> Widgets.getWidgetChild(0,0) != null && Widgets.getWidgetChild(0,0).isVisible(), Calculations.random(2000, 5000));
    }

    Replace the zeros with the correct widgets for the make all interface and handle the wait for making the rest. I'd recommend looking into onItemChange function from the Inventorylistener class if it's not depreciated. I haven't scripted since DB2 lol

    Gotcha, thanks man

    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.