paradoxed

Untitled

Mar 4th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. import org.dreambot.api.script.TaskNode;
  2. import org.dreambot.api.wrappers.interactive.NPC;
  3.  
  4. /**
  5. * Created by 7804364 on 3/4/2016.
  6. */
  7. public class KillTask extends TaskNode {
  8. @Override
  9. public boolean accept() {
  10. return getLocalPlayer().getInteractingCharacter() == null;
  11. }
  12.  
  13. @Override
  14. public int execute() {
  15. NPC npc = getNpcs().closest("Chicken");
  16. if (npc != null) { //forgot to nullcheck
  17. if (npc.exists()) { //exists means its loaded in the region of the map
  18. if (npc.isOnScreen()) { // view port visible
  19. if (npc.interact("Attack")) {
  20. log("Attacking: " + npc);
  21. }
  22. } else {
  23. getCamera().rotateToEntity(npc);
  24. }
  25. }
  26. }
  27. return 0;
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment