Jump to content

issues with widgets


Recommended Posts

Posted (edited)

It's hard to go off your word alone when both Explv and myself have working TutIsland scripts relying on the notion of "Click to Continue", and you haven't given us the latest code that's producing the issues you're describing.

    public static RS2Widget getClickToContinueWidget(ScriptContext ctx) {
        return ctx.getWidgets()
                .getAll()
                .stream()
                .filter(f -> f.isVisible() && f.getMessage() != null && (f.getMessage().contains(TEXT_LOOKUP_CLICKHERETOCONTINUE) || f.getMessage().contains(TEXT_LOOKUP_CLICKTOCONTINUE)))
                .findFirst()
                .orElse(null);
    }

 

Edited by NoxMerc
Posted
10 hours ago, NoxMerc said:

It's hard to go off your word alone when both Explv and myself have working TutIsland scripts relying on the notion of "Click to Continue", and you haven't given us the latest code that's producing the issues you're describing.


    public static RS2Widget getClickToContinueWidget(ScriptContext ctx) {
        return ctx.getWidgets()
                .getAll()
                .stream()
                .filter(f -> f.isVisible() && f.getMessage() != null && (f.getMessage().contains(TEXT_LOOKUP_CLICKHERETOCONTINUE) || f.getMessage().contains(TEXT_LOOKUP_CLICKTOCONTINUE)))
                .findFirst()
                .orElse(null);
    }

 

He is trying to explain to you that he does not want the bot to draw a box around the word “Please waiting” he wants the script to sleep when it does not see “Click to Continue”. And the only problem is that OSBot does not have the “Please wait” widget available.

He is a perfectionist. His script already clicks to continue he just wants it to sleep when it doesn’t ask to click. 

I think it’s an anti ban method he is working on for Botting multiple tut island accounts.

Posted

There's already a method that'll find widgets containing text. Try it:

public boolean isContinueWidgetVisible() {
	List<RS2Widget> l = widgets.containingText("Click here to continue", "Click to continue");
	return l != null && !l.isEmpty();
}

Then you could do something like:

ConditionalSleep sleepyTime;

if (isContinueWidgetVisible()) { // can we continue?
	
	if (keyboard.typeString(" ", false)) { // k let's try press space bar (false = no pressy enter!)
		
		sleepyTime = new ConditionalSleep(5000) { // k now lets create new conditional sleep
			
			@Override
			public boolean condition() throws InterruptedException {
				return !isContinueWidgetVisible();
			}
		};
		
		// k now let's see if sleepy wakes up
		if (sleepyTime.sleep()) {
			// yay interface went away!
		}
	}
}

 

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