August 19, 201510 yr Hi all, I have recently started to script again and I was wondering if there is already a standard way of obtaining a target to attack. I have already started to develop my own targeting method, but any helpful hints are appreciated! Thanks, ZaqMasterBot
August 19, 201510 yr Author NPC Filter I found that in the API after I posted this, but I am still having trouble using it.
August 19, 201510 yr I found that in the API after I posted this, but I am still having trouble using it. Mind sharing an example of your usage
August 19, 201510 yr I found that in the API after I posted this, but I am still having trouble using it. final NPC npc = npcs.closest(new Filter<NPC>() { @Override public boolean match(NPC npc) { return npc != null && npc.getName().equals("Monster name here") && !npc.isUnderAttack() && npc.getHealth() > 0 && map.canReach(npc); } });
August 20, 201510 yr Author final NPC npc = npcs.closest(new Filter<NPC>() { @Override public boolean match(NPC npc) { return npc != null && npc.getName().equals("Monster name here") && !npc.isUnderAttack() && npc.getHealth() > 0 && map.canReach(npc); } }); That @Override is needed I assume? Gets me every time.
August 20, 201510 yr Author Two questions: is isUnderAttack() and checking the health more reliable that isAttackable()? When using global vars in onStart() I get: Error in script onStart(): TestScriptOne in the client?