Guest User

Untitled

a guest
Jul 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.66 KB | None | 0 0
  1. import org.powerbot.concurrent.Task;
  2. import org.powerbot.game.api.ActiveScript;
  3. import org.powerbot.game.api.Manifest;
  4. import org.powerbot.game.api.methods.node.GroundItems;
  5. import org.powerbot.game.api.methods.tab.Inventory;
  6. import org.powerbot.game.api.util.Filter;
  7. import org.powerbot.game.api.util.Time;
  8. import org.powerbot.game.api.util.Timer;
  9. import org.powerbot.game.api.wrappers.node.GroundItem;
  10. import org.powerbot.game.api.wrappers.node.Item;
  11.  
  12. @Manifest(name = "WiKAi 1st script", description = "trololol", version = 1.0d, authors = {"Midgets in hotpants"})
  13. public class bonepicker extends ActiveScript implements Task
  14. {
  15.     private static final int BigBonesID = 532;
  16.    
  17.    
  18.    
  19.     @Override
  20.     protected void setup()
  21.     {
  22.         log.info("trololol");  
  23.     }
  24.    
  25.     public void run() {
  26.         log.info("trololol2");
  27.        
  28.         final GroundItem Bones = GroundItems.getNearest(new Filter<GroundItem>()
  29.                
  30.             {public boolean accept(final GroundItem Bones)
  31.            
  32.             {return Bones.isOnScreen() && Bones.getGroundItem().getId() == BigBonesID;
  33.                 }
  34.             });
  35.         log.info("trololol3");
  36.                     if (Bones != null) {
  37.                         final int count = boneCount();
  38.                         if (Bones.interact("Take", "Big bones")) {
  39.                           final Timer timer = new Timer(1800);
  40.                           while (timer.isRunning() && boneCount() == count) {
  41.                             Time.sleep(150);
  42.                            
  43.                            
  44.                           }
  45.                         }
  46.                         return;
  47.         }
  48.     }
  49.     private int boneCount() {
  50.         log.info("trololol5");
  51.         final Filter<Item> featherFilter = new Filter<Item>() {
  52.             public boolean accept(final Item item) {
  53.                 return item.getId() == BigBonesID;
  54.                 }
  55.             };
  56.             return Inventory.getCount(true, featherFilter);
  57.     }
  58. }
Add Comment
Please, Sign In to add comment