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.

finding npc help

Featured Replies

What im trying to do is find a specific npc

 

When he is the region of the minimap as a yellow dot or you can see him on screen visually, it finds him but when he is not in that specific region 

I have trouble scripting to find him

 

can anyone shed some light on this?

 

thanks in advance

 

 


Area yourArea = new Area(...);

NPC npc = getNpcs().filter(npc -> npc != null && yourArea.contains(npc) && npc.getName().equals("NPC NAME"));

Area yourArea = new Area(...);
NPC npc = getNpcs().filter(npc -> npc != null && yourArea.contains(npc) && npc.getName().equals("NPC NAME"));

 

Will work great if the NPC is in the area, bu here's some messy code to walk to npc if it's too far away

Filter npcFilter = new Filter<NPC>() {
			public boolean match(NPC npc) {
				return npc != null && npc.getName().equals("NPC NAME");
			}
		};
		NPC npc = npcs.closest(npcFilter);
		if (npc != null) {
			if (npc.isVisible()) {
				//Interact
			} else {
				Area npcArea = npc.getArea(6); // Radius around the NPC
				if (!npcArea.contains(myPlayer())) {
					walking.walk(npcArea);
				} else {
					camera.toEntity(npc);
				}
			}
			
		}

Edited by nosepicker

semi-related to this thread, but every time i use id's in my code for npcs it laggs client...
am i doing something wrong in this code?
 

NPC npc = getNpcs().closest(420);
npc.interact("use");

and before you say to use Filters/names that won't work in this situation.
sorry for being autism

 

semi-related to this thread, but every time i use id's in my code for npcs it laggs client...

am i doing something wrong in this code?

 

NPC npc = getNpcs().closest(420);
npc.interact("use");

and before you say to use Filters/names that won't work in this situation.

sorry for being autism

 

 

Well two things here that may produce "Lag", though I think you should be getting an error in the logs. First of all check if the ID's are right, then check if the npc is found with if (npc != null) . Then a good idea would be to check if the NPC is visible, cause it won't interact with it the other way (correct me if I'm wrong). And finally, I seriously doubt that an NPC has an action "use". I don't remember the outcome if you use an action that isn't there. Either nothing happens or you'll get an error.

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.