yeah apparently no matter how many times i re pasted it the tabs would not show up =[
tabbed version - http://pastebin.com/djSDJb2p
You have to use spaces instead of tabs.
Also the word wrapping can mess things up so, start any new line on a new line to prevent weird word wrapping.
Hope you don't mind here is the code formatted below
public long lastRun = 0;
public Position lastClick = null;
public int randomDistance = 0;
public boolean walkToLocation(Position p) throws InterruptedException
{
int maxY;
int maxX;
boolean revY = false;
boolean revX = false;
Position playerPosition = myPlayer().getPosition();
if(playerPosition.getX() < p.getX())
{
revX = true;
int distance = p.getX()-playerPosition.getX();
if(distance > 17)
{
maxX = 17;
}
else
{
maxX = distance;
}
}
else
{
int distance = playerPosition.getX()-p.getX();
if(distance > 17)
{
maxX = 17;
}
else
{
maxX = distance;
}
}
if(playerPosition.getY() < p.getY())
{
revY = true;
int distance = p.getY()-playerPosition.getY();
if(distance > 17)
{
maxY = 17;
}
else
{
maxY = distance;
}
}
else
{
int distance = playerPosition.getY()-p.getY();
if(distance > 17)
{
maxY = 17;
}
else
{
maxY = distance;
}
}
int addX = (int) (10+(Math.random()*(maxX-10)));
int addY = (int) (10+(Math.random()*(maxY-10)));
if(maxX < 10)
{
addX = maxX;
}
if(maxY < 10)
{
addY = maxY;
}
if(!revX)
{
addX = addX*-1;
}
if(!revY)
{
addY = addY*-1;
}
if(lastClick == null)
{
if(walk(new Position(playerPosition.getX()+addX, playerPosition.getY()+addY, playerPosition.getZ())))
{
lastClick = new Position(playerPosition.getX()+addX, playerPosition.getY()+addY, playerPosition.getZ());
randomDistance = (int) (3+(Math.random() * 3));
}
}
else
{
if(lastClick.distance(myPlayer().getPosition()) < randomDistance)
{
if(walk(new Position(playerPosition.getX()+addX, playerPosition.getY()+addY, playerPosition.getZ())))
{
lastClick = new Position(playerPosition.getX()+addX, playerPosition.getY()+addY, playerPosition.getZ());
randomDistance = (int) (3+(Math.random() * 3));
}
}
}
if(lastClick.distance(p) < 5)
{
lastClick = null;
return true;
}
return false;
}