Jump to content
Void

Level up widget

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites


		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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing   0 members

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