- Joined
- Jan 29, 2016
- Messages
- 1,294
- Thread Author
- #1
I've noticed alot of people having issues with their bots recently and I thought I would share this to assist new developers coming into the scene.
Tutorial - Tutorial - Understanding Runemate's Pathing Systems, and Utilizing Them DON'T USE THIS
When you're making a webPath you would usually do something like
You should ideally be using this kind of format.
If you're wanting to use it for Landmarks, you can change this to this format
To call the path, you would now do
Tutorial - Tutorial - Understanding Runemate's Pathing Systems, and Utilizing Them DON'T USE THIS
When you're making a webPath you would usually do something like
Code:
WebPath path = WebPathRequest.builder().setDestination(x).build();
if (path != null) { path.step(true);
You should ideally be using this kind of format.
Code:
private static final Map<String, WebPath> pathCache = new HashMap<>();
public static WebPath getPathDestination(Locatable destination, boolean usingTeleports) {
String key = destination.toString() + usingTeleports;
WebPath cachedPath = pathCache.get(key);
if (cachedPath == null) {
cachedPath = WebPathRequest.builder()
.setDestination(destination)
.setUsingTeleports(usingTeleports)
.build();
pathCache.put(key, cachedPath);
}
return cachedPath;
}
If you're wanting to use it for Landmarks, you can change this to this format
Code:
public static WebPath getPathLandmark(Landmark landmark, boolean usingTeleports) {
String key = landmark.toString() + usingTeleports;
WebPath cachedPath = pathCache.get(key);
if (cachedPath == null) {
cachedPath = WebPathRequest.builder()
.setLandmark(landmark)
.setUsingTeleports(usingTeleports)
.build();
pathCache.put(key, cachedPath);
}
return cachedPath;
}
To call the path, you would now do
Code:
WebPath path = getPathDestination(X,Y,Z, true/false);
Last edited: