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.

Snippet world hopper fix

Featured Replies

Here is a quick bad fix to keep your farms running. The world hopper is broken:

 

	private static final int[] F2PWORLDS = new int[] { 335, 379, 380, 382, 383, 384, 393, 394, 397, 398, 399, 418, 430,
			431, 433, 434, 435, 436, 437, 438, 439, 440, 451, 452, 453, 454, 455, 456, 457, 458, 459, 497, 498, 499,
			500, 501, 502, 503, 504 };

	private RS2Widget wor;

	public void hop(int world) {
		safeWhile(() -> !getLogoutTab().isOpen() && !getWorlds().isOpen(), 10, new Runnable() {
			public void run() {
				getLogoutTab().open();
				s(1000, 2000);
			}
		});
		safeWhile(() -> !getWorlds().isOpen(), 10, new Runnable() {
			public void run() {
				getWidgets().get(182, 4).interact("World Switcher");
				s(1000, 2000);
			}
		});
		Random r = new Random();
		s(1000, 2000);
		updateWor(world);
		getWidgets().get(69, 8).hover();
		safeWhile(() -> (wor.getAbsY() > 430 || wor.getAbsY() < 240), 40, new Runnable() {
			@Override
			public void run() {
				updateWor(world);
				getWidgets().get(69, 8).hover();
				if (wor.getAbsY() > 430) {
					getMouse().scrollDown();
					s(80 + r.nextInt(5));
					getMouse().scrollDown();
					s(80 + r.nextInt(5));
					getMouse().scrollDown();
				} else {
					getMouse().scrollUp();
					s(80 + r.nextInt(5));
					getMouse().scrollUp();
					s(80 + r.nextInt(5));
					getMouse().scrollUp();
				}
				s(100 + r.nextInt(20));
			}
		});
		if (wor.hover()) {
			// getMouse().click(false);
			wor.interact("Switch");
		}
		s(5000);
	}

	public void hopF2P() {
		Random r = new Random();
		int world = F2PWORLDS[r.nextInt(F2PWORLDS.length)];
		hop(world);
	}

	private void updateWor(int world) {
		wor = getWidgets().get(69, 16, world);
	}

 

update: you need to click the dialogue to actually hop:

something like this

		waitUntil(() -> getDialogues().isPendingOption(), 500, 10);
		safeWhile(() -> getDialogues().isPendingOption(), 10, new Runnable() {
			@Override
			public void run() {
				try {
					getDialogues().completeDialogue("Yes.");
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				s(500);
			}
		});

 

 

And how could I forget: 


	public void safeWhile(Condition c, int attempts, Runnable runnable) {
		while (getBot().getScriptExecutor().isRunning() && !getBot().getScriptExecutor().isPaused()
				&& !getBot().getScriptExecutor().isSuspended() && c.evaluate()) {
			if (attempts-- == 0)
				return;
			runnable.run();
		}
	}

	public boolean waitUntil(Condition c, int interval, int tries) {
		safeWhile(() -> !c.evaluate(), tries, new Runnable() {
			@Override
			public void run() {
				try {
					sleep(interval);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		});
		return true;
	}
public interface Condition {
	
	boolean evaluate();

}

 

Edited by Bobbey

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.