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.

NPC Interact Object clipping

Featured Replies

Hey, I'm new to scripting.

Something i've noticed is when using the standard

someNpc.interact()

and the NPC is clipped by an object like a wall or tree,

someNpc.isVisible()

is true, even if the NPC cannot be seen. I'm assuming this is because the NPC is on the screen but simply behind an object.

Is there a method that works for object clipping or a way to move the camera so that the npc isn't clipped by anything?

I believe isVisible returns true for 30% or more of the object/npc being visible, but I'm not 100% on that. Are you feeding .interact() a String paramter so it knows what option to click?

  • Author
5 minutes ago, Night said:

I believe isVisible returns true for 30% or more of the object/npc being visible, but I'm not 100% on that. Are you feeding .interact() a String paramter so it knows what option to click?

Yes I am. I tried completely covering the NPC with a tree/wall, and isVisible was still true. Here's an example snippet:

Entity man = getNpcs().closest("Man");
man.interact("Pickpocket");

 

Edited by jimmmy23
Example

Could always just use getCamera().toEntity to move the camera to the man

  • Author
9 minutes ago, Night said:

Could always just use getCamera().toEntity to move the camera to the man

Is it a bad idea to call this before every pickpocket?

Or is there a way to check if the NPC is clipped by anything before calling it?

Edited by jimmmy23

5 minutes ago, jimmmy23 said:

Is it a bad idea to call this before every pickpocket?

Probably, it might slightly adjust the camera each time. You can check the success of interact() since it returns a boolean, if it fails then just rotate camera to the npc.

24 minutes ago, jimmmy23 said:

Yes I am. I tried completely covering the NPC with a tree/wall, and isVisible was still true. Here's an example snippet:


Entity man = getNpcs().closest("Man");
man.interact("Pickpocket");

 

isVisible doesn't check if an object is behind something else ...
isVisible only checks if the actual entity is on the screen, no matter whats in front or behind it :)

AS far as I know, there is no method to check what you need

Edited by Khaleesi

4 minutes ago, jimmmy23 said:

But it can still successfully interact with the man even when it's clipped, what exactly does the bool tell me? Is there a better documentation anywhere? it just says

The boolean returns true if successfully interacted yes, if the interaction works why are you concerned about the camera?

1 minute ago, jimmmy23 said:

It just seems kind of bot-like to repeatedly right click through a tree to interact with something.

 

Are there any methods that can achieve what I want?

 

Thanks to both of you for the help btw.

Not that I'm aware, I also don't think that's somehting jagex actual can check ... :)

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.