Resolved Web Walking with custom web won't use lodestones.

Discussion in 'Client & Site Support' started by Baddest Man on Earth, Oct 24, 2015.

  1. My custom web walks to every destination, and never uses lodestones. It will walk from Yanille to Varrock instead of using a lodestone.

    Code for adding vertices:
    Code (Text):
    1. public static void addLodestoneVertices() {
    2.     for (Lodestone lodestone: Lodestone.values()) {
    3.         LodestoneVertex vertex = new LodestoneVertex(lodestone);
    4.         Coordinate c = lodestone.getPosition().derive(0, -1);
    5.         WebVertex v = web.getVertexNearestTo(c);
    6.         if (v != null) {
    7.             double dist = Distance.between(c, v.getPosition());
    8.             if (dist < 3) {
    9.                 vertex.addDirectedEdge(v, 25);
    10.                 web.addVertices(vertex);
    11.                 System.out.println("Added: " + lodestone);
    12.                 System.out.println(v.distanceTo(vertex));
    13.             }
    14.         }
    15.     }
    16. }
    System out:
    Code (Text):
    1. (08:28:17) Added: Al Kharid
    2. 1.0
    3. (08:28:17) Added: Ardougne
    4. 1.0
    5. (08:28:17) Added: Burthorpe
    6. 1.0
    7. (08:28:17) Added: Catherby
    8. 1.0
    9. (08:28:17) Added: Draynor Village
    10. 1.0
    11. (08:28:17) Added: Edgeville
    12. 1.0
    13. (08:28:17) Added: Falador
    14. 1.0
    15. (08:28:17) Added: Lumbridge
    16. 1.0
    17. (08:28:17) Added: Port Sarim
    18. 1.0
    19. (08:28:17) Added: Seers Village
    20. 1.0
    21. (08:28:17) Added: Taverley
    22. 1.0
    23. (08:28:17) Added: Varrock
    24. 1.0
    25. (08:28:17) Added: Yanille
    26. 1.0
    27. (08:28:17) Added: Fremennik Province
    28. 1.0
    29. (08:28:17) Added: Ooglog
    30. 1.0
    Walk code:
    Code (Text):
    1. public static boolean webWalk(Locatable destination) {
    2.     if (destination != null) {
    3.         WebVertex player = web.getVertexNearestTo(Players.getLocal());
    4.         WebVertex vertex = web.getVertexNearestTo(destination);
    5.         Path path = web.getPathBuilder().useTeleports(true).build(player, vertex);
    6.         return path != null && path.step();
    7.     }
    8.     return false;
    9. }
    @Cloud
     

Share This Page

Loading...