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.

Getting all object in a range

Featured Replies

How do I get all Objects in a range?

 

Lets say i wanna get all Bird_snare object in a range of 10 what whould be the best way to do that?

 

 

To get every object, you'll need to use streams:

int rad = 10;
String name = "bird snare"; //case doesn't matter
List<Entity> list = getObjects().getAll().stream().filter((e) -> (e != null && e.exists() && e.getName().equalsIgnoreCase(name) && getMap().distance(e) <= rad)).collect(Collectors.toList());

Take a look at my streams tutorial to learn more.

 
 
 
EDIT: getObjects() also has a filter() method, however I prefer streams.

Edited by Bobrocket


List<RS2Object> objs = getObjects().filter(o -> myPosition().distance(o) < 10 && "Bird snare".equals(o.getName()));

Edited by FrostBug

  • Author
List<RS2Object> objs = getObjects().filter(o -> myPosition().distance(o) < 10 && "Bird snare".equals(o.getName()));

Thanks for the code but getting error on the ( -> )  , osbot syntax error on "-" -- expected.

 

Does "o" supposed have value?

or do i have to import something?

 

(Srry, I'm not to familiar with these types of complicated code in OSbot)

Thanks for the code but getting error on the ( -> )  , osbot syntax error on "-" -- expected.

 

Does "o" supposed have value?

or do i have to import something?

 

(Srry, I'm not to familiar with these types of complicated code in OSbot)

 

Like soldtodie said, you have to install Java 8, and set the source version of your project to 8

 

  • 2 weeks later...
  • Author

Like soldtodie said, you have to install Java 8, and set the source version of your project to 8

 

 

i have changed my JDK java from 1.7 to 1.8 but it seems the problem is still ocuring in eclipse

 

would you mind helping me : - )

(or pushing me in the right direction)

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.