Jump to content

How do I walk one tile over?


Recommended Posts

Posted

What I want to do is get the current position of the player, and then walk one 'x' tile over:

 

int x = myPlayer().getPosition().getX() + 1;

int y = myPlayer().getPosition().getY();

int z = myPlayer().getPosition().getZ();

WalkingEvent newPosition = new WalkingEvent(new Position(x, y, z);

execute(newPosition); 

 

AND, it doesn't work... It's as if it skips over this line of code

Posted

getwalking.walk(myPosition().translate(0, 2,));

 

translate
public Position translate(int x,
                          int y)
Creates a cloned instance of this position with the given translation.
Parameters:
x - The x value to translate.
y - The y value to translate.
Returns:
The new position object.

 

Posted (edited)
13 minutes ago, Chris said:

getwalking.walk(myPosition().translate(0, 2,));

 


translate
public Position translate(int x,
                          int y)
Creates a cloned instance of this position with the given translation.
Parameters:
x - The x value to translate.
y - The y value to translate.
Returns:
The new position object.

 

I just tried it and the bot still does nothing...

[So I'm trying to get the bot to move a tile over if it can't light a fire on a plant or another fire. I've already incorporated a message listener for "You can't light...". The message listener works fine and the method gets executed but it doesn't walk to the next 'x' tile.]

Edited by Noidlox
Posted
2 hours ago, Polymorphism said:

WalkEvent#minimumThreshold(0)

or

new Position(1 tile over).interact("Walk here")

or

 MiniMapTileDestination(Bot bot, Position position, boolean exactPosition) 

That did the trick!

Tysm dude :)

3 hours ago, Chris said:

try creating a walk event and setting the minthreshold to 0

I'll try this for fun when I get time. TY

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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