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
  • Try asking for help in the chatbox
  • bot keeps on eating tomatoes instead of using them


    krypt1c
     Share

    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

    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
     Share

    ×
    ×
    • 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.