JanDeBruin 11 Share Posted February 25, 2015 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? Link to comment Share on other sites More sharing options...
SpareGold 4 Share Posted February 25, 2015 (edited) 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. Edited February 25, 2015 by SpareGold Link to comment Share on other sites More sharing options...
Notorious 341 Share Posted February 25, 2015 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! JanDeBruin and Zenarchist 2 Link to comment Share on other sites More sharing options...
SpareGold 4 Share Posted February 27, 2015 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 More sharing options...
Kristoffer 23 Share Posted February 28, 2015 What is methodContext? It's an instance of the MethodContext class. Link to comment Share on other sites More sharing options...
Nuclear Nezz 1993 Share Posted February 28, 2015 Which you can get by doing getClient().getMethodContext(); Link to comment Share on other sites More sharing options...
Notorious 341 Share Posted February 28, 2015 Which you can get by doing getClient().getMethodContext(); Don't listen to Nezz, he rides the short bus. AbstractScript extends MethodContext, meaning if your inside of your Script class you could just : new LocalPath(this); Vlad, JanDeBruin and Nuclear Nezz 3 Link to comment Share on other sites More sharing options...
Nuclear Nezz 1993 Share Posted February 28, 2015 Don't listen to Nezz, he rides the short bus. 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 Notorious and Dogerina 2 Link to comment Share on other sites More sharing options...
Fran 99 Share Posted March 1, 2015 (edited) @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 Edited March 1, 2015 by Franjey Link to comment Share on other sites More sharing options...
Recommended Posts