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
  • Walking problem


    Suola

    Recommended Posts

    Sorry, misread your post. 

    I tested it out and this code seems to work for what you need.

    if(getWalking().shouldWalk(5)){
    	getWalking().walk(getWalking().getWebPathFinder().get(3512).getTile());
    }

    The only thing I can think as to why it won't work is you are trying to use a random tile which may be in the water or something that it can't reach. But this will just get the tile for the web node and walk to it, or you could manually set a tile there.

    Link to comment
    Share on other sites

    Add local nodes to the webwalker like so:

    public static CustomWebPath path = new CustomWebPath(
                new Tile(3007, 9549, 0),
                new Tile(2997, 9548, 0),
                new Tile(2994, 9555, 0),
                new Tile(2994, 9564, 0),
                new Tile(2998, 9572, 0),
                new Tile(3002, 9579, 0)
    );
    
    log ("Adding custom web path to Dreambot's webwalker...");
    getWalking().getWebPathFinder().addCustomWebPath(path);
    log ("Done!");

     

    Link to comment
    Share on other sites

    On 7/13/2018 at 4:50 PM, Suola said:

    So the question is: Why my player doesnt continue walking to destination but it stops at seagulls?

    https://pastebin.com/VUwPFYhK

    So I try to get from lumbridge to port sarim docks but last part isnt supported to webwalk so I have to divide the trip into two parts. 

     https://gyazo.com/3f0561ddc71b1f633a9a72559d8e85c0

    Quote

    Why my player doesnt continue walking to destination but it stops at seagulls?

    First off, if the player starts in Lumbridge he will never leave Lumbridge because of the first if-statement which does nothing.

    Also this piece of code:

    if(SEAGULLS.contains(getLocalPlayer())) {
                    getWalking().walk(DOCKS.getRandomTile());
                    sleep(Calculations.random(900, 1200));
                }
                else {
                    getWalking().walk(SEAGULLS.getRandomTile());
                    sleep(Calculations.random(900, 1200));
                }
            }

    It will make your player walk back to SEAGULLS as soon as he leaves the area.

    BTW: for the sleep event to actually work in this example it should come before the walking.

    Goodluck!

    Link to comment
    Share on other sites

    On 7/18/2018 at 4:59 PM, Snout said:

    First off, if the player starts in Lumbridge he will never leave Lumbridge because of the first if-statement which does nothing.

    Also this piece of code:

    
    if(SEAGULLS.contains(getLocalPlayer())) {
                    getWalking().walk(DOCKS.getRandomTile());
                    sleep(Calculations.random(900, 1200));
                }
                else {
                    getWalking().walk(SEAGULLS.getRandomTile());
                    sleep(Calculations.random(900, 1200));
                }
            }

    It will make your player walk back to SEAGULLS as soon as he leaves the area.

    BTW: for the sleep event to actually work in this example it should come before the walking.

    Goodluck!

    So how can I make it like: When I reach Seagulls -> walk to docks then o_o

    Link to comment
    Share on other sites

    16 minutes ago, Suola said:

    So how can I make it like: When I reach Seagulls -> walk to docks then o_o

    The code you quoted shows a rough version of doing just that. The first part of the if statement is checking if the player is within the seagull area, and if they are its then making the player walk to the dock area (to a random tile in the dock area). The else statement is saying if the player is not within the seagull area the walk to the seagull area. The problem here is that when it gets to the seagull area and then tries to walk to the dock area, as soon as it leaves the seagull area then the next time this code is run it will try to go back to the seagull area. 

    Link to comment
    Share on other sites

    7 minutes ago, distraction said:

    The code you quoted does it. The first part of the if statement says if the seagull area contains the player then walk to the docks area. That code isn't great though. It sounds like you should try to finish some more tutorials before trying to write your own script. You would have a much easier time if you did that.

    ... , Cant find any tutorials about walking to one point first and then another - thats why tried to ask help but I guess can't get it here :D 

    Link to comment
    Share on other sites

    7 minutes ago, Suola said:

    ... , Cant find any tutorials about walking to one point first and then another - thats why tried to ask help but I guess can't get it here :D 

    My point was that you have what you need in the examples that you have been given. If you can't take the example and turn it into what you need, then its likely that you are lacking the level of understanding of basic programming that is needed to write a script. There is a difference between getting help and being spoon fed. I'm not trying to insult you. I'm just trying to help you to have an easier time with scripting. Its going to be very frustrating to try and write a script if you lack the basic knowledge needed to do it. You would have a much better time if you learned the basics before going at it, thats all.

    The only problem with the example code given here was explained by the guy above your previous post. The problem is that as soon as the player leaves the seagull area it will attempt to walk back to that area. There are various ways to handle this problem. One way would be to set a boolean value to check if the player has already been within the seagull area, and if so then not walk to it again until they arrive at whatever the final destination is. That isn't the best way to do it, but its probably the easiest way for you to do it at your skill level.

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

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