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 interacting with GroundItem


    Pelli

    Recommended Posts

    Posted
        public void marksPicker() {
            GroundItem mark = getGroundItems().closest("Mark of grace");
            if ( mark != null) {
                if (getLocalPlayer().distance(mark) < 7) {
                    mark.interact("Take");
                    sleepUntil(()-> getGroundItems().closest("Mark of grace")==null,3789);
                } else {
                    log("No marks here/ marks are to far!");
                }
            }
        }

    The script just keeps running past the mark of grace, it does know that the item is nearby (because there's no log message).


    The script doesnt pause at all to pick it up, so i'm guessing that:

    ()-> getGroundItems().closest("Mark of grace")==null

    somehow returns true even though the mark of grace is still there. Are there any known issues with getGroundItems( )?

    Cheers

    Posted

    Some suggestions to make possible debugging easier.

    1. make your method a boolean, and return true if the mark is picked up (!mark.exists, or inventory.count("Mark of grace") is higher than before attempt)
    2. use an if statement on the if(mark.take) before your sleep until, you don't want to be stuck sleeping for 3.7 seconds if it fails to interact.

    Otherwise, there's no known issues with ground items that I'm aware of. If you're doing

    marksPicker();

    walk next obstacle;

    without actually checking or re-trying to pick it up, then yeah you'll likely not get many of them.

    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.