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
  • So what's the correct way to walk?


    krock

    Recommended Posts

    I'm just beginning my scripting journey here using DreamBot's API. Been coding for a while in other languages though.

    Searched around a lot and I really see so many different ways people walk.

    I wrote a simply Runecrafting script and this is how my walking logic went

    public int execute() {
    
          if (FireRuinsArea.contains(getLocalPlayer().getTile())) {
             getCamera().rotateToEntity(getGameObjects().closest("Mysterious ruins"));
             getGameObjects().closest("Mysterious ruins").interact("Enter");
             sleepUntil(() -> FireRuinsArea.contains(getLocalPlayer().getTile()), Calculations.random(2000, 2500));
          }
          else {
             if (FireAltarArea.contains(getLocalPlayer().getTile())) {
                if(getInventory().isFull()) {
                   getGameObjects().closest("Altar").interact("Craft-rune");
                   sleepUntil(() -> getLocalPlayer().isAnimating(), Calculations.random(2000, 2500));
                } else {
                   getGameObjects().closest("Portal").interact("Use");
                   sleepUntil(() -> FireRuinsArea.contains(getLocalPlayer().getTile()), Calculations.random(2000, 2500));
                }
             } else {
                getWalking().walk(FireRuinsArea.getRandomTile());
                sleepUntil(() -> FireRuinsArea.contains(getLocalPlayer().getTile()), Calculations.random(2000, 2500));
             }
          }
    
          return Calculations.random(900,2500);
       }

    So... this worked for me and is pretty stable. However, I always see posts regarding how amazing the webwalking capabilities are, but I just can't seem to implement it correctly.

     

    I'm working on a simple chaos druids (edgeville dungeons) script that will bank/fight/loot etc...

    I'm having real trouble using webwalking, and not because of the obstacles (trapdoor, gate, etc.). It simply just doesn't walk for me correctly.

    I am looking for a definitive usage on getWalking().walk() so I can stop fucking around with so much walking code that doesn't work.

    I want someone to tell me why this code doesn't work? Shouldn't just automatically walk to the destination? Or am i misunderstanding the capabilities of the web walker?

     Tile t = areaDruids.getRandomTile();
          getWalking().walk(t);
          if (!sleepUntil(() -> areaDruids.contains(getLocalPlayer().getTile()), Calculations.random(2000, 2500))) {
             getWalking().walk(t);
          }

    I have other code that interacts with all the obstacles (trapdoor, gate, etc...) but shouldn't this _just_ work, no?
     

    Link to comment
    Share on other sites

    Also, am I using sleepUntil() correctly in either the 1st or 2nd snippet? I really just want to know how to walk correctly lol...

    Link to comment
    Share on other sites

    This is how I have done it and it seems to work okay.

    while (!AREA.contains(getLocalPlayer())) {
    	getWalking().walk(AREA.getRandomTile());
    	sleepUntil(() -> !getLocalPlayer().isMoving(), 5200);
    } 

     

    Link to comment
    Share on other sites

    1 hour ago, Milasoft said:

    This is how I have done it and it seems to work okay.

    
    while (!AREA.contains(getLocalPlayer())) {
    	getWalking().walk(AREA.getRandomTile());
    	sleepUntil(() -> !getLocalPlayer().isMoving(), 5200);
    } 

    Yeah this only works after I am halfway to the druids. After the trapdoor, and past the 1st gate. Hmm. Thanks

     

    Link to comment
    Share on other sites

    The webwalker doesn't work in certain areas of the map since they don't have nodes. This is also the case for the Edgeville dungeon. You have to create your own nodes if you want to use the webwalker in the dungeon. You can achieve this easily by using Hoodz' WebTool: 

     

    Link to comment
    Share on other sites

    1 hour ago, Nex said:
    
    if (getWalking().shouldWalk(int tiles before endgoal to click again) {
    	getWalking().walk(destination);
    }

    Nex -- when using this technique, the script will not wait until it has reached the tile to keep walking. It doesn't reach the destination and immediately skips to the next statements. This is after a single click when the target distance is still far away and the tiles before endgoal = 4.

     

    Link to comment
    Share on other sites

    3 minutes ago, krock said:

     

    if u want it to wait till it reached its destination leave the int blank, if thats what u mean

    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.