Don't like ads? PRO users don't see any ads ;-)
Guest

SimonsKiller.java

By: a guest on Jul 20th, 2012  |  syntax: JavaScript  |  size: 2.35 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import javax.swing.JOptionPane;
  2.  
  3. import org.powerbot.concurrent.Task;
  4. import org.powerbot.concurrent.strategy.Condition;
  5. import org.powerbot.concurrent.strategy.Strategy;
  6. import org.powerbot.game.api.ActiveScript;
  7. import org.powerbot.game.api.Manifest;
  8. import org.powerbot.game.api.methods.interactive.NPCs;
  9. import org.powerbot.game.api.util.Filter;
  10. import org.powerbot.game.api.wrappers.interactive.NPC;
  11.  
  12.  
  13. @Manifest(
  14.                   name = "SimonsKiller",
  15.                   authors = "Simonbettio",
  16.                   description = "KILLS YOU :D"
  17.                  
  18. )
  19.  
  20. public class SimonsKiller extends ActiveScript {
  21.  
  22.        
  23.         private boolean start = false;
  24.         private int foodId, monsterId;
  25.  
  26.         @Override
  27.         protected void setup() {
  28.                 MonsterId mi = new MonsterId();
  29.         submit(mi);
  30.        
  31.         Attack attack = new Attack();
  32.         Strategy attackStrategy = new Strategy(attack, attack);
  33.         provide(attackStrategy);
  34.        
  35.         Eat eat = new Eat();
  36.         Strategy eatStrategy = new Strategy(eat, eat);
  37.         provide(eatStrategy);
  38.        
  39.         AntiBan ab = new AntiBan();
  40.         Strategy abStrategy = new Strategy(ab, ab);
  41.         provide(abStrategy);
  42.         }
  43.        
  44.         private class MonsterId implements Task, Condition {
  45.  
  46.                 @Override
  47.                 public void run() {
  48.                         try {
  49.                         monsterId = Integer.parseInt (JOptionPane.showInputDialog("Enter The Monster Id"));
  50.                         EatId eI = new EatId();
  51.                         submit(eI);
  52.                         start = true;
  53.                         } catch (Exception e) {
  54.                                 stop();
  55.                         }
  56.                 }
  57.  
  58.                 @Override
  59.                 public boolean validate() {
  60.                        
  61.                         return true;
  62.                 }
  63.                
  64.         }
  65.        
  66.         private class EatId implements Task, Condition {
  67.  
  68.                 @Override
  69.                 public void run() {
  70.                         try {
  71.                         foodId = Integer.parseInt (JOptionPane.showInputDialog("Enter The Food Id"));
  72.                         start = true;
  73.                         } catch (Exception e) {
  74.                                 foodId = -1;
  75.                                 start = true;
  76.                         }
  77.                 }
  78.  
  79.                 @Override
  80.                 public boolean validate() {
  81.                        
  82.                         return true;
  83.                 }
  84.                
  85.         }
  86.        
  87.         private class Attack implements Task, Condition {
  88.  
  89.                 @Override
  90.                 public void run() {
  91.                 NPC toAttack = NPCs.getNearest(new Filter<NPC>() {
  92.  
  93.                         public boolean accept(NPC npc) {
  94.                                 return npc.getId() == monsterId;
  95.                                 }
  96.                                
  97.                         });
  98.                        
  99.                 }
  100.  
  101.                 @Override
  102.                 public boolean validate() {
  103.                        
  104.                         return start;
  105.                 }
  106.                
  107.         }
  108.        
  109.         private class Eat implements Task, Condition {
  110.  
  111.                 @Override
  112.                 public void run() {
  113.                
  114.                        
  115.                 }