Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Color;
- import java.awt.Graphics;
- import com.quirlion.script.*;
- import com.quirlion.script.types.*;
- //_Collin
- //Version 0.0.1
- //only use bronze
- public class lumbridgePower extends Script {
- public int[] treeIDs = new int[] { 1276, 1278 };
- boolean walkback = false, sold = false;
- int theStatusATM = 0;
- public String theStatus = "Start of script.";
- public String location = "";
- private Location[] lumbridgeToShop = new Location[] {
- new Location(3222,3221), new Location(3234,3219), new Location(3236,3211),
- new Location(3236,3204), new Location(3230,3203) };
- private Location[] lumbridgeToTrees = new Location[] {
- new Location(3222,3221), new Location(3234,3219), new Location(3230,3231),
- new Location(3223,3237), new Location(3220,3245), new Location(3210,3246),
- new Location(3198,3247), new Location(3190,3244), new Location(3186,3245)};
- private Location[] treesToStore = new Location[] {
- new Location(3193,3245), new Location(3202,3248), new Location(3214,3241)};
- private Location[] storeToTrees = new Location[] {
- new Location(3214,3243), new Location(3202,3248), new Location(3193,3245)};
- public int loop() {
- if(players.getCurrent().isMoving()) return 500;
- if(!walkback) theStatusATM = status();
- switch(theStatusATM) {
- case 0: {
- declareStatus("Checking for axe.");
- if(!equipment.isItemEquipped(1351)) {
- declareStatus("Missing axe. Walking to shop.");
- players.getCurrent().walkPathMM(lumbridgeToShop);
- } else {
- declareStatus("Walking to trees.");
- players.getCurrent().walkPathMM(lumbridgeToTrees);
- }
- } break;
- case 1: {
- declareStatus("Buying an axe.");
- if(npcs.getNearestByID(519).click("Trade")) {
- declareStatus("Successful trade.");
- break;
- }
- } break;
- case 2: {
- if(inventory.getCount() == 28) {
- walkback = true;
- declareStatus("Inventory Full. Walking to store.");
- if(returnLocation() == 3) walkback = false;
- players.getCurrent().walkPathMM(treesToStore);
- sold = false;
- } else {
- declareStatus("Chopping Trees.");
- if(players.getCurrent().getAnimation() == -1) {
- Thing tree = things.getNearest(treeIDs);
- tree.click("Chop");
- }
- }
- } break;
- case 3: { //520, 521
- //declareStatus("In shop.");
- if(sold) {
- walkback = true;
- players.getCurrent().walkPathMM(storeToTrees);
- if(returnLocation() == 2) walkback = false;
- } else {
- declareStatus("Selling Logs");
- if(interfaces.get(620,20) != null) {
- inventory.clickItem(1511,"Sell 50");
- sold = true;
- } else {
- declareStatus("Trading I guess");
- NPC shopKeeper = npcs.getNearestByName("Shopkeeper","Shop assistant");
- shopKeeper.click("Trade");
- return calculations.random(1000,2000);
- }
- }
- } break;
- }
- return calculations.random(500,1500);
- }
- public void declareStatus(String s) {
- if(!s.equals(theStatus)) {
- theStatus = s;
- }
- switch(returnLocation()) {
- case 1: location = "lumbridge"; break;
- case 2: location = "forest"; break;
- case 3: location = "shop"; break;
- case 4: location = "axe shop"; break;
- case 5: location = "no fuxing clue"; break;
- }
- }
- public int status() {
- if(returnLocation() == 1) return 0;
- if(returnLocation() == 4) return 1;
- if(returnLocation() == 2) return 2;
- if(returnLocation() == 3) return 3;
- return 0;
- }
- //1 is lumbriddge
- //2 is trees
- //3 is shop
- //4 is axe shop
- //5 is unknown
- public int returnLocation() {
- if(calculations.getDistanceTo(new Location(3221, 3219)) < 10) return 1;
- if(calculations.getDistanceTo(new Location(3185, 3245)) < 15) return 2;
- if(calculations.getDistanceTo(new Location(3214, 3241)) < 3) return 3;
- if(calculations.getDistanceTo(new Location(3230, 3203)) < 4) return 4;
- return 5;
- }
- public void paint(Graphics g) {
- g.setColor(new Color(0, 0, 0, 255));
- g.drawString("Lumbridge Power", 26, 184);
- g.drawString("Status: " + theStatus, 26, 199);
- g.drawString("Location: " + location, 26, 220);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement