Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

localWalker.walkPath not working properly

Featured Replies

Hey,

So I'm writing a script and I tried using the osbot's local walker to walk a path but it always keeps spam clicking the first tile and doesn't walk any further. Is somebody else having this problem or is the local walker working fine for you?

thanks in advance :)

Just use a custom walker for now

  • Author

Just use a custom walker for now

do you use localWalker.walk in a custom walker or just click points on the minimap?

do you use localWalker.walk in a custom walker or just click points on the minimap?

Custom walkers follows the same idea as local walker but doesn't spam click if ur not on the first position of the list

It would be in a new class

Walking.java

Then I call it snide my script

Walking walk = new Walking ();

Then walk.walkpath (path here);

@Sinatra

Hey,

So I'm writing a script and I tried using the osbot's local walker to walk a path but it always keeps spam clicking the first tile and doesn't walk any further. Is somebody else having this problem or is the local walker working fine for you?

thanks in advance smile.png

 

 

Something like this

public class Walking {
    private Script scriptInstance;
    public Walking(Script scriptInstance){
        this.scriptInstance = scriptInstance;
    }
    public void walkPath(Position[] path) throws InterruptedException {

        Position[] var5 = path;
        int var4 = path.length;

        for(int var3 = 0; var3 < var4; ++var3) {
            Position p = var5[var3];
            boolean success;
            if(scriptInstance.myPosition().distance(p) <= 16 && scriptInstance.myPosition().distance(p) >= 3) {
                do {
                    success = this.walkTile(p);
                } while(!success);
            }
        }
    }
    public boolean walkTile(Position p) throws InterruptedException {

        if(scriptInstance.myPosition().distance(p) > 13) {
            Position fail = new Position((p.getX() + scriptInstance.myPosition().getX()) / 2 + scriptInstance.random(-3, 3), (p.getY() + scriptInstance.myPosition().getY()) / 2 + scriptInstance.random(-3, 3), scriptInstance.myPosition().getZ());
            this.walkTile(fail);
        }

        scriptInstance.mouse.click(new MiniMapTileDestination(scriptInstance.bot, p), false);
        int var3 = 0;

        while(scriptInstance.myPosition().distance(p) > 2 && var3 < 10) {
            scriptInstance.sleep(500L);
            if(!scriptInstance.myPlayer().isMoving()) {
                ++var3;
            }
        }
        return var3 != 10;
    }
}

  • Author

Custom walkers follows the same idea as local walker but doesn't spam click if ur not on the first position of the list

It would be in a new class

Walking.java

Then I call it snide my script

Walking walk = new Walking ();

Then walk.walkpath (path here);

@Sinatra

Something like this

public class Walking {    private Script scriptInstance;    public Walking(Script scriptInstance){        this.scriptInstance = scriptInstance;    }    public void walkPath(Position[] path) throws InterruptedException {        Position[] var5 = path;        int var4 = path.length;        for(int var3 = 0; var3 < var4; ++var3) {            Position p = var5[var3];            boolean success;            if(scriptInstance.myPosition().distance(p) <= 16 && scriptInstance.myPosition().distance(p) >= 3) {                do {                    success = this.walkTile(p);                } while(!success);            }        }    }    public boolean walkTile(Position p) throws InterruptedException {        if(scriptInstance.myPosition().distance(p) > 13) {            Position fail = new Position((p.getX() + scriptInstance.myPosition().getX()) / 2 + scriptInstance.random(-3, 3), (p.getY() + scriptInstance.myPosition().getY()) / 2 + scriptInstance.random(-3, 3), scriptInstance.myPosition().getZ());            this.walkTile(fail);        }        scriptInstance.mouse.click(new MiniMapTileDestination(scriptInstance.bot, p), false);        int var3 = 0;        while(scriptInstance.myPosition().distance(p) > 2 && var3 < 10) {            scriptInstance.sleep(500L);            if(!scriptInstance.myPlayer().isMoving()) {                ++var3;            }        }        return var3 != 10;    }}
thanks a lot, I'll try it out!

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.