Skip 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.

World hopping inventory error

Featured Replies

my script basically does:

 

if shop contains X  && inventory contains X coins {

do w.e 

} else world hop

 

But when i world hop, it loads into the new world with the worlds tab open, causing the inventory counter to glitch out and return it doesnt contain X coins

 

ive tried contitional sleeps for getLoginStateValue() != 20;

then open the inv tab, although it does nothing also.

worlds.hopToP2PWorld();
				new ConditionalSleep(10000) {
					@[member=Override]
					public boolean condition() throws InterruptedException {
						return getClient().getLoginStateValue() != 20;
					}
				}.sleep();
					getTabs().open(Tab.INVENTORY);
			}

i also tried adding this to the top of the buy case:

 

if (!getTabs().getOpen().equals(Tab.INVENTORY)) {
getTabs().open(Tab.INVENTORY);
}
 
which still does nothing

Edited by Lewis

maybe try

if shop contains X  && inventory contains X coins && getTabs().getOpen().equals(Tab.INVENTORY)) {

 

also still have the open tab statement at the top

  • Author

maybe try

if shop contains X  && inventory contains X coins && getTabs().getOpen().equals(Tab.INVENTORY)) {

 

also still have the open tab statement at the top

i declare the buy case by: if shop area contains my player && inventory contains > 1000 coins

case BUY:
			NPC shop = npcs.closest(npc);
if (!getTabs().getOpen().equals(Tab.INVENTORY)) {
				getTabs().open(Tab.INVENTORY);
				}
			if (shop != null && !store.isOpen()) {
				shop.interact("Trade");
				new ConditionalSleep(10000) {
					@[member=Override]
					public boolean condition() throws InterruptedException {
						return store.isOpen();
					}
				}.sleep();
			} else if (store.getAmount(ITEM) > 0) {
					store.buy(ITEM, 10);
				} else if (store.getAmount(ITEM) > 15) {
					store.buy(ITEM, 10);
				}  else if (store.getAmount(ITEM) == 0
						&& store.getAmount(ITEM) < 15) {
					if (store.isOpen()) {
						store.close();
					}
					worlds.hopToP2PWorld();
					sleep(random(700, 1000));
				}

You could always have a boolean that you set to true when you considered it time to hop and set it to false once the hop is complete.

  • Author

You could always have a boolean that you set to true when you considered it time to hop and set it to false once the hop is complete.

im not having an error with it hopping, i have an error after it hops, i.e im at the shop with 100k in inv, it buys items until X remaining (lets say i have 80k remaining) then it will hop.

 

i have another muling state for if inventory has under 20k gp

 

so, after it buys from the shops, world hops it runs to my muling area even though it has 80k in inventory still

im not having an error with it hopping, i have an error after it hops, i.e im at the shop with 100k in inv, it buys items until X remaining (lets say i have 80k remaining) then it will hop.

 

i have another muling state for if inventory has under 20k gp

 

so, after it buys from the shops, world hops it runs to my muling area even though it has 80k in inventory still

 

ooh, ive come across this before.

 

Basically you are trying to get the items and amounts in your inventory while the client is still loading and returns some funky results.

 

try adding this it your loop:

if (getClient().getLoginState() == LoginState.LOADING || getClient().getLoginState() == LoginState.LOADING_MAP)
return 300;
  • Author

 

ooh, ive come across this before.

 

Basically you are trying to get the items and amounts in your inventory while the client is still loading and returns some funky results.

 

try adding this it your loop:

if (getClient().getLoginState() == LoginState.LOADING || getClient().getLoginState() == LoginState.LOADING_MAP)
return 300;

 

 

i tried a conditional sleep on getLoginStateValue()

it still gives the error. 

i tried a conditional sleep on getLoginStateValue()

it still gives the error. 

 

I think my ghetto fix was:

 

 

getInventory().getEmptySlotCount() != -1

 

Try this

  • Author

I think my ghetto fix was:

 

 

Try this

 

on my conditional sleep like so?:

worlds.hopToP2PWorld();
				log("hopping to new world");
				new ConditionalSleep(10000) {
					@[member=Override]
					public boolean condition() throws InterruptedException {
						return getInventory().getEmptySlotCount() != -1;
					}
				}.sleep();
				log("open inv");
					getTabs().open(Tab.INVENTORY);

 

on my conditional sleep like so?:

worlds.hopToP2PWorld();
				log("hopping to new world");
				new ConditionalSleep(10000) {
					@[member='Override']
					public boolean condition() throws InterruptedException {
						return getInventory().getEmptySlotCount() != -1;
					}
				}.sleep();
				log("open inv");
					getTabs().open(Tab.INVENTORY);

 

Just. add a check in your loop and return before you do anything if getInventory().getEmptySlotCount() == -1

  • Author

Just. add a check in your loop and return before you do anything if getInventory().getEmptySlotCount() == -1

cant get it to work still

tried waiting on widgets, login status' if inventory is open or not

all dont work

 

(it is calling open inventory before it has finished loading into the new world)

and i would rather avoid a static sleep to avoid lag educed errors

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.