Guest User

Untitled

a guest
Jan 19th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. import org.powerbot.concurrent.strategy.Strategy;
  2. import org.powerbot.game.api.ActiveScript;
  3. import org.powerbot.game.api.Manifest;
  4. import org.powerbot.game.api.methods.interactive.NPCs;
  5. import org.powerbot.game.api.methods.interactive.Players;
  6. import org.powerbot.game.api.util.Time;
  7. import org.powerbot.game.api.wrappers.interactive.NPC;
  8.  
  9.  
  10.  
  11. @Manifest(authors = { "PurpleKush4Life" }, name = "RatKiller", description = "Kills Rats", version = 1.0)
  12. public class RatKiller extends ActiveScript {
  13.  
  14.  
  15. private int Rat[] = {12349, 12351, 12350};
  16.  
  17. @Override
  18. protected void setup() {
  19. provide(new Attack());
  20. }
  21.  
  22. private class Attack extends Strategy {
  23.  
  24. public void run() {
  25. NPC RAT = NPCs.getNearest(Rat);
  26. if (Players.getLocal().getAnimation() == -1) {
  27. RAT.interact("Attack");
  28. Time.sleep(600,800);
  29. while (Players.getLocal().isMoving()) {
  30. Time.sleep(100,200);
  31. }
  32. }
  33. }
  34.  
  35. @Override
  36. public boolean validate() {
  37. NPC RAT = NPCs.getNearest(Rat);
  38. return RAT != null && RAT.isOnScreen();
  39.  
  40. }
  41.  
  42. }
  43.  
  44.  
  45. }
Add Comment
Please, Sign In to add comment