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.

Level up widget

Featured Replies

https://gyazo.com/0ed02a1a00f07dce19b9301293d63666

Hi,

I'm wondering if the level up widget for every level is the same?

Currently my flax spinner stops spinning flax whenever the level up screen shows; as it stops animating.

Current code:

https://hastebin.com/aqajeliyuj.java

I'm wondering if I can just say something like:

 

https://hastebin.com/abiberiqer.java

 

Basically - is the widget for levelling up any skills ALWAYS the same; or does it vary? So level 13 crafting will be different to level 14?

If so; how do I ask the bot to continue it's task after it's levelled up?

 

Thanks

if (!myPlayer().isAnimating() && getInventory().contains("Flax"))

repeat action

9 minutes ago, Void said:

I'm wondering if the level up widget for every level is the same?

Just sleep until either the inventory does not contain flax, or the dialog is pending continue:

return !getInventory().contains("Flax") || getDialogue().isPendingContinuation();

 

Edited by Explv

Either check if your not animating or your player animation is the standard idle animation and check if you still have flax and i think the level up is a dialogue not a interface? 

15 minutes ago, Explv said:

Just sleep until either the inventory does not contain flax, or the dialog is pending continue:


return !getInventory().contains("Flax") || getDialogue().isPendingContinuation();

 

This will work the best, because animating won't stop instantly after leveling up or after your inventory doesn't contain flax anymore.

 

Explv option is probably the best, thouh another simple way to handle it would be to

if (dialogues.isPendingContinuation()) 
	dialogues.clickContinue();

 

  • Author
On 2017-5-7 at 0:38 PM, Charlotte said:

if (!myPlayer().isAnimating() && getInventory().contains("Flax"))

repeat action

 

On 2017-5-7 at 0:57 PM, The Undefeated said:

This will work the best, because animating won't stop instantly after leveling up or after your inventory doesn't contain flax anymore.

 

 

On 2017-5-7 at 0:42 PM, Explv said:

Just sleep until either the inventory does not contain flax, or the dialog is pending continue:


return !getInventory().contains("Flax") || getDialogue().isPendingContinuation();

 

 

On 2017-5-7 at 0:49 PM, Saiyan said:

Either check if your not animating or your player animation is the standard idle animation and check if you still have flax and i think the level up is a dialogue not a interface? 

 

On 2017-5-7 at 1:21 PM, nosepicker said:

Explv option is probably the best, thouh another simple way to handle it would be to


if (dialogues.isPendingContinuation()) 
	dialogues.clickContinue();

 

Thanks everyone :) Got it working now.

How would you add it to repeat a certain part of a task based script?

So

if (dialogues.isPendingContinuation()) 
	dialogues.clickContinue();

repeat // - how to make it repeat the below until the return is met for final condition?

          api.getObjects().closest("Spinning wheel").interact("Spin");
          api.log("Interacting with Spinning wheel..");
   		new ConditionalSleep(MethodProvider.random(2000,3000)) {
               public boolean condition() throws InterruptedException {
               	return api.getWidgets().isVisible(459, 93);
               }
            }.sleep();
            api.getWidgets().getWidgetContainingText("Bow String").interact("Make X");
            MethodProvider.sleep(900);
            api.getKeyboard().typeString("" + MethodProvider.random(31, 283));
            api.log("Starting to spin Flax....");
       		new ConditionalSleep(MethodProvider.random(80000,110000)) {
                   public boolean condition() throws InterruptedException {
                   	 return !api.getInventory().contains("Flax") && !api.myPlayer().isAnimating() && api.getInventory().onlyContains("Bow string");
                   }
                }.sleep(); 

 

Currently I just have a class called "pending" which states

da8e6732e94acb8755a6b8606d158360.png

 

Edited by Void

10 minutes ago, Void said:

 

 

 

 

Thanks everyone :) Got it working now.

How would you add it to repeat a certain part of a task based script?

So


if (dialogues.isPendingContinuation()) 
	dialogues.clickContinue();

repeat // - how to make it repeat the below until the return is met for final condition?

          api.getObjects().closest("Spinning wheel").interact("Spin");
          api.log("Interacting with Spinning wheel..");
   		new ConditionalSleep(MethodProvider.random(2000,3000)) {
               public boolean condition() throws InterruptedException {
               	return api.getWidgets().isVisible(459, 93);
               }
            }.sleep();
            api.getWidgets().getWidgetContainingText("Bow String").interact("Make X");
            MethodProvider.sleep(900);
            api.getKeyboard().typeString("" + MethodProvider.random(31, 283));
            api.log("Starting to spin Flax....");
       		new ConditionalSleep(MethodProvider.random(80000,110000)) {
                   public boolean condition() throws InterruptedException {
                   	 return !api.getInventory().contains("Flax") && !api.myPlayer().isAnimating() && api.getInventory().onlyContains("Bow string");
                   }
                }.sleep(); 

 

