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.

Useful Snippets I Use

Featured Replies

Hi,

I will keep this thread updated with snippets of code I find useful. If the code is not mine I will tag/link/name creator.

/**
     * Moves the item found by itemName to the tab defined by tabNumber in the bank.
     * @param itemName The String itemName of the item.
     * @param tabNumber The tab number starting from 0, 0 is the global tab, 1 is the first tab etc.
     * @return Returns true if success, false if failed at any point.
     */
    public boolean moveItemToTab(String itemName, int tabNumber)
    {
    	RS2Widget tabWidget = getWidgets().get(12, 10, tabNumber); // Here we get the widget that refers to the tab we want to send it to inside the bank.
    	Item item = getBank().getItem(itemName); // Here we get the instance of the item we want to move. (Item must be in bank)
    	if(tabWidget != null && item != null)
    	{
    		Rectangle tabClickRectangle = tabWidget.getBounds(); // Here we get the bounding box for the widget (spot we must click)
    		RectangleDestination tabDestination = new RectangleDestination(bot, tabClickRectangle); // Here we make that bounding box into a destination the mouse can use
    		
    		item.hover(); // Here we move the mouse to the item we want to move.
    		
    		Rectangle currentPos = new Rectangle((int) getMouse().getPosition().getX(), (int) getMouse().getPosition().getY(), 1, 1); // Here we get the mouses current position after moving to the item.
    		RectangleDestination currentDestination = new RectangleDestination(bot, currentPos); // Create destination for the current position.
    		
    		return getMouse().continualClick(currentDestination, new Condition() { // Here we move from the current positon, to the tab's destination.
    			public boolean evaluate() {
    				getMouse().move(tabDestination, true);
    				return tabClickRectangle.getBounds().contains(getMouse().getPosition());
    			}
    		});
    	}
    	else
    		return false;
    	
    	
    }

Nice snippet out, Really useful.

Hope to see more from you bro, Good luck!

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.