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.

keyboard.pressKey does not work on dialog (OR ANYWHERE)

Featured Replies

I want to make my own dialog solver because the default one takes too long. IE i'd like to press the option >before< it appears like a human would do to save ticks. 

 

Here is the code: (insert code button infintely lagging for me rn..)

Quote

    boolean rel;

    @Override
    public int onLoop() {
        if (rel) {
            log("Release");
            keyboard.releaseKey(KeyEvent.VK_1);
            rel = false;
        } else {
            log("Press");
            keyboard.pressKey(KeyEvent.VK_1);
            rel = true;
            return 600;
        }

 

No combination of keys (numbers, space) or delays seems to work. It does print press and release, but the dialog is unchanged. Pressing 1 on the keyboard instantly passes the dialog.

I have also tried this:

Quote

bot.getKeyEventHandler().generateBotKeyEvent(KeyEvent.PRESS, System.currentTimeMillis(), 0, KeyEvent.VK_1, '1'); 

 

That does not work either.

 

However, this does work:

Quote

keyboard.typeKey('1', 0, 0, false);

But it is much too slow for what I'm trying to do. It does not seem to accept my time argument, and takes 100ms or so regardless of it.

Any help or workarounds? 

 

EDIT: yeah it seems to refuse to type in the chatbox either. Am I just doing it wrong or is it actually broke? :(

EDIT2: This does indeed work:  keyboard.pressKey(KeyEvent.VK_F1); F keys work, just not regular keys 

 

THANK YOU!

Edited by top kek

19 minutes ago, top kek said:

 

I just do getKeyboard().typeString() for non fkeys 

  • Author
5 hours ago, FuryShark said:

I just do getKeyboard().typeString() for non fkeys 

thats too slow i need it to type in 40ms

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.