Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void fightChickens() throws InterruptedException{
- if(((!myPlayer().isUnderAttack()&&!myPlayer().isAnimating())&&!getCombat().isFighting())&&!myPlayer().isMoving()){
- List<NPC> npcsList = getNpcs().getAll();
- for(NPC npc : npcsList){
- if(npc.getName().equals("Chicken")){
- if((!npc.isUnderAttack()&&npc.isAttackable())&&map.canReach(npc.getPosition())){
- chickenSet.add(npc);
- }
- }
- }
- NPC chicken = npcs.closest(chickenSet);
- if(!chicken.isAnimating() || chicken.isMoving()){
- chicken.interact("Attack");
- sleep(random(300,600));
- }
- }
- chickenSet.clear();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement