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.

Hotkeys

Featured Replies

A useful tool if you need quick reactions or whatnot.

import java.awt.event.KeyEvent;
import org.osbot.rs07.api.ui.Tab;
import org.osbot.rs07.script.MethodProvider;
import org.osbot.rs07.script.Script;

/**
 * Tabs and their respective hotkey keycodes
 *
 * @author FrostBug
 */
public enum TabHotkey {

	COMBAT(Tab.ATTACK, 0, 1224),
	SKILLS(Tab.SKILLS, 1, 1224),
	QUEST(Tab.QUEST, 2, 1224),
	INVENTORY(Tab.INVENTORY, 3, 1224),
	EQUIPMENT(Tab.EQUIPMENT, 4, 1224),
	PRAYER(Tab.PRAYER, 5, 1224),
	MAGIC(Tab.MAGIC, 0, 1225),
	CLAN(Tab.CLANCHAT, 1, 1225),
	FRIENDS(Tab.FRIENDS, 2, 1225),
	IGNORE(Tab.IGNORES, 3, 1225),
	SETTINGS(Tab.SETTINGS, 4, 1225),
	EMOTES(Tab.EMOTES, 5, 1225),
        LOGOUT(Tab.LOGOUT, 1, 1226);

	private final Tab tab;
	private final int index;
	private final int register;

	private final static int[] KEYCODES = {
		-1,
		KeyEvent.VK_F1,
		KeyEvent.VK_F2,
		KeyEvent.VK_F3,
		KeyEvent.VK_F4,
		KeyEvent.VK_F5,
		KeyEvent.VK_F6,
		KeyEvent.VK_F7,
		KeyEvent.VK_F8,
		KeyEvent.VK_F9,
		KeyEvent.VK_F10,
		KeyEvent.VK_F11,
		KeyEvent.VK_F12,
		KeyEvent.VK_ESCAPE
	};

	private TabHotkey(Tab tab, int index, int register) {
		this.tab = tab;
		this.index = index;
		this.register = register;
	}

	/**
	 * Gets the Tab associated with this hotkey
	 * @return Associated Tab
	 */
	public Tab getTab() {
		return tab;
	}

	/**
	 * Gets the hotkey assigned to this tab
	 * @param parent Script context
	 * @return The hotkey VK KeyCode, or -1 if no hotkey is assigned
	 */
	public int getHotkey(Script parent) {
		int config = parent.getConfigs().get(this.register);
		int kcIndex = (config >> (this.index * 5)) & 0b11111;
		return KEYCODES[kcIndex];
	}

	/**
	 * Opens the given tab using the assigned hotkey
	 * @param parent Script context
	 * @return False if no hotkey is assigned to this tab
	 * @throws InterruptedException 
	 */
	public boolean openTab(Script parent) throws InterruptedException {
		if(!isAssigned(parent)) return false;
		int hkey = getHotkey(parent);
		parent.getKeyboard().pressKey(hkey);
		try {
			MethodProvider.sleep(MethodProvider.random(20, 50));
		} finally {
			parent.getKeyboard().releaseKey(hkey);
		}
		return true;
	}
	
	/**
	 * Has this tab been assigned a hotkey?
	 * @param parent Script context
	 * @return False if there is no hotkey assigned to this tab
	 */
	public boolean isAssigned(Script parent) {
		return getHotkey(parent) != -1;
	}
	
	/**
	 * Gets a TabHotkey by its Tab
	 * @param tab The associated Tab
	 * @return Null if no match is found
	 */
	public static TabHotkey forTab(Tab tab) {
		for(TabHotkey thk : values()) {
			if(thk.getTab() == tab) {
				return thk;
			}
		}
		return null;
	}
}

Edited by FrostBug

Nice :)

There's also logout (in 1226) and to check if esc is enabled to close widgets you can AND 1224 with 0x80000000

  • 4 weeks later...
  • 5 months later...
  • 2 months later...

ty for this.

 

Forever leeching ur snippets bro QwPha8E.png

 

FrostHopper doge.png

 

P.S could u release the snippet of handling uncle jad :troll: 

 k thx

Edited by Saiyan

  • 3 months later...

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.