All pastes #359688 Raw Edit

Something

public java v1 · immutable
·published 2007-02-17 00:15 UTC
rendered paste body
import java.awt.Rectangle;import impsoft.nexus.bots.color.methods.ColorRandom;import impsoft.nexus.bots.color.scriptobjects.DTM;import impsoft.nexus.bots.color.scriptobjects.RGB;import impsoft.nexus.bots.color.scriptobjects.XY;public class SRLBeekeeper extends ColorRandom {	public int px;	public int py;	public int BeeKeepers;	public long bkm;	public DTM[] bk1 = DTMFromString("78DA637CCFC0C010C08002AE5FBAC8C00FA419A17CC63740C20E55CDC553A750D5DC02129EA86A5E3C7D8AAAE62C9088475573E7FA755435DC40561CAA9A2533A6A3AA01B1BC50D5ECDEB001450D004BC013DD");	public DTM[] bk2 = DTMFromString("78DA639CC8C0C010C880020EEDDCC1C00FA41"			+ "9A17CC6D3986AD62C5880AA662990484355B36BE3465435AB31D5"			+ "6C5FB31A55CD464C355B56AE4055B30D53CDBA850B51D59C0712E"			+ "9A86A66F6F761AA89425533A1AD0D554D2FA69A5DEBD7A3AAE9C3"			+ "74CFD1BD7B51D4000064E81F19");	public DTM[] bk4 = DTMFromString("78DA63BCCBC0C060C780028EEDDBC7C00FA41"			+ "9A17C460920CB0155CD9A050B50D5480359EEA86AA67476A2AAB9"			+ "0524DC50D56C5BB31A55CD43201185AAE6C0F66DA86A8481AC105"			+ "4353BD6AE4155F3034878A0AA59347D3A8A1A0009451441");	public DTM[] bk3 = DTMFromString("78DA63DCC8C0C050C880020EEEDCC1C00FA41"			+ "9A17CC63740221F55CDDA850B51D5BC071215A86AA67476A2AAB9"			+ "0E249A51D5CCECEF4355730E4834A0AA1115124255B31648B4A1A"			+ "AD9B97E1DA67B5A51D5CC993811450D0020E41535");	@Override	public boolean startUp() throws InterruptedException {		if (!isLoggedin()) {			setNextCheck(10000);			return false;		} else {			if (getRGB(649, 78) == new RGB(0, 0, 0)) {				log("Middle of mm black, checking for bee keeper");				sleep(random(2000, 2200));				if (FindBeeKeeper()) {					log("Found Bee Keeper, Trying to solve");					return true;				}			}		}		setNextCheck(9000);		return false;	}	public boolean FindBeeKeeper() throws InterruptedException {		int ct = 0;		XY tXY = findXYspiral(getColorArray2d(), new RGB(14802401,				RGB.COLOR_TYPE_SCAR), new Rectangle(163, 96, 427 - 163,				255 - 96), ct, ct, ct);		while (tXY == null) {			ct++;			tXY = findXYspiral(getColorArray2d(), new RGB(14802401,					RGB.COLOR_TYPE_SCAR), new Rectangle(163, 96, 427 - 163,					255 - 96), ct, ct, ct);		}		mouseMove(tXY);		sleep(180);		return IsUpText("per");	}	public boolean IsUpText(String str) {		return getTopText().contains(str);	}	public boolean OpenWin() throws InterruptedException {		if (!(IsUpText("per"))) {			FindBeeKeeper();		} else {			mouseClickLeft(currentMouseX(), currentMouseY());			sleep(10);			mouseMove(random(296, 306), random(447, 448));			sleep(random(1000, 1100));			bkm = System.currentTimeMillis();			while (findXYspiral(getColorArray2d(), new RGB(16777215,					RGB.COLOR_TYPE_SCAR), new Rectangle(23, 437, 394 - 23,					461 - 437), 0, 0, 0) != null					&& ((System.currentTimeMillis() - bkm) < 30000)) {				mouseClickLeft(random(296, 306), random(447, 448));				sleep(random(1000, 1200));			}			wait(random(1000, 1500));		}		return true;	}	public void flag() throws InterruptedException {		while (isMapFlagUp()) {			sleep(defaultmaxAgeInMillisecs);		}	}	public void DoneBk() throws InterruptedException {		mouseMove(random(254, 257), random(270, 273));		wait(200 + random(0, 100));		mouseClickLeft(currentMouseX(), currentMouseY());		wait(1000);		bkm = System.currentTimeMillis();		while (findXYspiral(getColorArray2d(), new RGB(16711680,				RGB.COLOR_TYPE_SCAR), new Rectangle(23, 437, 394 - 23,				461 - 437), 0, 0, 0) != null				|| ((System.currentTimeMillis() - bkm) < 70000)) {			sleep(defaultmaxAgeInMillisecs);		}		sleep(1000 + random(0, 500));		log("Solved Bee Keeper!");	}	public boolean FindPiece(DTM[] piece) throws InterruptedException {		long fpMark;		fpMark = System.currentTimeMillis();		while (findDTM(getColorArray2d(), piece, new Rectangle(23, 29, 403,				224 - 29)) != null) {			sleep(100);			if ((System.currentTimeMillis() - fpMark) > 23000) {				break;			}		}		return true;	}	public boolean ClickPiece(DTM[] piece) throws InterruptedException {		if (!(FindPiece(piece))) {			return false;		}		mouseClickLeft(px + 10, py + 5);		wait(800 + random(0, 100));		return true;	}	public void ClickArrow(int arrow) throws InterruptedException {		if (arrow == 1)			mouseClickLeft(141 + random(0, 5), 275 + random(0, 5));		if (arrow == 2)			mouseClickLeft(194 + random(0, 5), 269 + random(0, 5));		if (arrow == 3)			mouseClickLeft(314 + random(0, 5), 273 + random(0, 5));		if (arrow == 4)			mouseClickLeft(361 + random(0, 5), 271 + random(0, 5));	}	public boolean MovePiece(int mx, int my, DTM[] piece)			throws InterruptedException {		if (!(ClickPiece(piece))) {			return false;		}		while (px < mx) {			ClickArrow(4);			wait(600 + random(0, 100));			px = px + 15;		}		while (py < my) {			ClickArrow(2);			wait(600 + random(0, 100));			py = py + 15;		}		while (px > mx + 16) {			ClickArrow(3);			wait(600 + random(0, 100));			px = px - 15;		}		while (py > my + 16) {			ClickArrow(1);			wait(600 + random(0, 100));			py = py - 15;		}		return true;	}	public boolean FixPiece(int piece) throws InterruptedException {		if (piece == 1) {			return MovePiece(84, 62, bk1);		}		if (piece == 2) {			return MovePiece(61, 165, bk2);		}		if (piece == 3) {			return MovePiece(350, 47, bk3);		}		if (piece == 4) {			return MovePiece(350, 158, bk4);		}		return false;	}	public boolean SolvePiece(int piece) throws InterruptedException {		if (piece == 1) {			return MovePiece(244, 29, bk1);		}		if (piece == 2) {			return MovePiece(222, 82, bk2);		}		if (piece == 3) {			return MovePiece(224, 141, bk3);		}		if (piece == 4) {			return MovePiece(224, 190, bk4);		}		return false;	}	public boolean FixPieces() throws InterruptedException {		if (!(FixPiece(2)))			return false;		if (!(FixPiece(4)))			return false;		if (!(FixPiece(3)))			return false;		if (!(FixPiece(1)))			return false;		return true;	}	public boolean MovePieces() throws InterruptedException {		if (!(SolvePiece(2)))			return false;		if (!(SolvePiece(4)))			return false;		if (!(SolvePiece(3)))			return false;		if (!(SolvePiece(1)))			return false;		return true;	}	@Override	public void random() throws InterruptedException {		OpenWin();		if (!(FixPieces())) {			log("Error solving bee keeper, Trying Again");			mouseClickLeft(497 + random(0, 3), 17 + random(0, 3));			random();		}		if (!(MovePieces())) {			log("Error solving bee keeper, Trying Again");			mouseClickLeft(497 + random(0, 3), 17 + random(0, 3));			random();		}		DoneBk();	}}