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.

The LocalWalker changed

Featured Replies

Hi,

Had been gone for 2 yearsl lost my Scripter 2 status :( /  :p
I'm still rusty.

But okay so one of my script doesnt work anymore since the localwalker has changed I tried:
    private Position[] path1 = { new Position(random(3274, 3278), random(3176, 3178), 0 ) };
    to
    private List path1 = (random(3274, 3278), random(3176, 3178), 0 );

But i don't get how Lists, I think I'm doing something wrong, can somebody push me in the right directions.

 

Much Thanks...

localwalker is now WalkingEvent

or getWalking().walk(...)

 

Uses LinkedList<Position>

  • Author

It's night here wanna finish this but also want to sleep, brain is half working.

 

Can you help?

2 minutes ago, dreameo said:

You can convert the array to a list. 

 

1 hour ago, erenjwz said:

Hi,

Had been gone for 2 yearsl lost my Scripter 2 status :( /  :p
I'm still rusty.

But okay so one of my script doesnt work anymore since the localwalker has changed I tried:
    private Position[] path1 = { new Position(random(3274, 3278), random(3176, 3178), 0 ) };
    to
    private List path1 = (random(3274, 3278), random(3176, 3178), 0 );

But i don't get how Lists, I think I'm doing something wrong, can somebody push me in the right directions.

 

Much Thanks...

Well that's just a problem of using data structures in java, I don't think this is scripting related at all

https://www.tutorialspoint.com/java/java_data_structures.htm

Check out a few tutorials on java arrays, collections, (and streams for java 8/9) etc

https://www.tutorialspoint.com/java/java_arrays.htm

https://www.tutorialspoint.com/java/java_collections.htm

https://www.tutorialspoint.com/java8/java8_streams.htm

        // walk to some position, make sure the bot can reach that position
        // (loaded into the current region, no obstacles between
        // the bot and the destination, also check the Z coordinate because 
        // it used to not be taken into account and probably remained like this
        // for backwards compatibility)
        Position destination = new Position(someX, someY, someZ);
        if (myPosition().getZ() == destination.getZ() && getMap().canReach(destination)) {
            log(String.format("walking to %s: %b", destination, getWalking().walk(destination)));
        } else {
            // doge
        }

        // or if you want to walk a certain path, for cases where the end position may be too
        // far away to be loaded into the current region but you (assume) can 
        // reach it by advancing into the path
        Position[] path = {destination1, destination2, destination3, destination4};
        log(String.format("walking path %s: %b", Arrays.toString(path), getWalking().walkPath(Stream.of(path)
                .collect(Collectors.toList()))));

        // or just look up the LocalPathFinder in the API docs for lower level 
        // access to local region path finding 
        LocalPathFinder lpf = new LocalPathFinder(getBot());

 

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.