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 is being splashed?

Featured Replies

I've only just started developing a script, my first one.. It's a chicken killer in a tight nit area to avoid running around 'like a headless chicken'.. So to speak.

 

However, my method for determining whether the target is attackable is as follows.

private boolean isAttackableTarget(final NPC target) {
        return target != null && target.exists() && target.getHealthPercent() > 0 && !target.isUnderAttack() && isInArea(target.getPosition());
}

So I determine if the target is null, if it's alive, if it's being attacked and it's within the confines of my area. However, if the target is being splashed it will attempt to attack. I need to figure out a way to see if the target "Is Attacking".

 

From doing a bit of digging I can determine the chicken's animations loop through 3587 & 3588 for the initial splash and retaliation. However, there's nothing conclusive from the hover information I can gather to determine if it's attacking or not as this animation cycle briefly returns back to give a false indication of not animating. Clearly, is under attack does not cover this outcome also.

I've tried searching a solution and not found anything as of yet. Any help appreciated.

Edited by smokehut

32 minutes ago, dreameo said:

https://imgur.com/a/RdBxC

You can try that

Doesn't isAttackable rely on the health bar? If there's no health bar, it'll return as attackable even if it's being splashed.

6 minutes ago, HeyImJamie said:

Doesn't isAttackable rely on the health bar? If there's no health bar, it'll return as attackable even if it's being splashed.

Yes, isAttackable makes use of getHealthPercent and isUnderAttack, both of which I believe make use of the health bar.

If the health bar is not visible, isUnderAttack will return false.

Edited by Explv

Character#getInteracting() == null

Edited by Chris

Should just have to check if any players are interacting with the NPC:

public boolean isSplashed(NPC npc) {
	return !getPlayers().filter(p -> p.isInteracting(npc)).isEmpty();
}

Will return true if someone is interacting/splashing the NPC.

  • Author
On 30/12/2017 at 10:25 PM, Lemons said:

Should just have to check if any players are interacting with the NPC:


public boolean isSplashed(NPC npc) {
	return !getPlayers().filter(p -> p.isInteracting(npc)).isEmpty();
}

Will return true if someone is interacting/splashing the NPC.

 

This looks like what I require, the dude splashing has unfortunately left. However, I'll update once I can confirm this works.

 

EDIT, yes I can confirm this works.

Edited by smokehut

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.