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.

Examine Random RS2Object

Featured Replies

I'm having trouble obtaining RS2Objects around my character which contain the Examine action. I use the following line to try to do so, yet its size is always 0. I am trying to examine things like trees and whatnot.

 

List<RS2Object> objectsNearby = mp.getObjects().filter(o -> o.hasAction("Examine"));

 

It will be something like:

RS2Object nearestExaminableObject = getObjects().closest(a -> a.hasAction("Examine") && a.getPosition().distance(myPosition()) <= 7);
if (nearestExaminableObject != null) {
nearestExaminableObject.interact("Examine");
} else {
log("Waiting until an examinable object is nearby");
}

  • Author

 

1 hour ago, Czar said:

It will be something like:

RS2Object nearestExaminableObject = getObjects().closest(a -> a.hasAction("Examine") && a.getPosition().distance(myPosition()) <= 7);
if (nearestExaminableObject != null) {
nearestExaminableObject.interact("Examine");
} else {
log("Waiting until an examinable object is nearby");
}

 

Thanks! I see you've called .closest() which only returns a single RS2Object. I was hoping to obtain a List of them all. Do you know if such a thing is possible?

Edited by bobbybill123

  • Author

Oddly enough, even the simple call getObjects().closest(a -> a.hasAction("Examine"));  returns null despite being surrounded by trees with examine text.

On 12/5/2024 at 4:38 AM, bobbybill123 said:

Oddly enough, even the simple call getObjects().closest(a -> a.hasAction("Examine"));  returns null despite being surrounded by trees with examine text.

To get a list you need to collect the objects like so

List<RS2Object> objectsNearby = mp.getObjects().stream().filter(o -> o.hasAction("Examine")).collect(Collectors.toList());

 

  • Author
13 hours ago, DCHILLING said:

To get a list you need to collect the objects like so

List<RS2Object> objectsNearby = mp.getObjects().stream().filter(o -> o.hasAction("Examine")).collect(Collectors.toList());

 

I have tried 

List<RS2Object> nearbyObjects = mp.getObjects().getAll().stream().filter(o -> o.hasAction("Examine")).collect(Collectors.toList());

but this too returns an empty list.

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.