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.

Where to find key types?

Featured Replies

So in my bot I need the bot to press key 2 (To make an item, can't be asked getting the widget shit for it) I know the keyboard key type for space is 32 but how can I find out the keyboard type for 2? E.G Space is 
 

getKeyboard().typeKey((char) 32);

A simpler method would be to use:

  • keyboard.typeString("2"); for 2
  • keyboard.typeString(" "); for space

Another example:

    public void example() throws InterruptedException    {
       
            if (//something) {
                        keyboard.typeString("2");
                new ConditionalSleep(200, 200) {
                    @Override
                    public boolean condition() {
                        return //somethingelse;
                    }
                }.sleep();
            }
        }

or if you want to use widgets:

    public void example2() throws InterruptedException    {
        
        RS2Widget test= getWidgets().get(458, 1);
        
            if (test!= null && test.isVisible()) {
                        keyboard.typeString("2");
                new ConditionalSleep(200, 200) {
                    @Override
                    public boolean condition() {
                        return (//something);
                    }
                }.sleep();
            }
        }

 

Edited by Lol_marcus

I would use 

getKeyboard().typeKey(KeyEvent.VK_SPACE);  and  getKeyboard().typeKey(KeyEvent.VK_2);

or 
getKeyboard().typeKey(' ');   and getKeyboard().typeKey('2');

I don't see why you would hardcode it with a value that is not 100% obvious (to you in a few weeks of not working on it and others tring to read your code).

 

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.