Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main extends Script {
- private boolean dropLoot = false;
- private int nextDrop = 1;
- private static final String[] wanted = {"Strange fruit", "Golovanova fruit top"};
- private static final String[] unwanted = {"Cooking apple", "Pineapple", "Redberries", "Jangerberries", "Banana", "Strawberry", "Lime", "Lemon", "Papaya fruit"};
- private static final Area BANK_AREA = Area.rectangular(new Position(1748, 3597), new Position(1750, 3600));
- private static final Area THIEVING_AREA = Area.rectangular(new Position(1752, 3607), new Position(1800, 3609));
- @Override
- public int loop() {
- Player local = Players.getLocal();
- if (!local.isMoving() && !local.isAnimating()) {
- if (dropLoot && Inventory.getCount(unwanted) > 0) {
- Inventory.getFirst(unwanted).interact("Drop");
- Time.sleep(100, 400);
- } else {
- dropLoot = false;
- if (Inventory.isFull()) {
- if (Inventory.contains(unwanted)) {
- dropLoot = true;
- nextDrop = Random.nextInt(1, 28 - Inventory.getCount());
- Log.fine("Dropping next items at " + nextDrop);
- } else {
- if (Bank.isOpen()) {
- Bank.depositInventory();
- Time.sleep(1000, 2000);
- } else {
- if (Bank.open()) {
- Time.sleep(2000, 3000);
- } else {
- Movement.walkTo(BANK_AREA.getCenter().randomize(2));
- Time.sleep(2000, 3000);
- }
- }
- }
- } else {
- if (THIEVING_AREA.contains(local.getPosition())) {
- if (Inventory.getCount(unwanted) >= nextDrop) {
- dropLoot = true;
- nextDrop = Random.nextInt(1, 28 - Inventory.getCount());
- Log.fine("Dropping next items at " + nextDrop);
- } else {
- final SceneObject stall = SceneObjects.getNearest("Fruit stall");
- if (stall != null) {
- stall.interact("Steal-from");
- if (Random.nextInt(1, 100) == 10) {
- Time.sleep(10000, 25000);
- }
- else {
- Time.sleep(2500, 3500);
- }
- }
- }
- } else {
- Movement.walkTo(THIEVING_AREA.getCenter().randomize(4));
- Time.sleep(3000, 4000);
- }
- }
- }
- }
- return Random.nextInt(400, 600);
- }
- }
Add Comment
Please, Sign In to add comment