@Override public void execute() { for (final Npc n : ctx.npcs.select().name("chicken").select(CHICKEN_FILTER).nearest().first()) { if (n.interact("Attack")) { Methods.waitFor( new Condition() { @Override public boolean validate() { return ctx.players.getLocal().isInCombat(); } }); } } }
@Override public boolean accept(final Npc n) { return !n.isInCombat() && n.getHealthPercent() == 100; }