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.

WorldHopping

Featured Replies

Hello so i have problem with worldhopping

   (I'm not good at conditional sleep so please help me to solve it smile.png   )

if(store.isOpen()) {
			Item test1 = getStore().getItem("Item");
			 if (test1 != null && getStore().getAmount("Item") > 0) {
				 getStore().buy("Item", 5);
			 }
		}
		Item test2 = getStore().getItem("Item2");
		 if (test2 != null && getStore().getAmount("Item2") > 0) {
			 getStore().buy("Item2", 5);
	  }
		 if (getStore().isOpen()) {
             getStore().close();
             new ConditionalSleep(5500, 6000) {
                 public boolean condition() throws InterruptedException {
                     return !getStore().isOpen();
                 }
             }.sleep();
             getWorlds().hopToP2PWorld();
             new ConditionalSleep(15000, 25000) {
                 public boolean condition() throws InterruptedException {
                     return myPlayer().exists();
                 }
             }.sleep();
	}
}
    
}

The problem is after world hop it starts to eat all my cpu.So if sombody could help me that would be great biggrin.png

Edited by cattycatcat

myPlayer() might be null, try checking if it's not null in the ConditionalSleep

 

Also, you can define the amount of time the ConditionalSleep loop waits between each iteration like so:

(2nd parameter of the constructor)

new ConditionalSleep(random(15000, 25000), random(300,800)) {
  public boolean condition() throws InterruptedException {
    return condition;
  }
}.sleep();

Edited by btsfan

The most reliable way I found was to sleep until the current world has changed.

 

I posted a snippet in the scripting subforum which might save you some time.

Untested:

boolean hop = false;
int oldWorld = -1;

if (hop) {
			
	if (getStore().isOpen()) {
		getStore().close();
		return 300;
	}
			
	getWorlds().hopToP2PWorld();
			
	if (oldWorld != getWorlds().getCurrentWorld())
		hop = false;
			
	return 300;
			
}

if (!getStore().isOpen()) {
	// open store
	return 300;
}

String item1Name = "Item1";
String item2Name = "Item2";
Item item1 = getStore().getItem(item1Name);
Item item2 = getStore().getItem(item2Name);

if (item1 != null && getStore().getAmount(item1Name) > 0) {
	getStore().buy(item1Name, 5);
	return 300;
}

if (item2 != null && getStore().getAmount(item2Name) > 0) {
	getStore().buy(item2Name, 5);
	return 300;
}

hop = true;
oldWorld = getWorlds().getCurrentWorld();

Hope you get the gist of it :)

Also use HHopper doge.png

Edited by House

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.