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
  • Script not eating


    veeniqqa

    Recommended Posts

    Hey guys I'm pretty stuck I've tried loads of different ways and each time I can't seem to get my script to eat.

    if (getCombat().getHealthPercent() <= Calculations.random(12, 37)) {
                            log("IT detects its low");
                            eat();
    

    So it detects the above and notices it's low, but it doesn't eat

        private void eat(){
            food = getInventory().get(item -> item != null && item.hasAction("Eat"));
            if (food != null && food.interact("Eat")) {
                log("Trying to eat");
                sleep(Calculations.random(350,650));
            }else{
                if(getInventory().isFull()){
                    state = 3;
                }else if(getCombat().getHealthPercent() <= Calculations.random(12, 37)){
                    state = 3;
                }
            }
        }
    

    I'm not sure where i've gone wrong, any help would be great<3

    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.