All pastes #756968 Raw Edit

Unnamed

public text v1 · immutable
#756968 ·published 2007-10-31 21:09 UTC
rendered paste body
import impsoft.nexus.bots.color.ColorBot;
import impsoft.nexus.bots.color.scriptable.ColorScript;
import impsoft.nexus.bots.color.scriptable.interfaces.ChatListener;
import impsoft.nexus.bots.color.scriptable.objects.EdgeRGBCluster;
import impsoft.nexus.bots.color.structures.RGB;
import impsoft.nexus.bots.reflection.structures.AryanTile;

import java.awt.Rectangle;

public class EdgevilleBurier extends ColorScript implements ChatListener {
	public EdgevilleBurier(ColorBot c) {
		super(c);
	}

	// author(s) of script
	public static String author = "Bobinpants";

	// Description of script
	public static String description = "";

	// Version of script
	public static double version = 1.0;

	RGB[] doorColor = new RGB[] { new RGB(189, 142, 24), new RGB(112, 86, 27) };
	EdgeRGBCluster theDoor = new EdgeRGBCluster(doorColor, this);

	RGB[] boneColor = new RGB[] { new RGB(251, 250, 250),
			new RGB(223, 218, 218) };
	EdgeRGBCluster theBone = new EdgeRGBCluster(boneColor, this);

	// Tile in lumby to tell if your dead
	AryanTile deathTile = new AryanTile(3222, 3218);

	// Destination point to end at in edgeville
	AryanTile endPoint = new AryanTile(3101, 3509);

	// Middle of the room used for checking if were locked out
	AryanTile midRoom = new AryanTile(3096, 3510);

	// Locked out point
	AryanTile lockOut = new AryanTile(3101, 3510);

	Rectangle doorRec = new Rectangle(240, 126, 25, 25);

	public void chat(String message) throws InterruptedException {
		if (message.contains("in a strange place")) {
			log("sandwich hoe telleported us...Using home telleport and walking back");
			sandBitch();
		}
	}

	// main loop
	public void script() throws InterruptedException {

		theTabs.Options.setRun(true);
		theWorldMap.walkTo(endPoint);
		sleep(random(2500, 3525));
		log("we have set them");
		theCamera.setCameraUp();
		while (true) {
			while (isDead() == false && theTabs.Inventory.getCount() < 28) {
				gatherBones();
				while (isLockedOut()) {
					doWalkLockedDoor();
					if (isDoorReallyLocked()) {
						openLockedDoor();
						theWorldMap.walkTo(midRoom);
						theCamera.setCameraUp();
						theCompass.setNorth();
						break;
					} else {
						theCamera.setCameraUp();
						break;
					}
				}
			}
			if (isDead() == true) {
				deadWalk();
			}
			if (theTabs.Inventory.getCount() == 28) {
				burryBones();
			}
		}
	}

	public void burryBones() throws InterruptedException {
		// Bury Bones
		log("Burying Bones");
		theTabs.Inventory.doAction("Bury", "Bury", 28, true);

	}

	public boolean isDead() throws InterruptedException {
		if (getLocation().distanceTo(deathTile) <= 15) {
			log("F*ck we are dead");
			return true;
		} else {
			return false;
		}
	}

	public void deadWalk() throws InterruptedException {
		log("you died, walking back to edge men!");
		theWorldMap.walkTo(endPoint);
		theTabs.Options.setRun(true);
		theCamera.setCameraUp();
	}

	public void sandBitch() throws InterruptedException {
		theTabs.Magic.selectSpell(theTabs.Magic.HOME_TELE);
		sleep(random(6000, 7000));
		theWorldMap.walkTo(endPoint);
	}

	public boolean isLockedOut() throws InterruptedException {
		if (getLocation().distanceTo(midRoom) >= 5) {
			log("Think we are locked out. Checking if that's true");
			return true;
		} else {
			return false;
		}
	}

	public boolean isDoorReallyLocked() throws InterruptedException {
		theCamera.setCameraDown();
		theCompass.setEast();
		mouseMove(doorRec);
		if (theTopText.getTopText().contains("Open Large door")) {
			return true;
		} else {
			return false;
		}
	}

	public void openLockedDoor() throws InterruptedException {
		if (theDoor.doTopTextAndMenu("Open Large door", "Open Large door") != null)
			sleep(random(1000, 1800));
	}

	public void doWalkLockedDoor() throws InterruptedException {
		theWorldMap.walkTo(lockOut);
	}

	public void gatherBones() throws InterruptedException {
		log("Gathering Bones");
		theBone.doTopTextAndMenu("Take", "Bones");
		sleep(random(1000, 1500));
	}
}