Currently I just have a class called "pending" which states

da8e6732e94acb8755a6b8606d158360.png

 

You have to use if statements as currently if any thing happens it may glitch the script


		if (dialogues.isPendingContinuation()){
			dialogues.clickContinue();
		} else if (!getWidgets().isVisible(459, 93)) {
			getObjects().closest("Spinning wheel").interact("Spin");
			log("Interacting with Spinning wheel..");
			new ConditionalSleep(MethodProvider.random(2000, 3000)) {
				public boolean condition() throws InterruptedException {
					return getWidgets().isVisible(459, 93);
				}
			}.sleep();
		} else if (getWidgets().getWidgetContainingText("Bow String") != null) {
			getWidgets().getWidgetContainingText("Bow String").interact("Make X");
			new ConditionalSleep(MethodProvider.random(2000, 3000)) {
				public boolean condition() throws InterruptedException {
					return getWidgets().getWidgetContainingText("Enter amount:") != null //check the text not sure if i wrote correctly
							&& getWidgets().getWidgetContainingText("Enter amount:").isVisible();
				}
			}.sleep();
		} else if (getWidgets().getWidgetContainingText("Enter amount:") != null //check the text not sure if i wrote correctly
				&& getWidgets().getWidgetContainingText("Enter amount:").isVisible()) {
			getKeyboard().typeString("" + MethodProvider.random(31, 283));
			log("Starting to spin Flax....");
			new ConditionalSleep(MethodProvider.random(80000, 110000)) {
				public boolean condition() throws InterruptedException {
					return getInventory().contains("Flax") && !myPlayer().isAnimating()
							&& getInventory().onlyContains("Bow string");
				}
			}.sleep();
		}
	

Not sure if that works try it out

  • Author
3 hours ago, progamerz said:


		if (dialogues.isPendingContinuation()){
			dialogues.clickContinue();
		} else if (!getWidgets().isVisible(459, 93)) {
			getObjects().closest("Spinning wheel").interact("Spin");
			log("Interacting with Spinning wheel..");
			new ConditionalSleep(MethodProvider.random(2000, 3000)) {
				public boolean condition() throws InterruptedException {
					return getWidgets().isVisible(459, 93);
				}
			}.sleep();
		} else if (getWidgets().getWidgetContainingText("Bow String") != null) {
			getWidgets().getWidgetContainingText("Bow String").interact("Make X");
			new ConditionalSleep(MethodProvider.random(2000, 3000)) {
				public boolean condition() throws InterruptedException {
					return getWidgets().getWidgetContainingText("Enter amount:") != null //check the text not sure if i wrote correctly
							&& getWidgets().getWidgetContainingText("Enter amount:").isVisible();
				}
			}.sleep();
		} else if (getWidgets().getWidgetContainingText("Enter amount:") != null //check the text not sure if i wrote correctly
				&& getWidgets().getWidgetContainingText("Enter amount:").isVisible()) {
			getKeyboard().typeString("" + MethodProvider.random(31, 283));
			log("Starting to spin Flax....");
			new ConditionalSleep(MethodProvider.random(80000, 110000)) {
				public boolean condition() throws InterruptedException {
					return getInventory().contains("Flax") && !myPlayer().isAnimating()
							&& getInventory().onlyContains("Bow string");
				}
			}.sleep();
		}
	

Not sure if that works try it out

Thanks :) works well but 

 

