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.

Amount of people around entity

Featured Replies

 

I made this snippet for my wood cutter.  You can use the code to check how many people are surrounding any entity.  

First import

import static java.lang.Math.toIntExact;

Here is the snippet.  

e = the entity you are checking

areaSize = the size of the area around the entity you want to check.

private int peopleAroundEntity (Entity e, int areaSize){
        return toIntExact(players.getAll().stream().filter(x -> e.getArea(areaSize).contains(x)).count());
    }

And this is how I used the snippet

private Predicate<RS2Object> bestTree = tree ->
            tree != null &&
            chopArea.contains(tree) &&
            tree.getName().equalsIgnoreCase(treeType) &&
            tree.hasAction("Chop down") &&
            peopleAroundEntity(tree, 2) <= 3;

java.util.List<RS2Object> tree = getObjects().getAll().stream().filter(bestTree).collect(Collectors.toList());

Then from there you can sort the list as you want. For this script, I have it sorted by distance

tree.sort(Comparator.<RS2Object>comparingInt(a -> getMap().realDistance(a))
                                .thenComparingInt(b -> getMap().realDistance(b)));

The whole script can be found on my github

https://github.com/MeatRainbow/Wood_Chopper

 

Hope this helps someone

Create an account or sign in to comment

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.