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 threw an error | Can't pick up bones?


    krypt1c

    Recommended Posts

     public void bonesObject() {
            GameObject bones = GameObjects.closest(gameObject -> gameObject != null && gameObject.getName().equals("Bones"));
            if(chickenLocation.contains(getLocalPlayer())) {
                if(bones.interact("Take")) {
                    sleepUntil(() -> Inventory.contains("Bones"), 2000);
                    if(Inventory.contains("Bones")) {
                        Inventory.interact("Bones", "Bury");
                        sleepUntil(() -> !Inventory.contains("Bones"), 5000);
                    }
                }
            } else if(!chickenLocation.contains(getLocalPlayer())) {
                if(new Walking().walk(chickenLocation.getCenter())) {
                    sleep(Calculations.random(1000, 3000));
                }
            }
        }

    Either I'm an idiot, or I don't understand something. The method above should interact with the closest bones by picking them up and burying them if they are in the player's inventory.

    I honestly have no idea why its giving me an error in dreambot's console.
    If anyone could help me out, I would really appreciate it

    thanks!

    Link to comment
    Share on other sites

    7 hours ago, TheCloakdOne said:

    if there are no bones in the area bones will == null, you cant interact on null so it throws NPE

    But it throws an error even though that there are bones in the area

    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.