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.

issues with widgets

Featured Replies

List<RS2Widget> clickHereToContinueList = getWidgets().getAll().stream().filter(w -> w != null && w.isVisible() && w.getMessage() != null && w.getMessage().equals("Click here to continue")).collect(Collectors.toList());
			if (clickHereToContinueList.isEmpty()) {
				log("empty");
			}

So this is what happens, when i run the script before entering the dialogue the list is empty as it should but as soon as i exit the dialogue the list isn't empty even though i'm not in dialogue anymore. I'm not storing the widget data anywhere else, this whole code is inside onLoop, can someone tell me what could cause this ? Also, i'm using osbot version 2.5.29, i can't use 2.5.27 as when i try to run it it says my osbot version is outdated. If anyone could try the above with 2.5.27 i'd greatly appreciate it.

Quote

when i try to run it it says my osbot version is outdated. If anyone could try the above with 2.5.27 i'd greatly appreciate it.

we are on stable version 2.5.28..

  • Author

ah didn't notice 2.5.28 was out, anyways, i tried with 2.5.28 and i still have this issue

  • Author

8f5c45d30e87288ba05da3a822d76d51.gif

		List<RS2Widget> clickHereToContinueList = getWidgets().getAll().stream().filter(w -> w != null && w.isVisible() && w.getMessage() != null && w.getMessage().equals("Click here to continue")).collect(Collectors.toList());
		if (!clickHereToContinueList.isEmpty()) {
			RS2Widget clickHereToContinue = clickHereToContinueList.get(0);
			g.draw(clickHereToContinue.getBounds());
		}

Even though Click here to continue is not there it, instead it's Please wait..., it thinks it's still there. Am i doing something wrong ?

Edited by Ayylmao420

  • Author
10 minutes ago, HeyImJamie said:

How often are you updating your variable?

the main post code was inside onloop so it should be updating every single time onloop returns, the second code i posted was inside onpaint so yeah, it should update immediately but it isn't which is strange.

Edited by Ayylmao420

7 minutes ago, Ayylmao420 said:

the main post code was inside onloop so it should be updating every single time onloop returns, the second code i posted was inside onpaint so yeah, it should update immediately but it isn't which is strange.

Just wondering if it never actually updates. What exactly are you using this for? Possibly a workaround.

  • Author
9 minutes ago, HeyImJamie said:

Just wondering if it never actually updates. What exactly are you using this for? Possibly a workaround.

						List<RS2Widget> clickHereToContinueList = getWidgets().getAll().stream().filter(w -> w != null && w.isVisible() && w.getMessage() != null && w.getMessage().equals("Click here to continue")).collect(Collectors.toList());
						if (!clickHereToContinueList.isEmpty()) {
							RS2Widget clickHereToContinue = clickHereToContinueList.get(0);
							if (clickHereToContinue.interact("Continue")) {
								sleepUntil(() -> getWidgets().getAll().stream().filter(w -> w != null && w.isVisible() && w.getMessage() != null && w.getMessage().equals("Click here to continue")).collect(Collectors.toList()).isEmpty(), random(3000, 5000));
							}
						}

I'm clicking on Click here to continue, also notice the sleepUntil condition, it should be updating every 10ms but it still sleeps the full time because it still thinks the clickHereToContinue exists.

I tried doing this:

						if (getDialogues().isPendingContinuation()) {
							if (getDialogues().clickContinue()) {
								sleepUntil(() -> !getDialogues().isPendingContinuation(), random(3000, 5000));
							}
						}

but this one too sleeps the full amount of time because it thinks it is still pending continuation.

Edited by Ayylmao420

The Gielinor Guide and all other Tutorial Island instructions widgets do not function correctly with the Dialogues API (unless we've both been attempting to use it incorrectly). You must implement your own method for continuation.

You're also unnecessarily complicating your life with the widgets API. getWidgets().getWidgetContainingText(root, "Click here to continue") should suffice for you to get the single, visible widget containing that text.

You might find Explv's open-source script helpful. https://github.com/Explv/Tutorial-Island/blob/master/src/sections/TutorialSection.java

Edited by NoxMerc

  • Author
On 11/28/2018 at 8:18 AM, NoxMerc said:

The Gielinor Guide and all other Tutorial Island instructions widgets do not function correctly with the Dialogues API (unless we've both been attempting to use it incorrectly). You must implement your own method for continuation.

You're also unnecessarily complicating your life with the widgets API. getWidgets().getWidgetContainingText(root, "Click here to continue") should suffice for you to get the single, visible widget containing that text.

You might find Explv's open-source script helpful. https://github.com/Explv/Tutorial-Island/blob/master/src/sections/TutorialSection.java

thanks, i'll investigate :)

Edit://

I tried getWidgets().getWidgetContainingText() but it still gives me the same result.

Edited by Ayylmao420

Not sure what your issue is with a lack of code. You've been given an open-source example of a working script for clicking ClickToContinue. What's the latest code you have that's not working?

Edited by NoxMerc

*Duplicate, sorry

Edited by NoxMerc
*Duplicate, sorry

  • Author
15 minutes ago, NoxMerc said:

Not sure what your issue is with a lack of code. You've been given an open-source example of a working script for clicking ClickToContinue. What's the latest code you have that's not working?

His works and so is mine but my question is why does the widget for both codes return true when the message clearly doesn't equal "Click here to continue" but actually "Please wait...". I tried filtering for "Please wait..." but osbot doesn't even find a widget with message like that even though another botting client that i tried it on does.

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.