Jump to content

Level up widget


Recommended Posts

Posted

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

Posted (edited)
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
  • Like 1
Posted (edited)
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
Posted
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

Posted

		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

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

Posted (edited)
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
Posted (edited)
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
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...