Skip to content
Discussion options

You must be logged in to vote

Just add a check in the code:

float x;
float y;
float z;

z=math.floor(player.getZ());
string dir;
dir=player.getDirection();

if (dir != "west" && dir != "east") {
    ui.systemMessage("Direction was " + dir);
    return;
}

keys.left.setDown(true);
while (true) {
    if (dir == "west" && math.floor(player.getZ()) >= z + 1) {
        break;
    } else if (dir == "east" && math.floor(player.getZ()) <= z - 1) {
        break;
    }

    await delay.ticks(1);
}
keys.left.setDown(false);

I don't know what else it can be. It works fine for me. Unless I look close to diagonal, and rotate the camera when script starts working. Then yes, it can go indefinitely to the left, but this left becomes …

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Andy718811
Comment options

@Andy718811
Comment options

@Andy718811
Comment options

@Zergatul
Comment options

Answer selected by Andy718811
@Andy718811
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants