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.

Typing issue

Featured Replies

	public void typeString(final String string) throws InterruptedException {
		for (Character character : string.toCharArray()) {
			getBot().getKeyEventHandler().generateBotKeyEvent(KeyEvent.KEY_PRESSED, System.currentTimeMillis(), 0, KeyEvent.getExtendedKeyCodeForChar(character), character);
			sleep(random(50, 100));
			getBot().getKeyEventHandler().generateBotKeyEvent(KeyEvent.KEY_RELEASED, System.currentTimeMillis(), 0, KeyEvent.getExtendedKeyCodeForChar(character), character);	
		}
	}

So i came up with this but doesn't work, could someone help me out ?

                                getKeyboard().pressKey(KeyEvent.VK_PAGE_UP);

                                getKeyboard().pressRelease(KeyEvent.VK_PAGE_UP);

 

  • Author
15 hours ago, Juggles said:

                                getKeyboard().pressKey(KeyEvent.VK_PAGE_UP);

                                getKeyboard().pressRelease(KeyEvent.VK_PAGE_UP);

 

for (Character character : string.toCharArray()) {
		getKeyboard().pressKey(KeyEvent.getExtendedKeyCodeForChar(character));
		sleep(random(50, 100));
		getKeyboard().releaseKey(KeyEvent.getExtendedKeyCodeForChar(character));
}

Doesn't seem to work either, am i doing something wrong ?

@Alek

Edited by Ayylmao420

  • Author
55 minutes ago, Alek said:

Keyboard typeString(String string)
 

I wan't to have more control over typing, could you explain me why generateBotKeyEvent doesn't work in my case ?

Just now, Ayylmao420 said:

I wan't to have more control over typing, could you explain me why generateBotKeyEvent doesn't work in my case ?

It does what you want, it types a string. If you don't want to use the front API then you should really know how the back API works.

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.