All pastes #439261 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-04-14 03:20 UTC
rendered paste body
import impsoft.nexus.bots.color.constants.*;
import impsoft.nexus.bots.color.methods.*;
import impsoft.nexus.bots.color.scriptobjects.*;
import impsoft.nexus.storage.SettingsManager;
import java.awt.Rectangle;
import java.awt.event.KeyEvent;
 
public class kittyBoneBurier extends ColorScript{
    public static double version = 1.0; 
    public static String[] commands = new String[] { "Lumby Cows", "Lumby Goblins", "Debug" }; 
    public String author = "T3h Ub3r K1tten"; 
    public String description = "Picks up and buries bones"; 
    public boolean debug = false; 
    public String cmded;

    private RGB bones[] = new RGB[]{ new RGB(202, 199, 190), new RGB(231, 227, 227), new RGB(157, 148, 143) };
    private RGBCluster bonesCluster = new RGBCluster(bones, this);

    private RGB brownCow = new RGB(122,89,43);
    private RGB dairyCow = new RGB(63,50,48);

    private RGB redDot = new RGB(254,32,32);
    private XY redDotXY;
    private Rectangle rectUm[];
    private Rectangle mmMoveArea = new Rectangle(623,57,671,98);

    private void kittyDebug(String say) {
	if (debug) {
		log("DEBUG: " + say);
	}
    }

    @Override
    public boolean doStart(String cmd, String[] args) throws InterruptedException {
	if (cmd == "Lumby Cows" || cmd == "Lumby Goblins") {
		debug = false;
	} else {
		debug = true;
	}
	cmded = cmd;
        return true;          
    }

    @Override 
    public void script() throws InterruptedException {
        log(this.getClass().getName() + " v" + Double.toString(version) + " by " + author);
	sleep(2000);
	int i = 0;
	int j = 0;
	kittyDebug("Entering 1st Logged in check");
	if (!isLoggedIn()) {
		while(!isLoggedIn()) {
			log("Logged Out... I'm waiting...");
			sleep(5000);
		}
	}
	kittyDebug("Exiting 1st Logged in check");

	kittyDebug("Entering Main Loop");
	while(true) {
		kittyDebug("Setting Run");
		setRun(true);
		kittyDebug("Opening Backpack Tab");
		setTab(3);

		kittyDebug("Begin Bone Picking");
		log("Searching for and picking up bones...");

		kittyDebug("Entering Secondary Loop");
		while(!false) { // I like to mix things up a bit
			kittyDebug("Gathering Points");
			bonesCluster.gatherNewPoints(15);

			if (cmded == "Lumby Cows") {
				kittyDebug("Removing brown cow points");
				bonesCluster.removePointsNearColor(brownCow, 0, 0, 0);
				kittyDebug("Removing dairy cow points");
				bonesCluster.removePointsNearColor(dairyCow, 0, 0, 0);
			}
			if (!bonesCluster.doTopTextAndMenuOnMoving("Take Bones", "Take Bones")) {
				kittyDebug("Did not find any bones");
				i++;
				if (i == 4) {
					kittyDebug("I = 4");
					i = 0;
					log("Walking around to find other bones...");
					kittyDebug("Looking for more bones");
					redDotXY = findXYspiral(mmMoveArea,647,83,redDot,4,0,0);
					mouseClickLeft(redDotXY);
				}
			}
			if (!isLoggedIn() || inventoryCount()==28){
				kittyDebug("Broke out of secondary loop");
				break;
			}
			sleep(2000);
		} 

		if (!isLoggedIn()) {
			kittyDebug("Logged out");
			log("Could not find any bones!");
			log("Try a more popular world");
			break;
		} else {
			kittyDebug("Have Inv of bones");
			log("Got an inventory of bones, burying...");
			kittyDebug("Burying");		
			doActionAtInventory("Bones", "Bury", 28); 
			log("Bones buried! Approximately 126 exp gained...");
		}

	}
	kittyDebug("Script stopped abnormally");
	log("Script stopped abnormally...");
    } 
}