Advertisement
Guest User

Untitled

a guest
Jun 25th, 2015
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. private void fightChickens() throws InterruptedException{
  2. if(((!myPlayer().isUnderAttack()&&!myPlayer().isAnimating())&&!getCombat().isFighting())&&!myPlayer().isMoving()){
  3. List<NPC> npcsList = getNpcs().getAll();
  4. for(NPC npc : npcsList){
  5. if(npc.getName().equals("Chicken")){
  6. if((!npc.isUnderAttack()&&npc.isAttackable())&&map.canReach(npc.getPosition())){
  7. chickenSet.add(npc);
  8. }
  9. }
  10. }
  11. NPC chicken = npcs.closest(chickenSet);
  12. if(!chicken.isAnimating() || chicken.isMoving()){
  13. chicken.interact("Attack");
  14. sleep(random(300,600));
  15. }
  16. }
  17. chickenSet.clear();
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement