Skip 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.

Selecting ALL npcs or ground items.

Featured Replies

How would I go about selecting all of the nearby same npcs or geounditems , specifically - I want to drawmodel of all of the al-Kharid warriors && arrows on the ground 

 currently I’m using npcs.closest(“al-Kharid warrior”) and the same for the ground items and it works great and all but it only selects (obviously) the closest to me. When two are the same distance away it just jumps between both. 

  • Author

Yea, I seen that in the api and I tried using it - but I don’t properly know how to I guess. 

  • Author

More specifically

npcs.getAll(“al-kharid warrior”);

does not work the same as closest, what am I doing wrong ?

Try this:

List<NPC> t = getNpcs().getAll().stream().filter((n) -> n.getName().equals("al-kharid warrior")).collect(Collectors.toList());

I suggest tho doing it out long way before doing this one ^.

Edited by dreameo

8 hours ago, sonda said:

More specifically

npcs.getAll(“al-kharid warrior”);

does not work the same as closest, what am I doing wrong ?

It's because getall will scan the whole area and check for npcs of that name. It'll then add it to a list which is far different from just using npc.closest(). 

If you want to highlight all the monsters/ground items you simply have to loop through the list in onPaint and draw their models/tiles and what not. 

Just make sure to null check! Else you'll be in for a treat :3

4 hours ago, Satire said:

It's because getall will scan the whole area and check for npcs of that name. It'll then add it to a list which is far different from just using npc.closest(). 

If you want to highlight all the monsters/ground items you simply have to loop through the list in onPaint and draw their models/tiles and what not. 

Just make sure to null check! Else you'll be in for a treat :3

not null checking is the best feeling ever, don't you just love when the game freezes?

13 hours ago, sonda said:

How would I go about selecting all of the nearby same npcs or geounditems , specifically - I want to drawmodel of all of the al-Kharid warriors && arrows on the ground 

 currently I’m using npcs.closest(“al-Kharid warrior”) and the same for the ground items and it works great and all but it only selects (obviously) the closest to me. When two are the same distance away it just jumps between both. 

 

12 hours ago, dreameo said:

Try this:


List<NPC> t = getNpcs().getAll().stream().filter((n) -> n.getName().equals("al-kharid warrior")).collect(Collectors.toList());

I suggest tho doing it out long way before doing this one ^.

 

Simplest way would be:

List<NPC> warriors = getNpcs().filter(new NameFilter<>("Al-Kharid warrior"));

 

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.