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.

[HELP NEEDED] Interacting with dialogues & and sending keystrokes through osbot(ex. 1, 2 ,3 etc)

Featured Replies

Hey guys, got this little idea for an "assistive" script. Basically the only thing i want it to do is to press the proper number key for a certain answer in a dialogue window when the dialogue is active. so basically I'm going self-play but with a script quick skipping a certain dialogue now and then. I'm still very fresh to osbot and java scripting, so far I've only made a shop-buyer that quick hops between worlds, very basic stuff. The info and help I'm looking for is maybe an example/snippet that shows how to send keystrokes with osbot when a certain dialogue is open.

Hopefully this is not too much to ask for, if I manage to make something cool out of it I'll just share it here and give back to the forum for helping!

something like

dialogues.selectOption

but that instead of clicks with the mouse use the corresponding hotkey for the answer.

Edited by dot_b0T

Something like this could do what you need:

final String[] DIALOGUE_OPTIONS = {
	"Dialogue option",
};

void solveDialogue() throws InterruptedException {
	if (getDialogues().inDialogue()) {
		// In dialogue, try and find a widget for our option
		RS2Widget widget = getWidgets().getWidgetContainingText(DIALOGUE_OPTIONS);
		if (widget != null && widget.isVisible()) {
			// Widget exists and is visible, solve it
			getKeyboard().typeString(""+widget.getThirdLevelId(), false);
			sleep(2000); // Some sleep to prevent spamming
		}
	}
}

Just populate DIALOGUE_OPTIONS with the choices you want to make, and call "solveDialogue()" in onLoop.

  • Author
8 minutes ago, Lemons said:

Something like this could do what you need:


final String[] DIALOGUE_OPTIONS = {
	"Dialogue option",
};

void solveDialogue() throws InterruptedException {
	if (getDialogues().inDialogue()) {
		// In dialogue, try and find a widget for our option
		RS2Widget widget = getWidgets().getWidgetContainingText(DIALOGUE_OPTIONS);
		if (widget != null && widget.isVisible()) {
			// Widget exists and is visible, solve it
			getKeyboard().typeString(""+widget.getThirdLevelId(), false);
			sleep(2000); // Some sleep to prevent spamming
		}
	}
}

Just populate DIALOGUE_OPTIONS with the choices you want to make, and call "solveDialogue()" in onLoop.

 

3 minutes ago, Chris said:

Thank you so much guys for the spot on replies, exactly what i was looking for. This will keep me occupied for a while gonna play and fool around with this now for a bit.

Dialogue API does this for you; I mean you could re-write your own Dialogue API, not sure what that would achieve though.

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.