alien_fx_fiend

Untitled

Oct 15th, 2019
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.04 KB | None | 0 0
  1. public class Main extends Script {
  2.  
  3.     private boolean dropLoot = false;
  4.  
  5.     private int nextDrop = 1;
  6.  
  7.     private static final String[] wanted = {"Strange fruit", "Golovanova fruit top"};
  8.     private static final String[] unwanted = {"Cooking apple", "Pineapple", "Redberries", "Jangerberries", "Banana", "Strawberry", "Lime", "Lemon", "Papaya fruit"};
  9.  
  10.     private static final Area BANK_AREA = Area.rectangular(new Position(1748, 3597), new Position(1750, 3600));
  11.     private static final Area THIEVING_AREA = Area.rectangular(new Position(1752, 3607), new Position(1800, 3609));
  12.  
  13.     @Override
  14.     public int loop() {
  15.         Player local = Players.getLocal();
  16.  
  17.  
  18.         if (!local.isMoving() && !local.isAnimating()) {
  19.             if (dropLoot && Inventory.getCount(unwanted) > 0) {
  20.                 Inventory.getFirst(unwanted).interact("Drop");
  21.                 Time.sleep(100, 400);
  22.             } else {
  23.                 dropLoot = false;
  24.                 if (Inventory.isFull()) {
  25.                     if (Inventory.contains(unwanted)) {
  26.                         dropLoot = true;
  27.                         nextDrop = Random.nextInt(1, 28 - Inventory.getCount());
  28.                         Log.fine("Dropping next items at " + nextDrop);
  29.                     } else {
  30.                         if (Bank.isOpen()) {
  31.                             Bank.depositInventory();
  32.                             Time.sleep(1000, 2000);
  33.                         } else {
  34.                             if (Bank.open()) {
  35.                                 Time.sleep(2000, 3000);
  36.                             } else {
  37.                                 Movement.walkTo(BANK_AREA.getCenter().randomize(2));
  38.                                 Time.sleep(2000, 3000);
  39.                             }
  40.                         }
  41.                     }
  42.                 } else {
  43.                     if (THIEVING_AREA.contains(local.getPosition())) {
  44.                         if (Inventory.getCount(unwanted) >= nextDrop) {
  45.                             dropLoot = true;
  46.                             nextDrop = Random.nextInt(1, 28 - Inventory.getCount());
  47.                             Log.fine("Dropping next items at " + nextDrop);
  48.                         } else {
  49.                             final SceneObject stall = SceneObjects.getNearest("Fruit stall");
  50.                             if (stall != null) {
  51.                                 stall.interact("Steal-from");
  52.                                 if (Random.nextInt(1, 100) == 10) {
  53.                                     Time.sleep(10000, 25000);
  54.                                 }
  55.                                 else {
  56.                                     Time.sleep(2500, 3500);
  57.                                 }
  58.                             }
  59.                         }
  60.                     } else {
  61.                         Movement.walkTo(THIEVING_AREA.getCenter().randomize(4));
  62.                         Time.sleep(3000, 4000);
  63.                     }
  64.                 }
  65.             }
  66.  
  67.         }
  68.  
  69.         return Random.nextInt(400, 600);
  70.     }
  71. }
Add Comment
Please, Sign In to add comment