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.

Making webwalking use teleports

Featured Replies

Hey guys, i cant figure out how to make the inbuilt webwalking to use teleports.  I guess it has something to do with WebWalkEvent, and its method setAllowTeleports, but i dont know how to use walking events. Could anyone point me in the right direction?

I'm fairly certain its default is true but look at this:

private final INodeRouteFinder nrf = INodeRouteFinder.threadSafeWrapper(INodeRouteFinder.createAdvanced());
	private WebWalkEvent e;

	private void walk(Area area, int threshHold) {
		Position endPoint = getValidEndPoint(area);
		e = new WebWalkEvent(nrf, endPoint);
                e.setAllowTeleports(true); //but I think its default is already true, maybe your shortcut isnt supported??
		e.setBreakCondition(new Condition() {
			@Override //removes the parkinson's effect and stops the walking when your close to end
			public boolean evaluate() {
				if (area.contains(myPlayer()) && myPlayer().getPosition().distance(endPoint) < threshHold) {
					return true;
				}
			}
		});
		execute(e);
	}

	private Position getValidEndPoint(Area area) { //gets a random walkable tile in your area
		List<Position> positions = new LinkedList<Position>();
		for (Position p : area.getPositions()) {
			if (isValid(p))
				positions.add(p);
		}
		return positions.get(new Random().nextInt(positions.size() - 1));
	}

	private boolean isValid(Position endPoint) {
		if (nrf.route(myPlayer().getPosition(), endPoint) == null) {
			return false;
		}
		return true;
	}


I like to make these all static and add a Script argument to each function so I can just do something like WebWalk.walk(this, area, int); in the rest of my classes but you might have everything in one class so do whatever you want. Side note, if you create many instances of INodeRouteFinder rather than reusing the same one, which is why I opt to make them static if using mutiple classes, you will get a heap overflow after 30 mins of running your script.

Edited by LoudPacks

I'm fairly certain its default is true but look at this:

private final INodeRouteFinder nrf = INodeRouteFinder.threadSafeWrapper(INodeRouteFinder.createAdvanced());
	private WebWalkEvent e;

	private void walk(Area area, int threshHold) {
		Position endPoint = getValidEndPoint(area);
		e = new WebWalkEvent(nrf, endPoint);
                e.setAllowTeleports(true); //but I think its default is already true, maybe your shortcut isnt supported??
		e.setBreakCondition(new Condition() {
			@Override //removes the parkinson's effect and stops the walking when your close to end
			public boolean evaluate() {
				if (area.contains(myPlayer()) && myPlayer().getPosition().distance(endPoint) < threshHold) {
					return true;
				}
			}
		});
		execute(e);
	}

	private Position getValidEndPoint(Area area) { //gets a random walkable tile in your area
		List<Position> positions = new LinkedList<Position>();
		for (Position p : area.getPositions()) {
			if (isValid(p))
				positions.add(p);
		}
		return positions.get(new Random().nextInt(positions.size() - 1));
	}

	private boolean isValid(Position endPoint) {
		if (nrf.route(myPlayer().getPosition(), endPoint) == null) {
			return false;
		}
		return true;
	}


I like to make these all static and add a Script argument to each function so I can just do something like WebWalk.walk(this, area, int); in the rest of my classes but you might have everything in one class so do whatever you want. Side note, if you create many instances of INodeRouteFinder rather than reusing the same one, which is why I opt to make them static if using mutiple classes, you will get a heap overflow after 30 mins of running your script.

 

 

I'm almost certain it is default like you said.

  • Author

Yeah you are right, it is . I just somehow expected teletabs to count as teleports :D my bad. But nice to know how to use the event anyway, if i will need it sometimes in the future.

Yeah you are right, it is . I just somehow expected teletabs to count as teleports biggrin.png my bad. But nice to know how to use the event anyway, if i will need it sometimes in the future.

 

I always use events to prevent the tile spam clicking that a normal webWalk call will cause.

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.