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.

Determining the length of a WalkingEvent or WebWalkEvent path before actually walking it

Featured Replies

Hey I was trying to write a script that favors the "closest" node of a resource to gather, either ore or trees, but I ran into the issue of my bot running 60 tiles spaces away because he wanted to go around a fence to a tree that was technically closer after cut the last tree, when there were plenty of other trees closer to the first one he cut. I recognize that I can just make him search for a closer tree as he starts moving but now I've fallen down the rabbit hole of wanting to be able to find the length of a path/route made by webwalking or local walking functions. Is this even possible? From what I can tell when we create a walking event you can call, for example with a WebWalkEvent, the getPositions() method but only after you call execute(WebWalkEvent cleverName). This will of course make the bot take the path, and then return the list of positions of the path it just took. If we can find the list of positions that make up the route before the bot walks it, how can this be done? At this point I'm contemplating writing my own pathing script but I know that's a huge undertaking I was hoping to avoid... Thanks for any help!

You can use the LocalPathFinder class to generate the path your character will take when walking to a position https://osbot.org/api/org/osbot/rs07/api/util/LocalPathFinder.html

Although if you just want find the closest object based on the actual path, you can pass the realDistance = true parameter to the closest() method call. This will generate the path and compare lengths for you https://osbot.org/api/org/osbot/rs07/api/EntityAPI.html#closest-boolean-java.lang.String...-

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.