if (api.dialogues.isPendingContinuation()){
			api.dialogues.clickContinue();

doesn't work whatsoever; if the dialogue appears it is completely ignored. I can't work out why.

I've also tried adding 

if (api.dialogues.isPendingContinuation()){
			api.dialogues.clickContinue();
		} else if (api.dialogues.isPendingContinuation()) {
			api.dialogues.clickContinue();
			api.log("Walking to spin room");
			new ConditionalSleep(MethodProvider.random(10000,13000)) {
	            public boolean condition() throws InterruptedException {
	            	return !api.dialogues.isPendingContinuation();
				}
			}.sleep();

The script still just stops there.

9 minutes ago, Void said:

Thanks :) works well but 

 


if (api.dialogues.isPendingContinuation()){
			api.dialogues.clickContinue();

doesn't work whatsoever; if the dialogue appears it is completely ignored. I can't work out why.

I've also tried adding 


if (api.dialogues.isPendingContinuation()){
			api.dialogues.clickContinue();
		} else if (api.dialogues.isPendingContinuation()) {
			api.dialogues.clickContinue();
			api.log("Walking to spin room");
			new ConditionalSleep(MethodProvider.random(10000,13000)) {
	            public boolean condition() throws InterruptedException {
	            	return !api.dialogues.isPendingContinuation();
				}
			}.sleep();

The script still just stops there.

new ConditionalSleep(MethodProvider.random(80000, 110000)) {
				public boolean condition() throws InterruptedException {
					return (!getInventory().contains("Flax") || !myPlayer().isAnimating() || api.dialogues.isPendingContinuation())
							|| getInventory().onlyContains("Bow string");
				}
			}.sleep();

Try this instead of:

9 minutes ago, Void said:

new ConditionalSleep(MethodProvider.random(80000, 110000)) {
				public boolean condition() throws InterruptedException {
					return getInventory().contains("Flax") && !myPlayer().isAnimating()
							&& getInventory().onlyContains("Bow string");
				}
			}.sleep();

And remove this:

9 minutes ago, Void said:

if (dialogues.isPendingContinuation()){
			dialogues.clickContinue();
		} else 

So the final code for this task will be:

if (!getWidgets().isVisible(459, 93)) {
			getObjects().closest("Spinning wheel").interact("Spin");
			log("Interacting with Spinning wheel..");
			new ConditionalSleep(MethodProvider.random(2000, 3000)) {
				public boolean condition() throws InterruptedException {
					return getWidgets().isVisible(459, 93);
				}
			}.sleep();
		} else if (getWidgets().getWidgetContainingText("Bow String") != null) {
			getWidgets().getWidgetContainingText("Bow String").interact("Make X");
			new ConditionalSleep(MethodProvider.random(2000, 3000)) {
				public boolean condition() throws InterruptedException {
					return getWidgets().getWidgetContainingText("Enter amount:") != null //check the text not sure if i wrote correctly
							&& getWidgets().getWidgetContainingText("Enter amount:").isVisible();
				}
			}.sleep();
		} else if (getWidgets().getWidgetContainingText("Enter amount:") != null //check the text not sure if i wrote correctly
				&& getWidgets().getWidgetContainingText("Enter amount:").isVisible()) {
			getKeyboard().typeString("" + MethodProvider.random(31, 283));
			log("Starting to spin Flax....");
			new ConditionalSleep(MethodProvider.random(80000, 110000)) {
				public boolean condition() throws InterruptedException {
					return (!getInventory().contains("Flax") || !myPlayer().isAnimating() || api.dialogues.isPendingContinuation());
				}
			}.sleep();
		}

And make another task which handles Dialogues seperately with the logic:
Validate : If is dialogue is pending continuation
Process : click continue

Edited by progamerz

  • Author
12 minutes ago, progamerz said:

new ConditionalSleep(MethodProvider.random(80000, 110000)) {
				public boolean condition() throws InterruptedException {
					return (!getInventory().contains("Flax") || !myPlayer().isAnimating() || api.dialogues.isPendingContinuation())
							|| getInventory().onlyContains("Bow string");
				}
			}.sleep();

Try this instead of:

And remove this:

So the final code for this task will be:


if (!getWidgets().isVisible(459, 93)) {
			getObjects().closest("Spinning wheel").interact("Spin");
			log("Interacting with Spinning wheel..");
			new ConditionalSleep(MethodProvider.random(2000, 3000)) {
				public boolean condition() throws InterruptedException {
					return getWidgets().isVisible(459, 93);
				}
			}.sleep();
		} else if (getWidgets().getWidgetContainingText("Bow String") != null) {
			getWidgets().getWidgetContainingText("Bow String").interact("Make X");
			new ConditionalSleep(MethodProvider.random(2000, 3000)) {
				public boolean condition() throws InterruptedException {
					return getWidgets().getWidgetContainingText("Enter amount:") != null //check the text not sure if i wrote correctly
							&& getWidgets().getWidgetContainingText("Enter amount:").isVisible();
				}
			}.sleep();
		} else if (getWidgets().getWidgetContainingText("Enter amount:") != null //check the text not sure if i wrote correctly
				&& getWidgets().getWidgetContainingText("Enter amount:").isVisible()) {
			getKeyboard().typeString("" + MethodProvider.random(31, 283));
			log("Starting to spin Flax....");
			new ConditionalSleep(MethodProvider.random(80000, 110000)) {
				public boolean condition() throws InterruptedException {
					return (!getInventory().contains("Flax") || !myPlayer().isAnimating() || api.dialogues.isPendingContinuation());
				}
			}.sleep();
		}

And make another task which handles Dialogues seperately with the logic:
Validate : If is dialogue is pending continuation
Process : click continue

Ok thanks! I'll let you know

Edited by Void

  • Author

Worked great :D

Thanks everyone for help.

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.