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.

how to check for closest two objects?

Featured Replies

I have a simple hunter script I'm working on which works for 1 trap, but I dont know how to make it work for multiple traps. This is due to the fact that I use :

 

Entity ready = objects.closest(9345);

 

as a means of detecting my traps. objects.closest only works on one object so I need to find a way to deal with multiple. Thanks :)

I have never had a need to do this, but you can just store one:

 

 

Entity ready = objects.closest(9345);

Entity second = objects.closest(new Filter blah blah 

     in this filter return false if the object.equals(ready));

  • Author

I have never had a need to do this, but you can just store one:

 

 

Entity ready = objects.closest(9345);

Entity second = objects.closest(new Filter blah blah 

     in this filter return false if the object.equals(ready));

 

but if it returns false when the closest object is ready, would it pick up the closest object after ready ,or would it just be null basically?

but if it returns false when the closest object is ready, would it pick up the closest object after ready ,or would it just be null basically?

it will ignore the ready enitty and look for whatever fits the best filter.

but if it returns false when the closest object is ready, would it pick up the closest object after ready ,or would it just be null basically?

 

 

Are you trying to check if a trap fell? If so you only need to store one fallen trap. If you have a loop going, and you are constantly checking for a closest object (the fallen trap), say you have 2 fallen traps, it will store the first one, then you can operate on it, i.e. pick it up and reset it. Then the loop goes again checking for another fallen trap, you just set one, so there is one left on the ground, it will then store that one, you put it back up, and move on. You just need to check for one fallen trap. If you store multiple fallen traps you will over complicate your script unnecessarily. You cant operate on more than 1 fallen trap at a time anyway.

  • Author

alright i tried the filter and it works :) thanks a lot friends. also if you are using object entities and you are in a place where there a shit ton of objects(like the jungle) will all these objects mess up the bot trying to find a specific object?

alright i tried the filter and it works smile.png thanks a lot friends. also if you are using object entities and you are in a place where there a shit ton of objects(like the jungle) will all these objects mess up the bot trying to find a specific object?

 

If i'm reading this correctly, no it shouldn't objects.closest("whatever string" or whatever id) you have in here will only be looked for, not anything else.

 

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.