All pastes #415485 Raw Edit

Stuff

public java v1 · immutable
#415485 ·published 2007-03-29 17:45 UTC
rendered paste body
public boolean doCluster(int xOffet, int yOffset, String topText,			String action, boolean moving) throws InterruptedException {		removeRedundantPoints(10);		sortPointsByDistanceToXY(new XY((int) bounds.getCenterX(), (int) bounds				.getCenterY()));		XY nextPoint;		while ((nextPoint = getNext()) != null) {			long mousetime = 0;			XY movingMouseTo = new XY(nextPoint.x + xOffet, nextPoint.y					+ yOffset);			theScript.addOrder(new Order(theScript.getPrority(),					Order.ORDER_MOVE, movingMouseTo.x, movingMouseTo.y,					Areas.ENTIRE, false));			do {				mousetime = theScript.getInputBot().theInputTread						.timeTillDone();				if (mousetime != -1) {					if (moving) {						int interval = StaticColorMethods.defaultmaxAgeInMillisecs * 2;						updatePoints();						removeRedundantPoints(3);						if (mousetime > interval) {							paintPoints(interval);							Thread.sleep(interval);						}else{							paintPoints((int) mousetime);							Thread.sleep(mousetime);						}						nextPoint = getNext();						if (nextPoint != null) {							XY updatedMovingMouseTo = new XY(nextPoint.x									+ xOffet, nextPoint.y + yOffset);							if (SortMethods.distance(movingMouseTo,									updatedMovingMouseTo) > 5) {								movingMouseTo = updatedMovingMouseTo;								theScript.addOrder(new Order(theScript										.getPrority(), Order.ORDER_MOVE,										movingMouseTo.x, movingMouseTo.y,										Areas.ENTIRE, true));								Thread.sleep(10);							}						}					} else {						paintPoints((int) mousetime);						Thread.sleep(mousetime);					}				}			} while (mousetime > 0);			if (nextPoint != null) {				if (SortMethods.distance(nextPoint, theScript.currentMouseXY()) <= 10) {					if (topText != null) {						Thread.sleep(StaticColorMethods.defaultmaxAgeInMillisecs+1);						if (theScript.getTopText().contains(topText)) {							theScript.mouseClickRight(new XY(nextPoint.x									+ xOffet, nextPoint.y + yOffset));							Menu menu = theScript.getMenu(Areas.GAME, 2000);							if (menu != null) {								if (menu.selectContains(action)) {									return true;								} else {									menu.exit();								}							}						}					} else {						theScript.mouseClickRight(new XY(nextPoint.x + xOffet,								nextPoint.y + yOffset));						Menu menu = theScript.getMenu(Areas.GAME, 2000);						if (menu != null) {							if (menu.selectContains(action)) {								return true;							} else {								menu.exit();							}						}					}					pop();				}			}		}		return false;	}