import javax.swing.JOptionPane;
import org.powerbot.concurrent.Task;
import org.powerbot.concurrent.strategy.Condition;
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.util.Filter;
import org.powerbot.game.api.wrappers.interactive.NPC;
@Manifest(
name = "SimonsKiller",
authors = "Simonbettio",
description = "KILLS YOU :D"
)
public class SimonsKiller extends ActiveScript {
private boolean start = false;
private int foodId, monsterId;
@Override
protected void setup() {
MonsterId mi = new MonsterId();
submit(mi);
Attack attack = new Attack();
Strategy attackStrategy = new Strategy(attack, attack);
provide(attackStrategy);
Eat eat = new Eat();
Strategy eatStrategy = new Strategy(eat, eat);
provide(eatStrategy);
AntiBan ab = new AntiBan();
Strategy abStrategy = new Strategy(ab, ab);
provide(abStrategy);
}
private class MonsterId implements Task, Condition {
@Override
public void run() {
try {
monsterId = Integer.parseInt (JOptionPane.showInputDialog("Enter The Monster Id"));
EatId eI = new EatId();
submit(eI);
start = true;
} catch (Exception e) {
stop();
}
}
@Override
public boolean validate() {
return true;
}
}
private class EatId implements Task, Condition {
@Override
public void run() {
try {
foodId = Integer.parseInt (JOptionPane.showInputDialog("Enter The Food Id"));
start = true;
} catch (Exception e) {
foodId = -1;
start = true;
}
}
@Override
public boolean validate() {
return true;
}
}
private class Attack implements Task, Condition {
@Override
public void run() {
NPC toAttack = NPCs.getNearest(new Filter<NPC>() {
public boolean accept(NPC npc) {
return npc.getId() == monsterId;
}
});
}
@Override
public boolean validate() {
return start;
}
}
private class Eat implements Task, Condition {
@Override
public void run() {
}