All pastes #534523 Raw Edit

SnapePicker

public text v1 · immutable
·published 2007-06-03 20:10 UTC
rendered paste body
import impsoft.nexus.bots.color.methods.*;
import impsoft.nexus.bots.color.scriptobjects.*;
import impsoft.nexus.bots.reflection.scriptobjects.walking.*;

public class SnapePicker extends ColorScript {
	public static double version = 1.0;
	public static String[] commands = new String[] {"Lets Get Pickin'!!"};
	public String author = "Icarus + Usa";
	public String description = "Picks Snape Grass below the Crafting Guild -- 58 Combat required lest you get ownted.";

	private Booth theBankBooth;
	private Snape theSnape;
	public AryanPath bankToSnape;
	public AryanTile snapeLoc;

	public boolean doStart(String cmd, String[] args) throws InterruptedException {
		theBankBooth = new Booth (this);
		theSnape = new Snape(new RGB[] { new RGB(14, 137, 80), new RGB(14, 111, 73) }, this);
		return true;
	}

	public void script() throws InterruptedException {
		log("Starting script...");
		theBankBooth = new Booth (this);
		theSnape = new Snape(new RGB[] { new RGB(14, 137, 80), new RGB(14, 111, 73) }, this);

		AryanPath bankToSnape = new AryanPath(new AryanTile[] {
				new AryanTile(3012, 3357, this),
				new AryanTile(3007, 3351, 2, this),
				new AryanTile(3006, 3350, 2, this),
				new AryanTile(3004, 3316, 1, this),
				new AryanTile(2993, 3305, 1, this),
				new AryanTile(2983, 3295, 2, this),
				new AryanTile(2975, 3287, 3, this),
				new AryanTile(2970, 3290, 2, this),
				new AryanTile(2953, 3273, 1, this),
				new AryanTile(2937, 3257, 1, this),
				new AryanTile(2912, 3279, 1, this),
				new AryanTile(2906, 3296, this) }, this);

		while (!isLoggedIn()) {
			log("Waiting for logon...");
			sleep(3000);
		}

		while (true) {
			bankToSnape.walkToEndTile();

			setRun(true);
			while (inventoryCount() < 28) {
				sleep(random(1000, 1800));
				theSnape.pick();
			}

			if (inventoryCount() >= 28) {
				setRun(true);
				bankToSnape.walkToStartTile();
				theBankBooth.bank();
			}
		}
	}
}

class Snape extends EdgeRGBCluster {
	public Snape(RGB[] rgbs, ColorScript c) {
		super(rgbs, c);
	}

	public void pick() throws InterruptedException {
		doTopTextAndMenu("Take Snape", "Take Snape");
	}
}

class Booth extends RGBCluster {
	public Booth(GameScreenMethods methods) {
		super(new RGB[] { new RGB(27, 21, 9), new RGB(100, 77, 45), new RGB(103, 84, 47) }, methods);
	}

	public boolean bank() throws InterruptedException {
		Timer t = new Timer(20000);
		while (!t.isUp()) {
			gatherNewPoints(5);
			if (doTopTextAndMenu("Use", "quickly")) {
				theScript.doActionAtInventory(new String[] {}, "All", 28);
				return true;
			}
			Thread.sleep(StaticColorMethods.defaultmaxAgeInMillisecs * 5);
		}
		return false;
	}
}