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

API Suggestion: Client#getCustomKeybinds (and more)

Featured Replies

With the introduction of custom keybinds, these could be super useful. It could also be utilised as an antipattern device too.

859008b58683997bef923a33e877ebe6.png

 

This could really help.

Suggested Methods:

Client#getCustomKeybinds()

Client#getCustomKeybind(InterfaceTab tab)

Client#getEscCloseCurrentInterface()

 

Client#getCustomKeybinds() - Gets all the custom keybinds, in a HashMap<InterfaceTab, char> or some form of Map.

Client#getCustomKeybind(InterfaceTab tab) - Gets a custom keybind, specified by the InterfaceTab.

Client#getEscCloseCurrentInterface() - Returns true/false depending on whether or not the checkbox for "Esc closes current interface" is ticked.

 

 

Why add these methods?

A few implementations I can think of:

  • In some skills, when you level up you will stop your action. Being able just to send a keypress of "esc" helps as you do not need to hard code the widgets (in a way, so if you're doing numerous skills at once in a script for example)
  • Can be used as an antipattern of sorts - sometimes the user can click the close manually, other times the user can press escape

 

Thanks :)

There really are no circumstances where you have to hard code widgets, even for the parents. I'm going to look and see where the binds are saved and use them for the option of clicking on the widget or sending the key bind click (F1, F2, etc). Chances are this won't come to life until late August but it's something I've already thought about. For the meantime I'll move it over to the accepted forum. 

  • Author

There really are no circumstances where you have to hard code widgets, even for the parents. I'm going to look and see where the binds are saved and use them for the option of clicking on the widget or sending the key bind click (F1, F2, etc). Chances are this won't come to life until late August but it's something I've already thought about. For the meantime I'll move it over to the accepted forum. 

 

They were simply implementations that I came up with on the top of my head.

I think you should be able to toggle in the API whether or not to send keypresses or click on a tab to open it (Client#openTabByKeypress(boolean) anyone?)

They were simply implementations that I came up with on the top of my head.

I think you should be able to toggle in the API whether or not to send keypresses or click on a tab to open it (Client#openTabByKeypress(boolean) anyone?)

 

I'll probably have some sort of boolean in the action constructor. Tabs.open(Tab, boolean useBind).

  • Author

I'll probably have some sort of boolean in the action constructor. Tabs.open(Tab, boolean useBind).

 

That works even better :)

I will make a class for it. (for getting)

Was already working on it, mine doesn't support emote/music but I'm too lazy to fix it biggrin.png 

public class FKeys {

    private static final int CONFIG1 = 1224, CONFIG2 = 1225, CONFIG3 = 1226;

    public static Key get(MethodProvider api, Tab t) {
        int c = t.getId() < Tab.MAGIC.getId() ? CONFIG1 : t.getId() < Tab.LOGOUT.getId() ? CONFIG2 : CONFIG3;
        int i = t.getId() < Tab.MAGIC.getId() ? t.getId() : t.getId() < Tab.LOGOUT.getId() ? t.getId() - Tab.MAGIC.getId() : t.getId() - Tab.LOGOUT.getId()+1;

        if(t.equals(Tab.SETTINGS))
            return Key.values()[(api.configs.get(CONFIG2) >> 20) & 0xF];

        return Key.values()[ (api.configs.get(c) >> (i*5)) & 0x1F];
    }

    public static boolean escEnabled(MethodProvider api) {
        return (api.configs.get(CONFIG1) & 0x80000000) == 0x80000000;
    }


    enum Key {
        NONE(-1),
        F1(KeyEvent.VK_F1),
        F2(KeyEvent.VK_F2),
        F3(KeyEvent.VK_F3),
        F4(KeyEvent.VK_F4),
        F5(KeyEvent.VK_F5),
        F6(KeyEvent.VK_F6),
        F7(KeyEvent.VK_F7),
        F8(KeyEvent.VK_F8),
        F9(KeyEvent.VK_F9),
        F10(KeyEvent.VK_F10),
        F11(KeyEvent.VK_F11),
        F12(KeyEvent.VK_F12),
        ESC(KeyEvent.VK_ESCAPE);

        final int keyid;


        Key(int keyid) {
            this.keyid = keyid;
        }
    }



}

Edited by Flamezzz

Was already working on it, mine doesn't support emote/music but I'm too lazy to fix it biggrin.png 

public class FKeys {

    private static final int CONFIG1 = 1224, CONFIG2 = 1225, CONFIG3 = 1226;

    public static Key get(MethodProvider api, Tab t) {
        int c = t.getId() < Tab.MAGIC.getId() ? CONFIG1 : t.getId() < Tab.LOGOUT.getId() ? CONFIG2 : CONFIG3;
        int i = t.getId() < Tab.MAGIC.getId() ? t.getId() : t.getId() < Tab.LOGOUT.getId() ? t.getId() - Tab.MAGIC.getId() : t.getId() - Tab.LOGOUT.getId()+1;

        if(t.equals(Tab.SETTINGS))
            return Key.values()[(api.configs.get(CONFIG2) >> 20) & 0xF];

        return Key.values()[ (api.configs.get(c) >> (i*5)) & 0x1F];
    }

    public static boolean escEnabled(MethodProvider api) {
        return (api.configs.get(CONFIG1) & 0x80000000) == 0x80000000;
    }


    enum Key {
        NONE(-1),
        F1(KeyEvent.VK_F1),
        F2(KeyEvent.VK_F2),
        F3(KeyEvent.VK_F3),
        F4(KeyEvent.VK_F4),
        F5(KeyEvent.VK_F5),
        F6(KeyEvent.VK_F6),
        F7(KeyEvent.VK_F7),
        F8(KeyEvent.VK_F8),
        F9(KeyEvent.VK_F9),
        F10(KeyEvent.VK_F10),
        F11(KeyEvent.VK_F11),
        F12(KeyEvent.VK_F12),
        ESC(KeyEvent.VK_ESCAPE);

        final int keyid;


        Key(int keyid) {
            this.keyid = keyid;
        }
    }



}

 

 

I'll probably look at this again in late August. Where is your scripter rank?

  • 3 years later...
  • Developer

Client#getEscCloseCurrentInterface() is present  as Settings#escClosesCurrentInterface()

I have added Tabs#open(Tab tab, boolean useBind) which tries to use a key if possible.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.