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.

how to walk a random path to destination?

Featured Replies

looking to stop using the webwalker and use paths, but i want to randomize the path the script will take.
i can for example make it:

walk to DESTINEDAREA using: path1 or path2 or path3 or path 4 etc

but it seems very inefficient to have 10 paths for the 1 actual path i want to walk.
is there a way i can randomize the tiles it walks on a path within a range of the original set tiles

there used to be something in an old bot walkPath(path, 4, 4) i dunno if its there still but that would randomize path by 4 wide 4 high

  • Author
5 minutes ago, whipz said:

there used to be something in an old bot walkPath(path, 4, 4) i dunno if its there still but that would randomize path by 4 wide 4 high

if it was from an old bot, its almost guaranteed it isnt the same API

4 minutes ago, Lewis said:

if it was from an old bot, its almost guaranteed it isnt the same API

thats the best I have at the moment ): Sorry mate Ill have a look in morning its a tad late here ):

4 minutes ago, Lewis said:

if it was from an old bot, its almost guaranteed it isnt the same API

thats the best I have at the moment ): Sorry mate Ill have a look in morning its a tad late here ):

 

edit

This might help

WalkingEvent()
Creates a walking event for which a path will need to be set with the setPath() methods.
WalkingEvent(Area area)
Creates a walking event with a minDistanceThreshold of 2 and a miniMapDistanceThreshold of 5 to a random location within the given area.
WalkingEvent(Entity entity)
Creates a walking event with a minDistanceThreshold of 2 and a miniMapDistanceThreshold of 5 to the location of the given entity.
WalkingEvent(Position position)
Creates a walking event with a minDistanceThreshold of 2 and a miniMapDistanceThreshold of 5 to the location of the given position.

Edited by whipz

For completely random paths for each run, just have a few hardcoded and chose which one randomly. This below will take a path and randomize the actual tile it's walked to by an offset. It's not tested, nor probably the way to do things. 

 


//add inside the for loop camera controlls
//also helps to check the distance, if so far then use the minimap
//also if distance of position is so close (ie distance=4) skip to next position
public void walkRandom(Position... pos, int minX, int maxX, int minY, int maxY){
	
	Position tmpPos = null;
	for(Position p : pos) {
		int xrand = p.getX() + random(minX, maxX); //min,max are offsets of the position
		int yrand = p.getY() + random(minY, maxY); //Can use negative integer
		tmpPos = new Position(xrand, yrand, p.getZ());
		//if canReach tmpPos
		//walk to tmpPos		
	}


}

 

Edited by Polymorphism

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.