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.

Check for players in your area

Featured Replies

	public boolean checkforPlayers(int area) {
		java.util.List<Player> playerss = players.getAll();
		for (Player p : playerss) {
			if (myPlayer().getArea(area).contains(p) && !p.getName().equals(myPlayer().getName())) {
				return true;
			}
		}
		return false;
	}

Returns true if there's players around your area. (excluding yourself)

I use this generally like this:

 

if(checkforPlayers(7) && random(0,25) == 0){
/* do world hop*/
}

Nitpicking, but performance-wise you could do this:

 

EDIT: Do not use this, is 10x slower

return (getPlayers().filter(n -> myPlayer().getArea(area).contains(n)).size() > 1);

Edited by Abuse

Performance wise that's probably exact the same.

It just looks more neat ^^

 

It's no longer comparing strings nor reserving memory for the entire list, thats a slight performance benefit

 

Edited by Abuse

It gets converted to the exact same java byte code when its compiled.

The only benefit is that it looks more neat ^^

 

Nevermind, I take my suggestion back. After some testing it appears that filters are highly inefficient (300 ms vs 3000ms for 10000 loops)

Nevermind, I take my suggestion back. After some testing it appears that filters are highly inefficient (300 ms vs 3000ms for 10000 loops)

 

Do remember though, at most there can be 2000 players on and therefore can at most be 2000 loops for it. And worst case probably like ~600 anyway. It looks neat asf so worth.

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.