Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.powerbot.concurrent.strategy.Strategy;
- import org.powerbot.game.api.ActiveScript;
- import org.powerbot.game.api.Manifest;
- import org.powerbot.game.api.methods.interactive.NPCs;
- import org.powerbot.game.api.methods.interactive.Players;
- import org.powerbot.game.api.util.Time;
- import org.powerbot.game.api.wrappers.interactive.NPC;
- @Manifest(authors = { "PurpleKush4Life" }, name = "RatKiller", description = "Kills Rats", version = 1.0)
- public class RatKiller extends ActiveScript {
- private int Rat[] = {12349, 12351, 12350};
- @Override
- protected void setup() {
- provide(new Attack());
- }
- private class Attack extends Strategy {
- public void run() {
- NPC RAT = NPCs.getNearest(Rat);
- if (Players.getLocal().getAnimation() == -1) {
- RAT.interact("Attack");
- Time.sleep(600,800);
- while (Players.getLocal().isMoving()) {
- Time.sleep(100,200);
- }
- }
- }
- @Override
- public boolean validate() {
- NPC RAT = NPCs.getNearest(Rat);
- return RAT != null && RAT.isOnScreen();
- }
- }
- }
Add Comment
Please, Sign In to add comment