Jump to content

path walking


Recommended Posts

Posted

does anyone have a smooth path walking system for OSB2 that they would like to share with the community to become common use for all scripts. I had one for my rcer in osb1 but doesnt work very well in the new client.

 

flames & abuse from people shall be reported ;)

Posted (edited)

Why is this so commonly asked for?

 

It's really simple:

public void walkPath(Position[] path) throws InterruptedException {
    for (Position p : path) {
        if (myPosition().distance(p) > 16 || myPosition().distance(p) < 3) continue;
        boolean success;
        do {
            success = walkTile(p);
        } while (!success);
    }
}

public boolean walkTile(Position p) throws InterruptedException {
    if (myPosition().distance(p) > 13) {
        Position pos = new Position(((p.getX() + myPosition().getX()) / 2) + random(-3, 3),
                ((p.getY() + myPosition().getY()) / 2) + random(-3, 3),
                myPosition().getZ());
        walkTile(pos);
    }
    mouse.click(new MiniMapTileDestination(bot, p), false);
    int fail = 0;
    while (myPosition().distance(p) > 2 && fail < 10) {
        sleep(500);
        if (!myPlayer().isMoving())
            fail++;
    }
    return fail != 10;
}
Edited by Pandemic
  • Like 1
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...