Guest User

Untitled

a guest
Jul 22nd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.27 KB | None | 0 0
  1. import org.powerbot.concurrent.Task;
  2. import org.powerbot.concurrent.strategy.Condition;
  3. import org.powerbot.concurrent.strategy.Strategy;
  4. import org.powerbot.game.api.ActiveScript;
  5. import org.powerbot.game.api.Manifest;
  6. import org.powerbot.game.api.methods.node.GroundItems;
  7. import org.powerbot.game.api.methods.tab.Inventory;
  8. import org.powerbot.game.api.wrappers.node.GroundItem;
  9.  
  10. @Manifest(authors = { "Speed" }, name = "GetDoseGoldPieces", description= "THIS FOR ALL MY NIGGERS")
  11. public class GoldPiece extends ActiveScript {
  12.  
  13.     protected void setup() {
  14.         provide(new PickupStrategy());
  15.         provide(new Strategy(new Condition() {
  16.             public boolean validate() {
  17.                 return Inventory.getCount(995) > 0;
  18.             }
  19.  
  20.         }, new Task() {
  21.             public void run() {
  22.                 log.info("WE HAS DAT GP");             
  23.                 stop();
  24.             }
  25.         }));
  26.     }
  27.  
  28.  
  29.  
  30. public class PickupStrategy extends Strategy implements Task {
  31.  
  32.     @Override
  33.     public boolean validate() {
  34.         return Inventory.getCount(995) == 0;// dont bitch at me about constants
  35.                                             // bitch, they get folded anyway
  36.     }
  37.  
  38.     public void run() {
  39.         final GroundItem item = GroundItems.getNearest(995);
  40.         if (item != null) {
  41.             log.info("Found DAT GP.");
  42.             item.interact("Take");
  43.         } else {
  44.             log.info("Fuck dis SHITE MAYNE");
  45.         }
  46.     }
  47.  
  48. }}
Add Comment
Please, Sign In to add comment