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
  • Try asking for help in the chatbox
  • WebNode Help


    hooplako
     Share

    Recommended Posts

    Context:

    I was using the Web Tool script to create a web of custom nodes.

    I added the variables:

    WebFinder webFinder

    AbstractWebNode[] webNodes

    as public static variables in my class and assigned the appropriate stuff in the onStart() method.

    I got rid of the "script." part when doing:

    webFinder = script.getWalking().getWebPathFinder();

    in my onStart() method since it was giving me an error there.

    Problem:

    But when I call getWalking().walk(new Tile(number, number, number)) in a private method in main class my character doesn't walk anywhere.

    I checked if it should start walking through getWalking.shouldWalk(); and it's returning true. So idk what is going on.

     

    Link to comment
    Share on other sites

    The webtool should copy the nodes etc into your clipboard once you stop the script. Use that code and add it to something like below

     

    Try this, not sure if it will compile, was done off the top of my head..

    
        private void registerPaths(AbstractScript ctx) {
    
            //the node closest to the entrance to our dungeon (edgeville trapdoor)
            AbstractWebNode node = ctx.getWalking().getWebPathFinder().getNearest(new Tile(3432, 3451), 15);
    
            AbstractWebNode webNode0 = new BasicWebNode(3432, 3451);
            AbstractWebNode webNode1 = new BasicWebNode(3432, 3451);
            AbstractWebNode webNode10 = new BasicWebNode(3419, 3424);
            node.addConnections(webNode1); //Join to node network
            webNode0.addConnections(webNode1); //Add in connections between nodes
            webNode1.addConnections(webNode10);
    
            WebFinder webFinder = ctx.getWalking().getWebPathFinder();
            AbstractWebNode[] webNodes = {webNode0, webNode1, webNode10};
            for (AbstractWebNode webNode : webNodes) {
                webFinder.addWebNode(webNode); //Add into web
            }
    
        }

     

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    ×
    ×
    • 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.