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.

Get and check id of an object?

Featured Replies

Hello

Is there a way to get and check the id of an object?

I need to check if the id of the object in question has change in the script.

  • Author

Isnt there a built one on the client

 

I don't know, I looked for it for like 10 mins, but I can't find it... :(

I'm not sure you understand the question.

 

Are you asking how to check the ID of an object ? if so go into settings and open the 'Entity Debugger'. Then hover over the entity in question and it will tell you the id.

 

Or....

 

Did you mean how do you get the id of an entity dynamically in the code?

Entity e = objects.closest("name");
int id = e.getId();

Apaec

  • Author

 

Did you mean how do you get the id of an entity dynamically in the code?

Entity e = objects.closest("name");
int id = e.getId();

Apaec

 

Thank you, that was exactly what I was looking for.

Edited by kocke

  • 1 year later...

There are multiple ways of finding objects

 

One is using an id:

RS2Object myObject = getObjects().closest(2565);

Another way would be using the object name:

RS2Object myObject = getObjects().closest("Bank booth");

and if you want to match on a specific variable of an object you could use filters:

Filter<RS2Object> modelIdFilter = new Filter<RS2Object>() {
   public boolean match(RS2Object n) {
      return (n.getModel() == 1234);
   }
};      

RS2Object myObject = self.getObjects().closest(modelIdFilter);

after that you can use myObject.getId() to get the ID value of that object

 

Edit: Just realized when this post was made :(

Edited by Abuse

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.