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
  • GroundItem Looting Messing Up


    Manly

    Recommended Posts

    Posted

    I got this piece of code: https://pastebin.com/N60QPryf

     

    Sometimes it will try to walk to the grace when it doesnt exist anymore, even though I have added checks for it existing.

     

    Code in spoiler:

     

     

     

    if (!getInventory().isFull() || getInventory().contains(Constants.GRACE_ID)) {
    GroundItem gr = getGroundItems().closest(GRACE_FILTER);
    if (gr != null) {
    if (isOnScreen(gr)) {
    if (!getLocalPlayer().isMoving()) {
    EntityDestination ed = new EntityDestination(getClient(), gr);
    InteractionEvent ie = new InteractionEvent(ed);
    if (gr.exists() && ie.interact("Take", InteractionSetting.MOVE)) {
    PaintVar.status = "Picking up mark of grace";
    sleepUntil(() -> !gr.exists(), Calculations.random(900, 1200));
    return 1;
    } else if (gr.exists()) {
    if (getLocalPlayer().distance(gr.getTile()) > 1) {
    if (getWalking().shouldWalk() && getMouse().click(getMap().tileToMiniMap(gr.getTile().getRandomizedTile(1)), false)) {
    /* if (Calculations.random(0, 3) == 2) {
    getCamera().rotateToYaw(Calculations.random(0, 2000));
    }*/
    return Calculations.random(100, 200);
    } else {
    log("cant click on grace: " + gr.getName() + " map.. moving camera + would usually increase error count");
    getCamera().rotateToYaw(Calculations.random(0, 2000));
    //errorCount++;
    return Calculations.random(100, 200);
    }
    } else {
    log("cant click on grace: " + gr.getName() + " map.. moving camera + would usually increase error count");
    getCamera().rotateToYaw(Calculations.random(0, 2000));
    //errorCount++;
    return Calculations.random(400, 500);
    }
    }
    }
    } else {
    if (getWalking().shouldWalk() && gr.exists()) {
    if (getWalking().walk(gr)) {
    PaintVar.status = "Walk to mark of grace";
    return Calculations.random(200, 300);
    }
    }
    }
    return Calculations.random(600, 1000);
    }
    }
    

     

     

    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.