Guest Posted May 28, 2017 Posted May 28, 2017 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
Chris Posted May 28, 2017 Posted May 28, 2017 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.
Guest Posted May 28, 2017 Posted May 28, 2017 (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 May 28, 2017 by Noidlox
Chris Posted May 28, 2017 Posted May 28, 2017 try creating a walk event and setting the minthreshold to 0
Polymorphism Posted May 28, 2017 Posted May 28, 2017 WalkEvent#minimumThreshold(0) or new Position(1 tile over).interact("Walk here") or MiniMapTileDestination(Bot bot, Position position, boolean exactPosition)
Guest Posted May 28, 2017 Posted May 28, 2017 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