All pastes #575140 Raw Edit

Stuff

public javascript v1 · immutable
·published 2007-06-18 21:30 UTC
rendered paste body
import impsoft.nexus.bots.color.*;import impsoft.nexus.bots.color.util.*;import impsoft.nexus.bots.color.scriptable.*;import impsoft.nexus.bots.color.scriptable.interfaces.*;import impsoft.nexus.bots.color.scriptable.objects.*;import impsoft.nexus.bots.color.structures.*;import impsoft.nexus.bots.reflection.objects.*;import impsoft.nexus.bots.reflection.structures.*;import java.awt.*;public class AdvancedAutoFighter extends ColorScript implements AutoPaint {	public static double version = 1.0;	public static String[] commands = new String[] {			"Rock Crabs (Under Development)", "Guards", "Goblins",			"Barbarians", "Al-Kharid Guards" };	public String author = "Beezkneez";	public String description = "Advanced Auto Fighter v" + (version);	public int Kills;	public Timer StartTimer;	public String status = "Starting Script";	int monster = 0;	// Declare tiles and paths.	AryanTile rockCrabLoc1 = new AryanTile(2685, 3728, 5);	AryanTile rockCrabLoc2 = new AryanTile(2683, 3720, 5);	AryanTile GuardsCirlce = new AryanTile(3213, 3464, 5);	AryanTile GoblinsHut = new AryanTile(3244, 3245);	AryanTile BarbariansCircle = new AryanTile(2671, 3716);	AryanTile KaridRoom = new AryanTile(3284, 3172);	// ///////////////////////////Death Walkbacks/////////////////////////////	AryanTile LumbySpawn = new AryanTile(3222, 3215);	AryanTile[] VarrockWalkPath = new AryanTile[] { new AryanTile(3234, 3219),			new AryanTile(3234, 3236), new AryanTile(3232, 3253),			new AryanTile(3244, 3266), new AryanTile(3238, 3283),			new AryanTile(3238, 3301), new AryanTile(3250, 3315),			new AryanTile(3266, 3324), new AryanTile(3279, 3336),			new AryanTile(3288, 3352), new AryanTile(3293, 3370),			new AryanTile(3292, 3387), new AryanTile(3291, 3405),			new AryanTile(3282, 3419), new AryanTile(3270, 3428),			new AryanTile(3252, 3429), new AryanTile(3241, 3443),			new AryanTile(3235, 3459), new AryanTile(3218, 3465),			new AryanTile(3212, 3463) };	AryanPath varrockWalkBack = new AryanPath(VarrockWalkPath, this);	// ///////////////////////////End death	// walkbacks/////////////////////////////	// Solars method of random sleep time.	private long rsleep(int min, int max) throws InterruptedException {		long time = random(min, max);		sleep(time);		return time;	}	public void paint(Graphics g) {	}	private void walkToTile(AryanTile t) throws InterruptedException {		new AryanPath(t, this).walkToEnd();	}	public AdvancedAutoFighter(ColorBot b, String cmd, String args[]) {		super(b);		log("Starting script...");		for (int i = 1; i < 5; i++) {			if (cmd.equals(commands[i])) {				monster = i;			}		}	}	public void script() throws InterruptedException {		rsleep(2000, 2500);		wieldWeapons();		rsleep(500, 1000);		{			/*			 * { if(monster == 1); { while (monster == 1) {			 * 			 * rsleep(1000, 1500); walkToTile(rockCrabLoc1);			 * waitTillMovingStop(); attackCrabs();			 * 			 * log("Still Under Development, Shutting Down"); shutDown(); }			 */		}		if (monster == 2)			;		while (monster == 2)			if (!checkDead()) {				waitTillMovingStop();				attackGuards();			} else if (checkDead()) {				varrockWalkBack.walkToEnd();				wieldWeapons();			}		{			if (monster == 3)				;			walkToTile(GoblinsHut);			{				while (monster == 3)					if (!checkDead()) {						waitTillMovingStop();						AttackGoblins();					} else if (checkDead()) {						varrockWalkBack.walkToEnd();						wieldWeapons();					}			}			if (monster == 4)				;			walkToTile(BarbariansCircle);			{				while (monster == 4)					if (!checkDead()) {						waitTillMovingStop();						attackBarbarians();					} else if (checkDead()) {						varrockWalkBack.walkToEnd();						wieldWeapons();					}			}			if (monster == 5)				;			walkToTile(KaridRoom);			{				while (monster == 5)					if (!checkDead()) {						waitTillMovingStop();						attackAlKharidGuards();					} else if (checkDead()) {						varrockWalkBack.walkToEnd();						wieldWeapons();					}			}		}	}	/*	 * private RGBCluster CrabColor1 = new RGBCluster(new RGB[] { new RGB(160,	 * 151, 128) }, this);	 * 	 * public void attackCrabs() throws InterruptedException { rsleep(1000,	 * 1500); if (theHPBars.failSafeInCombat()) { status = "fighting"; log("In	 * Fight"); rsleep(3000,3200); } else { log("Looking for more crabs");	 * status = "Finding Crabs"; walkToTile(rockCrabLoc1); waitTillMovingStop();	 * CrabColor1.doTopTextAndMenu("Attack", "Rock Crab"); status = "Fighting"; } }	 * 	 * public void attackCrabs2() throws InterruptedException { rsleep(1000,	 * 1500); if (theHPBars.failSafeInCombat()) { status = "fighting"; log("In	 * Fight"); rsleep(3000,3200); } else { log("Looking for more crabs");	 * status = "Finding Crabs"; walkToTile(rockCrabLoc2); waitTillMovingStop();	 * CrabColor1.doTopTextAndMenu("Attack", "Rock Crab"); status = "Fighting"; } }	 * 	 * public void attackCrabs3() throws InterruptedException { rsleep(1000,	 * 1500); if (theHPBars.failSafeInCombat()) { status = "fighting"; log("In	 * Fight"); rsleep(3000,3200); } else { log("Looking for more crabs");	 * status = "Finding Crabs"; walkToTile(rockCrabLoc2); waitTillMovingStop();	 * CrabColor1.doTopTextAndMenu("Attack", "Rock Crab"); status = "Fighting"; } }	 */	public void AttackGoblins() throws InterruptedException {		RGB goblin1 = new RGB(156, 162, 59);		RGB goblin2 = new RGB(105, 125, 85);		RGB goblin3 = new RGB(118, 158, 90);		RGB findGolbins[] = { goblin1, goblin2, goblin3 };		sleep(1000L);		if (theHPBars.failSafeInCombat()) {			log("In Fight");			rsleep(3000, 3200);		} else {			log("Looking for Goblins");			theSimpleRGBCluster.doActionAtRGBCluster(findGolbins,					"Attack Goblin", "Attack Goblin");		}	}	public void attackGuards() throws InterruptedException {		RGB Guard1 = new RGB(206, 169, 25);		RGB Guard2 = new RGB(137, 112, 14);		RGB Guard3 = new RGB(182, 149, 22);		RGB findGuard[] = { Guard1, Guard2, Guard3 };		rsleep(1000, 1500);		if (theHPBars.failSafeInCombat()) {			log("In Fight");			rsleep(3000, 3200);		} else {			log("Looking for Guards");			theSimpleRGBCluster.doActionAtRGBCluster(findGuard, "Attack Guard",					"Attack Guard");		}	}	public void attackBarbarians() throws InterruptedException {		RGB Barbarians1 = new RGB(156, 162, 59);		RGB Barbarians2 = new RGB(105, 125, 85);		RGB Barbarians3 = new RGB(118, 158, 90);		RGB findBarbarians[] = { Barbarians1, Barbarians2, Barbarians3 };		rsleep(1000, 1500);		if (theHPBars.failSafeInCombat()) {			log("In Fight");			rsleep(3000, 3200);		} else {			log("Looking for Barbarians");			theSimpleRGBCluster.doActionAtRGBCluster(findBarbarians,					"Attack Barbarian", "Attack Barbarian");		}	}	public void attackAlKharidGuards() throws InterruptedException {		RGB AlKharidGuards1 = new RGB(115, 13, 114);		RGB AlKharidGuards2 = new RGB(119, 13, 118);		RGB AlKharidGuards3 = new RGB(127, 13, 126);		RGB findAlKharidGuards[] = { AlKharidGuards1, AlKharidGuards2,				AlKharidGuards3 };		rsleep(1000, 1500);		if (theHPBars.failSafeInCombat()) {			log("In Fight");			rsleep(3000, 3200);		} else {			log("Looking for Al-Karid Guards");			theSimpleRGBCluster.doActionAtRGBCluster(findAlKharidGuards,					"Attack Al-Kharid", "Attack Al-Kharid");		}	}	public boolean checkDead() throws InterruptedException {		if (getLocation().distanceTo(LumbySpawn) <= 5) {			return true;		} else			return false;	}	public void wieldWeapons() throws InterruptedException {		log("Re-Equiping Weapons/Armor.");		theTabs.Inventory.doAction(new String[0], "Wear", 3, false);		theTabs.Inventory.doAction(new String[0], "Wield", 3, false);	}}