Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Resolved Local web won't use Lodestones

Joined
Nov 26, 2014
Messages
616
Code:
Code:
private void addLodestoneVertices(Web web) {
        for (Lodestone lodestone : Lodestone.values()) {
            LodestoneVertex vertex = new LodestoneVertex(lodestone);
            Coordinate c = lodestone.getPosition().derive(0, -1);
            WebVertex v = web.getVertexNearestTo(c);
            if (v != null) {
                double dist = Distance.between(c, v.getPosition());
                if (dist < 3) {
                    double cost = 25 / dist;
                    vertex.addDirectedEdge(v, cost);
                    web.addVertices(vertex);
                    System.out.println("Added: " + lodestone);
                    System.out.println(v.distanceTo(vertex));
                }
            }
        }
    }

Output:
Code:
(11:11:59) Added: Falador
1.0
(11:11:59) Added: Lumbridge
1.0
(11:11:59) Added: Port Sarim
1.0
(11:11:59) Added: Varrock
1.0

The bot will walk just fine to wherever I want it to, but even if I'm in Lumbridge, it will walk all the way to Varrock instead of using the lodestone. I rendered the web, and the LodestoneVertex show up as added.
 
Top