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.

Region positions

Featured Replies

Untested but it seems like it could work

/**
 * 
 * @param position to check if it is within the region
 * @param player the current position of the player (myPosition())
 * @return true if the position is within the region with respect to our players position
 */
public boolean isReachable(Position position, Position player) {
    int HOW_BIG_IS_REGION = 20;//idk how big a region is
    Position insidePos = new Position(position);
    int distance = insidePos.distance(player);
    
    //If the distance from the region is less than our current position, it is reachable
    return distance < HOW_BIG_IS_REGION;
}
Just noticed there's already a function for this:

map.canReach(position);

Edited by Hayase

not sure why you want to do it

 

but something like this is probably the most efficient, performance-wise

	private boolean isLoaded(Position pos) {
		return pos.getX() > getMap().getBaseX() && pos.getX() < (getMap().getBaseX() + 104)
				&& pos.getY() > getMap().getBaseY() && pos.getY() < getMap().getBaseY() + 104;
	}

Regions are 104x104

 

EDIT: Didn't test above method, btw

Edited by FrostBug

  • Author

not sure why you want to do it

 

but something like this is probably the most efficient, performance-wise

	private boolean isLoaded(Position pos) {
		return pos.getX() > getMap().getBaseX() && pos.getX() < (getMap().getBaseX() + 104)
				&& pos.getY() > getMap().getBaseY() && pos.getY() < getMap().getBaseY() + 104;
	}

Regions are 104x104

 

EDIT: Didn't test above method, btw

Should works, thanks boge.png

 

EDIT; For custom walker.

Edited by Ayylmao420

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.