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.

Entity Lifecycle

Featured Replies

Lets say I query for some Entity and store it to a variable. 

List<RS2Object> visibleTrees1 = objects.filter(
  new ContainsNameFilter<>("tree"),
  rs2Object -> !rs2Object.getName().contains("Tree stump") &&
  rs2Object.isVisible() &&
  myPlayer().getPosition().distance(rs2Object.getPosition()) <= 5
);

Rs2Object myReference = visibleTrees.get(0);

For how long is that instance (myReference) valid for interaction events?

If I leave the area and come back, can I still use the instance I queried before? Or has it gone stale and need to be re-queried? 

  • Author

I think the answer is until I walk far enough to hit a loading screen. The RS would get the set of objects in the newly loaded game area which would then be intercepted by osbot and made available through the api. The instances from the previous area would be available to the JVM for garbage collection. 

Going to test that hypothesis

Edited by PayPalMeRSGP

  • Author
45 minutes ago, PayPalMeRSGP said:

I think the answer is until I walk far enough to hit a loading screen. The RS would get the set of objects in the newly loaded game area which would then be intercepted by osbot and made available through the api. The instances from the previous area would be available to the JVM for garbage collection. 

Going to test that hypothesis

Seems the be the case. I walk away, trigger a load then the hashcode of the instance changes when I come back. 

[INFO][Bot #1][11/15 09:09:19 PM]: Querying Entity
[INFO][Bot #1][11/15 09:09:19 PM]: org.osbot.rs07.api.model.InteractableObject@60beb29d
[INFO][Bot #1][11/15 09:09:19 PM]: Optional[org.osbot.rs07.api.model.Model@52697857]
Walk and return...
[INFO][Bot #1][11/15 09:10:05 PM]: Querying Entity
[INFO][Bot #1][11/15 09:10:05 PM]: org.osbot.rs07.api.model.InteractableObject@856ac72
[INFO][Bot #1][11/15 09:10:05 PM]: Optional[org.osbot.rs07.api.model.Model@f00a947]

Same situation for if the entity is consumed (Tree chopped)

 

2 hours ago, PayPalMeRSGP said:

Lets say I query for some Entity and store it to a variable. 

List<RS2Object> visibleTrees1 = objects.filter(
  new ContainsNameFilter<>("tree"),
  rs2Object -> !rs2Object.getName().contains("Tree stump") &&
  rs2Object.isVisible() &&
  myPlayer().getPosition().distance(rs2Object.getPosition()) <= 5
);

Rs2Object myReference = visibleTrees.get(0);

For how long is that instance (myReference) valid for interaction events?

If I leave the area and come back, can I still use the instance I queried before? Or has it gone stale and need to be re-queried? 

Until it unloads or if it's not there anymore I believe

Edited by Khaleesi

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.