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.

WalkingEvent Questions

Featured Replies

1. If I use a single instance WalkingEvent doesn't run after one execution. It seems that I have to instantiate a new event every time I want to run one. Why is this?

2. What is the exact maximum distance WalkingEvent will try to click? I noticed on my path I have many in-between points that are never clicked, so I'm guessing they are pointless to have.

3. Is there a way to set the distance from a point that the next point will be clicked? With WalkingEvent it seems to click the next point when it is within 2-3 squares, but WebWalkingEvent has a bigger lead which makes it look more natural (i.e. player doesn't slow down when it is close to the next Position).

  • Author

API doesn't answer the latter two questions, but i took a look with a decompiler

	private boolean traversePath() {
		Object someObject = null;
		for (int i = linkedList.size() - 1; i >= 0; --i) {
			Position currentListPos;
			label35: {
				currentListPos = (Position) linkedList.get(i);
				if (myPosition().distance(currentListPos) >= miniMapDistanceThreshold) {
					if (!map.isMinimapLocked() && currentListPos.isOnMiniMap(bot)) {
						if (isOperateCamera && camera.getPitchAngle() < gRandom(40, 1.0D)) {
							camera.movePitch(random(40, 67));
						}

						someObject = new ClickMouseEvent(new MiniMapTileDestination(bot, currentListPos));
						break label35;
					}
				} else {
					if (!currentListPos.isVisible(bot)) {
						camera.toPosition(currentListPos);
					}

					(new WalkingEvent$1(this, 10000)).sleep();
					someObject = (new InteractionEvent(bot, currentListPos, "walk here")).setWalkTo(false);
				}
			}

			if (someObject != null) {
				execute((Event) someObject);
				if (((Event) someObject).hasFinished()) {
					(new WalkingEvent$2(bot, 6000, 500, currentListPos)).sleep();
					return true;
				}
			}
		}

		return false;
	}

	public class WalkingEvent$1 extends ConditionalSleep {
		public final WalkingEvent walkingEvent;

		public WalkingEvent$1(WalkingEvent walkingEvent, int timeout) {
			super(timeout);
			this.walkingEvent = walkingEvent;
		}

		public boolean condition() throws InterruptedException {
			return !myPlayer.isMoving();
		}
	}

	public class WalkingEvent$2 extends ConditionalSleep {
		public final WalkingEvent walkingEvent;
		public final Position position;

		public WalkingEvent$2(WalkingEvent walkingEvent, int timeout, int sleepTime, Position position) {
			super(timeout, sleepTime);
			this.walkingEvent = walkingEvent;
			this.position = position;
		}

		public boolean condition() {
			return myPlayer.getPosition().distance(currentListPos) < 4;
		}
	}

The second conditional sleep is being called between minimap clicks, timeout of 6 seconds with 500ms updates checking if player pos distance to next position is <= 3 tiles.

those need to be public vars :D?

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.