All pastes #556957 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-06-10 20:29 UTC
rendered paste body
import java.awt.Rectangle;

import impsoft.nexus.bots.color.ColorBot;
import impsoft.nexus.bots.color.constants.Areas;
import impsoft.nexus.bots.color.scriptable.ColorScript;
import impsoft.nexus.bots.color.scriptable.objects.RGBCluster;
import impsoft.nexus.bots.color.structures.RGB;
import impsoft.nexus.bots.color.util.Timer;
import impsoft.nexus.bots.reflection.objects.AryanPath;
import impsoft.nexus.bots.reflection.structures.AryanTile;

public class Cooker extends ColorScript {

	public Cooker(ColorBot arg0) {
		super(arg0);
	}

	AryanPath path = new AryanPath(new AryanTile[] { new AryanTile(3270, 3166),
			new AryanTile(3273, 3180) }, this);

	RGBCluster stove = new RGBCluster(new RGB[] { new RGB(186, 39, 21) }, this);

	public void script() throws InterruptedException, Exception {
		log(theNPCChatFinder.getNPCChat());

		while (true) {
			path.walkToStart();
			theBank.open();
			theBank.doDepositAll();
			theBank.doWithDrawAll("Raw");
			path.walkToEnd();
			while (theTabs.Inventory.doAction("Raw", "Use", 1, false) > 0) {
				stove.doTopTextAndMenu("Range", "Use");
				waitTillMovingStop();
				if (theNPCChatFinder.getNPCChat().contains(
						"how many would you like to cook?")) {
					mouseClickRight(new Rectangle(225, 388, 50, 30));
					theMenuFinder.doMenu("Cook All");
					waitTillInventoryDissapearStop();
				}
			}
		}
	}

	private void waitTillInventoryDissapearStop() throws InterruptedException {
		Timer t = new Timer(random(700, 1500));
		int i = theTabs.Inventory.getCount();
		while (!t.isUp()) {
			if (theTabs.Inventory.getCount() < i) {
				i = theTabs.Inventory.getCount();
				t.reset();
			}
			sleep(random(200, 500));
		}
	}
}