Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Local path.


    JanDeBruin

    Recommended Posts

    http://dreambot.org/forums/index.php?/topic/1171-general-walkingpathing/

     

     

    That's a link to a question I asked about walking a few days ago. I don't think localPath is being used much anymore, as the web walker is fairly smart. I use the web walker by walking to the next tile based on my current location:

     

    EX:

     

     

    if(getLocalPlayer().getTile().getY() > 3296 && getLocalPlayer().getTile().getX() < 3192 )

    {

    getWalking().walk(new Tile(3191, 3291));

    }

    else if(getLocalPlayer().getTile().getX()<3213 && getLocalPlayer().getTile().getY()>3282)

    {

    getWalking().walk(new Tile(3200, 3279));

    }

    else if(getLocalPlayer().getTile().getX() < 3216 && getLocalPlayer().getTile().getY() > 3272)

    {

    getWalking().walk(new Tile(3215, 3270));

    }

     

     

     

    And this allows me to use the webwalker in a more detailed and specific way.

     

    It is also capeable of going large distances (Lumbridge to port sarim) on its own in a single getWalking.walk(destinationTile) call if the exact pathing does not matter much.

    Link to comment
    Share on other sites

    I made a local path tile:

    			Tile[] tile = new Tile[]{new Tile(3045, 3235), new Tile(3050, 3246), new Tile(3054, 3250), new Tile(3059, 3253)};
    

    But how can I traverse this tile?

     

    Like SpareGold said above you can usually you getWalking().walk(), though for some areas of the map it does have issues, and paths may be a better choice depending on your situation.

     

    If you would like to still use a path, you can use LocalPath, which would like something similar to this:

    LocalPath path = LocalPath(methodContext); 
    //Next update there will be path.addAll(Tile...), so you can directly add the array, but for now we can use.
    path.addAll(Arrays.asList(tilePath));
    //Now to set which direction to walk we can use (Default is forward, so this is unneeded)
    setDirection(PathDirection.FORWARD) 
    
    //Finally to take a step in the path we call walk(); to walk the whole path, walk() must be called for each step, allowing you to control its rate
    path.walk();
    

    I hope this clarifies the LocalPath class a bit! :)

    Link to comment
    Share on other sites

    Like SpareGold said above you can usually you getWalking().walk(), though for some areas of the map it does have issues, and paths may be a better choice depending on your situation.

     

    If you would like to still use a path, you can use LocalPath, which would like something similar to this:

    LocalPath path = LocalPath(methodContext); 
    //Next update there will be path.addAll(Tile...), so you can directly add the array, but for now we can use.
    path.addAll(Arrays.asList(tilePath));
    //Now to set which direction to walk we can use (Default is forward, so this is unneeded)
    setDirection(PathDirection.FORWARD) 
    
    //Finally to take a step in the path we call walk(); to walk the whole path, walk() must be called for each step, allowing you to control its rate
    path.walk();
    

    I hope this clarifies the LocalPath class a bit! :)

    What is methodContext?

    Link to comment
    Share on other sites

    Which you can get by doing

    getClient().getMethodContext(); :)

     

    Don't listen to Nezz, he rides the short bus. :P

     

    AbstractScript extends MethodContext, meaning if your inside of your Script class you could just :

    new LocalPath(this);

    Link to comment
    Share on other sites

    Don't listen to Nezz, he rides the short bus. :P

     

    AbstractScript extends MethodContext, meaning if your inside of your Script class you could just :

    new LocalPath(this);

    o ya you could do that too

    if you're a jew like noto

    Link to comment
    Share on other sites

    @Notorious

    Noto, what could be a good & efficient method in the API to tell the script like:

    If player is standing on certain object (i.e: A fire), then move to this other Tile  ?

     

    E: Please check... Tile system isn't working properly. I define a tile and it goes for another

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.