Jump to content

i need one more thing help with script


Recommended Posts

Posted (edited)

As you really didn't specify where you want it to walk, I needed to get creative, there might be a better way to do this, but it should work.

if(myPlayer().getPosition().getY() > 3678){
    ArrayList<Position> closestTile = new ArrayList<Position>();
    if(closestTile.size() <= 383){
        for(int i = 0; i <= 383; i++){
            closestTile.add(new Position(3678, 2946 + i, 0));
        }
    }else{
        closestTile.sort(new Comparator<Position>() {
            public int compare(Position entry1, Position entry2) {
                return entry1.distance(myPlayer()) - entry2.distance(myPlayer());
            }
        });
        getWalking().webWalk(closestTile.get(0));
    }
}else{
    //do tele
}
Edited by Vilius
Posted

 

As you really didn't specify where you want it to walk, I needed to get creative, there might be a better way to do this, but it should work.

if(myPlayer().getPosition().getY() > 3678){
    ArrayList<Position> closestTile = new ArrayList<Position>();
    if(closestTile.size() <= 383){
        for(int i = 0; i <= 383; i++){
            closestTile.add(new Position(3678, 2946 + i, 0));
        }
    }else{
        closestTile.sort(new Comparator<Position>() {
            public int compare(Position entry1, Position entry2) {
                return entry1.distance(myPlayer()) - entry2.distance(myPlayer());
            }
        });
        getWalking().webWalk(closestTile.get(0));
    }
}else{
    //do tele
}

 

if(map.getWildernessLevel() > 20) {

      getWalking().walk(new Position(myPosition().getX(), myPosition().getY() - 5, myPosition.getZ());

}

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...