smokehut Posted December 30, 2017 Share Posted December 30, 2017 (edited) 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 December 30, 2017 by smokehut Quote Link to comment Share on other sites More sharing options...
dreameo Posted December 30, 2017 Share Posted December 30, 2017 https://imgur.com/a/RdBxC You can try that Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted December 30, 2017 Share Posted December 30, 2017 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. Quote Link to comment Share on other sites More sharing options...
Explv Posted December 30, 2017 Share Posted December 30, 2017 (edited) 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 December 30, 2017 by Explv Quote Link to comment Share on other sites More sharing options...
Chris Posted December 30, 2017 Share Posted December 30, 2017 (edited) Character#getInteracting() == null Edited December 30, 2017 by Chris Quote Link to comment Share on other sites More sharing options...
Lemons Posted December 30, 2017 Share Posted December 30, 2017 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. 1 Quote Link to comment Share on other sites More sharing options...
smokehut Posted December 30, 2017 Author Share Posted December 30, 2017 (edited) 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 January 1, 2018 by smokehut Quote Link to comment Share on other sites More sharing options...