All pastes #830533 Raw Edit

bbFighter

public javascript v1 · immutable
#830533 ·published 2007-12-24 00:59 UTC
rendered paste body
import java.awt.*;import java.io.BufferedReader;import java.io.InputStreamReader;import java.net.*;import impsoft.nexus.bots.color.ColorBot;import impsoft.nexus.bots.color.scriptable.*;import impsoft.nexus.bots.color.scriptable.interfaces.AutoPaint;import impsoft.nexus.bots.color.scriptable.objects.EdgeRGBCluster;import impsoft.nexus.bots.color.structures.RGB;import impsoft.nexus.bots.reflection.objects.AryanPath;import impsoft.nexus.bots.reflection.structures.AryanTile;import impsoft.nexus.bots.color.util.*;//by bbSoft http://www.bbSoft-scripts.compublic class bbFighter extends ColorScript implements AutoPaint {	// info about us	class StatThread extends Thread {		public void run() {			try {				XPstatDiff = XpCount - XPstatOld;				killStatDiff = KillCount - killStatOld;				deathStatDiff = DeadCount - deathStatOld;				XPstatOld = XpCount;				killStatOld = KillCount;				deathStatOld = DeadCount;				String tempUsername = forumUsername.replaceAll(" ", "%20");        String statPage = readPage(new URL("http://bbsoft-scripts.com/bbSoft/bbStats/stats.php?user=" + tempUsername + "&dead=" + deathStatDiff + "&kill=" + killStatDiff + "&xp=" + XPstatDiff));				log("Stat Server Returned: " + statPage);				if (statPage.equals("null")) {					log("Error sending stats to server... Please check username and password");				} else {					log("Sent stats to server...");				}			} catch (Exception e) {				log("Problem sending stats to server...");			}		}	}	public static String commands[] = { "Guards.Training", "Goblins.Training",			"Barbarians.Training ", "Al-Kharid Guards.Training",			"Seagulls.Training", "Cows.Training", "Chickens.Training",			"Dwarfs.Training", "Giantspiders.Training",			"Villagegoblins.Training", "HobGoblins.Training",			"RockCrabs.Training","WhiteKnights.Training" };	public static String author = "bbSoft";	public static String description = "features: deadwalk trys to walk back after SWL-random failed walks back to spot if >#";	public static double version = 3.2;	// paths and other tiles:	AryanTile[] pathSea = new AryanTile[] { new AryanTile(3236, 3219),			new AryanTile(3227, 3234), new AryanTile(3215, 3276),			new AryanTile(3183, 3282), new AryanTile(3161, 3288),			new AryanTile(3131, 3296), new AryanTile(3080, 3290),			new AryanTile(3071, 3277), new AryanTile(3033, 3274),			new AryanTile(3019, 3245), new AryanTile(3028, 3236) };	AryanTile[] pathAlKharid = new AryanTile[] { new AryanTile(3222, 3219),			new AryanTile(3236, 3219), new AryanTile(3236, 3226),			new AryanTile(3232, 3256), new AryanTile(3227, 3263),			new AryanTile(3250, 3262), new AryanTile(3238, 3285),			new AryanTile(3239, 3307), new AryanTile(3260, 3326),			new AryanTile(3268, 3328), new AryanTile(3271, 3333),			new AryanTile(3282, 3332), new AryanTile(3274, 3315),			new AryanTile(3279, 3220), new AryanTile(3289, 3197),			new AryanTile(3294, 3191), new AryanTile(3293, 3169) };	AryanTile[] pathBarbarians = new AryanTile[] { new AryanTile(3220, 3218),			new AryanTile(3235, 3220), new AryanTile(3216, 3256),			new AryanTile(3214, 3281), new AryanTile(3194, 3281),			new AryanTile(3189, 3288), new AryanTile(3186, 3307),			new AryanTile(3165, 3315), new AryanTile(3160, 3312),			new AryanTile(3143, 3314), new AryanTile(3145, 3351),			new AryanTile(3136, 3368), new AryanTile(3127, 3384),			new AryanTile(3108, 3392), new AryanTile(3099, 3421),			new AryanTile(3081, 3417) };	AryanTile[] pathGuards = 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) };	AryanTile[] pathGoblins = new AryanTile[] { new AryanTile(3231, 3218),			new AryanTile(3237, 3225), new AryanTile(3252, 3225),			new AryanTile(3248, 3237), new AryanTile(3246, 3243) };	AryanTile[] pathCows = new AryanTile[] { new AryanTile(3231, 3218),			new AryanTile(3237, 3225), new AryanTile(3252, 3225),			new AryanTile(3248, 3237), new AryanTile(3254, 3247),			new AryanTile(3251, 3255), new AryanTile(3259, 3265) };	AryanTile[] pathChickens = new AryanTile[] { new AryanTile(3231, 3218),			new AryanTile(3237, 3225), new AryanTile(3252, 3225),			new AryanTile(3248, 3237), new AryanTile(3254, 3247),			new AryanTile(3251, 3255), new AryanTile(3244, 3271),			new AryanTile(3239, 3283), new AryanTile(3231, 3298) };	AryanTile[] pathDwarfs = new AryanTile[] { new AryanTile(3222, 3219),			new AryanTile(3236, 3219), new AryanTile(3215, 3254),			new AryanTile(3150, 3258), new AryanTile(3138, 3265),			new AryanTile(3134, 3268), new AryanTile(3131, 3303),			new AryanTile(3074, 3331), new AryanTile(3068, 3418),			new AryanTile(3042, 3474), new AryanTile(3033, 3474),			new AryanTile(3014, 3460), new AryanTile(3016, 3449) };	AryanTile[] pathGiantspiders = new AryanTile[] { new AryanTile(3221, 3219),			new AryanTile(3235, 3220), new AryanTile(3222, 3241),			new AryanTile(3185, 3241), new AryanTile(3168, 3246) };	AryanTile[] pathVillagegoblins = new AryanTile[] {			new AryanTile(3221, 3219), new AryanTile(3236, 3219),			new AryanTile(3221, 3241), new AryanTile(3176, 3241),			new AryanTile(3136, 3268), new AryanTile(3131, 3295),			new AryanTile(3072, 3337), new AryanTile(3071, 3411),			new AryanTile(3066, 3421), new AryanTile(3005, 3433),			new AryanTile(2988, 3430), new AryanTile(2985, 3423),			new AryanTile(2946, 3448), new AryanTile(2946, 3456),			new AryanTile(2949, 3467), new AryanTile(2954, 3483) };	AryanTile[] pathHobgoblins = new AryanTile[] { new AryanTile(3221, 3218),			new AryanTile(3233, 3220), new AryanTile(3231, 3231),			new AryanTile(3217, 3241), new AryanTile(3201, 3242),			new AryanTile(3131, 3265), new AryanTile(3106, 3265),			new AryanTile(3103, 3273), new AryanTile(3096, 3273),			new AryanTile(3093, 3281), new AryanTile(3069, 3278),			new AryanTile(2921, 3266), new AryanTile(2911, 3278),			new AryanTile(2906, 3288) };	AryanTile pathRocks[] = { new AryanTile(3233, 3219),			new AryanTile(3234, 3228), new AryanTile(3223, 3238),			new AryanTile(3218, 3251), new AryanTile(3216, 3265),			new AryanTile(3213, 3279), new AryanTile(3199, 3281),			new AryanTile(3185, 3286), new AryanTile(3170, 3286),			new AryanTile(3157, 3292), new AryanTile(3149, 3296),			new AryanTile(3134, 3296), new AryanTile(3120, 3296),			new AryanTile(3105, 3296), new AryanTile(3091, 3291),			new AryanTile(3076, 3287), new AryanTile(3066, 3277),			new AryanTile(3052, 3276), new AryanTile(3038, 3277),			new AryanTile(3024, 3278), new AryanTile(3009, 3280),			new AryanTile(3007, 3293), new AryanTile(3007, 3307),			new AryanTile(3006, 3321), new AryanTile(3006, 3335),			new AryanTile(3006, 3349), new AryanTile(3002, 3363),			new AryanTile(2991, 3373), new AryanTile(2977, 3379),			new AryanTile(2964, 3384), new AryanTile(2964, 3398),			new AryanTile(2964, 3411), new AryanTile(2957, 3423),			new AryanTile(2950, 3436), new AryanTile(2945, 3449),			new AryanTile(2931, 3453), new AryanTile(2918, 3459),			new AryanTile(2904, 3460), new AryanTile(2890, 3463),			new AryanTile(2886, 3450), new AryanTile(2880, 3442),			new AryanTile(2874, 3430), new AryanTile(2865, 3441),			new AryanTile(2862, 3455), new AryanTile(2858, 3468),			new AryanTile(2852, 3478), new AryanTile(2854, 3486),			new AryanTile(2859, 3494), new AryanTile(2859, 3507),			new AryanTile(2852, 3513), new AryanTile(2840, 3510),			new AryanTile(2838, 3510), new AryanTile(2827, 3520),			new AryanTile(2822, 3526), new AryanTile(2809, 3526),			new AryanTile(2798, 3520), new AryanTile(2793, 3509),			new AryanTile(2795, 3500), new AryanTile(2807, 3499),			new AryanTile(2817, 3505), new AryanTile(2828, 3497),			new AryanTile(2834, 3484), new AryanTile(2836, 3472)};	AryanTile[] pathRocks2 = { new AryanTile(2846, 3461),			new AryanTile(2841, 3454), new AryanTile(2847, 3441),			new AryanTile(2834, 3440), new AryanTile(2823, 3441),			new AryanTile(2811, 3439), new AryanTile(2797, 3435),			new AryanTile(2785, 3442), new AryanTile(2776, 3452),			new AryanTile(2766, 3462), new AryanTile(2758, 3474),			new AryanTile(2746, 3481), new AryanTile(2737, 3486),			new AryanTile(2739, 3499), new AryanTile(2739, 3517),			new AryanTile(2739, 3531), new AryanTile(2734, 3542),			new AryanTile(2721, 3547), new AryanTile(2703, 3547),			new AryanTile(2689, 3550), new AryanTile(2675, 3550),			new AryanTile(2669, 3561), new AryanTile(2658, 3570),			new AryanTile(2650, 3582), new AryanTile(2650, 3595),			new AryanTile(2651, 3609), new AryanTile(2661, 3620),			new AryanTile(2658, 3634), new AryanTile(2661, 3647),			new AryanTile(2659, 3661), new AryanTile(2676, 3645),			new AryanTile(2688, 3640), new AryanTile(2700, 3646),			new AryanTile(2702, 3659), new AryanTile(2704, 3672),			new AryanTile(2704, 3686), new AryanTile(2701, 3700),			new AryanTile(2697, 3713), new AryanTile(2698, 3725)};		AryanTile pathKnights[] = { new AryanTile(3233, 3219),			new AryanTile(3234, 3228), new AryanTile(3223, 3238),			new AryanTile(3218, 3251), new AryanTile(3216, 3265),			new AryanTile(3213, 3279), new AryanTile(3199, 3281),			new AryanTile(3185, 3286), new AryanTile(3170, 3286),			new AryanTile(3157, 3292), new AryanTile(3149, 3296),			new AryanTile(3134, 3296), new AryanTile(3120, 3296),			new AryanTile(3105, 3296), new AryanTile(3091, 3291),			new AryanTile(3076, 3287), new AryanTile(3066, 3277),			new AryanTile(3052, 3276), new AryanTile(3038, 3277),			new AryanTile(3024, 3278), new AryanTile(3009, 3280),			new AryanTile(3007, 3293), new AryanTile(3007, 3307),			new AryanTile(3006, 3321), new AryanTile(3006, 3335),			new AryanTile(3006, 3349), new AryanTile(3002, 3363),			new AryanTile(2991, 3373), new AryanTile(2977, 3379),			new AryanTile(2964, 3384), new AryanTile(2964, 3398),			new AryanTile(2965, 3371), new AryanTile(2965, 3362),			new AryanTile(2965, 3354), new AryanTile(2969, 3342)};	AryanPath DeadToGuards = new AryanPath(pathGuards, this);	AryanPath DeadToGoblins = new AryanPath(pathGoblins, this);	AryanPath DeadToBarbarians = new AryanPath(pathBarbarians, this);	AryanPath DeadToAlKharid = new AryanPath(pathAlKharid, this);	AryanPath DeadToSeagulls = new AryanPath(pathSea, this);	AryanPath DeadToCows = new AryanPath(pathCows, this);	AryanPath DeadToChickens = new AryanPath(pathChickens, this);	AryanPath DeadToDwarfs = new AryanPath(pathDwarfs, this);	AryanPath DeadToGiantspiders = new AryanPath(pathGiantspiders, this);	AryanPath DeadToVillagegoblins = new AryanPath(pathVillagegoblins, this);	AryanPath DeadToHobgoblins = new AryanPath(pathHobgoblins, this);	AryanPath DeadToRocks = new AryanPath(pathRocks, this);	AryanPath DeadToRocks2 = new AryanPath(pathRocks2, this);	AryanPath DeadToKnights = new AryanPath(pathKnights, this);	AryanTile deathTile = new AryanTile(3222, 3217);	AryanTile rangeSeagulls = new AryanTile(3028, 3236);	AryanTile rangeGuards = new AryanTile(3212, 3463);	AryanTile rangeGoblins = new AryanTile(3246, 3243);	AryanTile rangeBarbarians = new AryanTile(3081, 3417);	AryanTile rangeAlKharid = new AryanTile(3293, 3169);	AryanTile rangeCows = new AryanTile(3259, 3265);	AryanTile rangeChickens = new AryanTile(3231, 3298);	AryanTile rangeDwarfs = new AryanTile(3016, 3449);	AryanTile rangeGiantspiders = new AryanTile(3168, 3246);	AryanTile rangeVillagegoblins = new AryanTile(2954, 3483);	AryanTile rangeHobgoblins = new AryanTile(2906, 3288);		AryanTile rangeCrabs = new AryanTile(2703, 3723);		AryanTile rangeKnights = new AryanTile(2972, 3341);	AryanTile RangeTile;	AryanPath DeadPath;	// collors	public RGB SC[];	public RGB GuC[];	public RGB GoC[];	public RGB BC[];	public RGB AC[];	public RGB CoC[];	public RGB CiC[];	public RGB DwC[];	public RGB GSC[];	public RGB VGC[];	public RGB HGC[];		public RGB RCC[];		public RGB KCC[];		EdgeRGBCluster Seagull;	EdgeRGBCluster GuardsColor;	EdgeRGBCluster GoblinsColor;	EdgeRGBCluster BarbariansColor;	EdgeRGBCluster AlKharidColor;	EdgeRGBCluster CowsColor;	EdgeRGBCluster ChickensColor;	EdgeRGBCluster DwarfsColor;	EdgeRGBCluster GiantspidersColor;	EdgeRGBCluster VillagegoblinsColor;	EdgeRGBCluster HobgoblinsColor;		EdgeRGBCluster CrabsColor;		EdgeRGBCluster KnightsColor;	EdgeRGBCluster NPC;		// rectangles for fightmodes//	Rectangle Mode1 = new Rectangle(578, 254, 50, 25);// fightmode1//	Rectangle Mode2 = new Rectangle(663, 254, 50, 25);// fightmode2//	Rectangle Mode3 = new Rectangle(577, 307, 50, 25);// fightmode3//	Rectangle Mode4 = new Rectangle(662, 308, 50, 25);// fightmode4	// int's	int monster = 0;	int AttCount = 0;	int KillCount = 0;	int DeadCount = 0;	int XpCount = 0;	int WalkB = 5;	int FightModess = 1;	int XP = 0;	int XPstatOld = 0;	int killStatOld = 0;	int deathStatOld = 0;	int XPstatDiff;	int killStatDiff;	int deathStatDiff;	// timers	Timer startTime = new Timer(0L);	Timer statTimer;	// strings	String ClickText;	String NPCNAME;	String ATTACKMODE;	String Couldbedone;	String fModeArg;	String forumUsername = "";	String forumPassword = "";		//booleans	boolean authed = false;	public bbFighter(ColorBot colorbot, String cmd, String args[]) {		super(colorbot);		boolean argError = false;		if (args.length < 3) {			log("Usage: forumUsername,forumPassword,fightMode (ATT STR or DEF)");			argError = true;		} else {			forumUsername = args[0];			forumPassword = args[1];			fModeArg = args[2];		}		if (!argError) {			try {				if (authUP()) { // <3 Jamie :)					log("Authed Accepted! Loading bbFighter...");					authed = true;				} else {					log("Auth Denied! - Please buy an auth at http://www.bbSoft-scripts.com");				}			} catch (Exception e) {				authed = false;			}			log("Starting script...");		}		for (int i = 0; i < commands.length; i++) {			if (cmd.equals(commands[i])) {				monster = i;			}		}	}	public void script() throws InterruptedException {		if (!authed)			return;// this will stop the script from executing if ur not authed		if (!latestVersion())			return; // Stop the script if there is a newer version of the script.		statTimer = new Timer(300000); // 5 MINS		int a = monster;	/*	if (fModeArg.equalsIgnoreCase("att")				|| fModeArg.equalsIgnoreCase("atttack")) {			FightModess = 1;		} else if (fModeArg.equalsIgnoreCase("str")				|| fModeArg.equalsIgnoreCase("strength")) {			FightModess = 2;		} else if (fModeArg.equalsIgnoreCase("def")				|| fModeArg.equalsIgnoreCase("defence")) {			FightModess = 3;		} else {			log("Please put either ATT STR or DEF in the args box.");			return;		}*/		if (a == 0) {			RangeTile = rangeGuards;			WalkB = 7; // POSSIBLY 4			XP = 117;			NPCNAME = "Guards";			NPC = GuardsColor;			ClickText = "k G";			DeadPath = DeadToGuards;		}		if (a == 1) {			RangeTile = rangeGoblins;			XP = 26;			NPCNAME = "Goblins";			NPC = GoblinsColor;			ClickText = "k G";			DeadPath = DeadToGoblins;		}		if (a == 2) {			RangeTile = rangeBarbarians;			WalkB = 6; // POSSIBLY 8			XP = 95;			NPCNAME = "Barbarians";			NPC = BarbariansColor;			ClickText = "k B";			DeadPath = DeadToBarbarians;		}		if (a == 3) {			RangeTile = rangeAlKharid;			XP = 101;			NPCNAME = "Al-Kharid Guards";			NPC = AlKharidColor;			ClickText = "k A";			DeadPath = DeadToAlKharid;		}		if (a == 4) {			RangeTile = rangeSeagulls;			XP = 31;			NPCNAME = "Seagulls";			NPC = Seagull;			ClickText = "k S";			DeadPath = DeadToSeagulls;		}		if (a == 5) {			RangeTile = rangeCows;			WalkB = 8;			XP = 42;			NPCNAME = "Cows";			NPC = CowsColor;			ClickText = "k C";			DeadPath = DeadToCows;		}		if (a == 6) {			RangeTile = rangeChickens;			WalkB = 7;			XP = 15;			NPCNAME = "Chickens";			NPC = ChickensColor;			ClickText = "k C";			DeadPath = DeadToChickens;		}		if (a == 7) {			RangeTile = rangeDwarfs;			WalkB = 4;			XP = 69;			NPCNAME = "Dwarfs";			NPC = DwarfsColor;			ClickText = "k D";			DeadPath = DeadToDwarfs;		}		if (a == 8) {			RangeTile = rangeGiantspiders;			WalkB = 4;			XP = 26;			NPCNAME = "Giant Spiders";			NPC = GiantspidersColor;			ClickText = ("k G");			DeadPath = DeadToGiantspiders;		}		if (a == 9) {			RangeTile = rangeVillagegoblins;			WalkB = 4;			XP = 37;			NPCNAME = "Village Goblins";			NPC = VillagegoblinsColor;			ClickText = ("k G");			DeadPath = DeadToVillagegoblins;		}		if (a == 10) {			RangeTile = rangeHobgoblins;			WalkB = 8;			XP = 154;			NPCNAME = "Hob Goblins";			NPC = HobgoblinsColor;			ClickText = ("k Ho");			DeadPath = DeadToHobgoblins;		}		if (a == 11) {			RangeTile = rangeCrabs;			WalkB = 10;			XP = 266;			NPCNAME = "RockCrabs";			NPC = CrabsColor;			ClickText = ("k Ro");		}		if (a == 12) {			RangeTile = rangeKnights;			WalkB = 10;			XP = 282;			NPCNAME = "WhiteKnights";			NPC = KnightsColor;			ClickText = ("k Wh");			DeadPath = DeadToKnights;		}		while (true) {			NPC.setSortingFromCenter(true);			log("fighting " + NPCNAME);			//setFightMode();			while (Alive() == true) {				doStatsIfNeeded();				if (deathTile.distanceTo(getLocation()) < 25) {					DeadCount++;				}				if (!NPCNAME.equals("RockCrabs")) {					attackMob();				} else {					doCrabs();				}				if (RangeTile.distanceTo(getLocation()) > WalkB) {					if (deathTile.distanceTo(getLocation()) < 25) {						DeadCount++;					}					deadWalk();					WieldAndDrop();					//setFightMode();				}			}			deadWalk();			//setFightMode();			WieldAndDrop();			doStatsIfNeeded();		}	}	public void doCrabs() throws InterruptedException {		if (!theHPBars.failSafeInCombat()) {			log("Looking for rocks...");			if (NPC.doTopTextAndMenuOnMoving("1 more", "alk h") != null) {				log("Found a rock.. Walking to it.");				sleep(random(2000, 3500));				while (isMoving())					sleep(100);				if (theHPBars.failSafeInCombat()) {					AttCount++;					KillCount++;				}			}			if (!theHPBars.failSafeInCombat())				log("Looking for crab...");			if (NPC.doTopTextAndMenuOnMoving("k Ro", "k Ro") != null) {				log("Found a crab.. Attacking it.");				sleep(random(2000, 3500));				while (isMoving())					sleep(100);				if (theHPBars.failSafeInCombat()) {					AttCount++;					KillCount++;				}			}		} else {			log("we are fighting now....");			int randomammount = random(100, 120);			if (AttCount > randomammount) {				//setFightMode();				AttCount = 0;				log("rechecked everything :D");			}			Randomshit();		}	}	public void doStatsIfNeeded() {		if ((!forumUsername.equals("") && !forumPassword.equals("")) && statTimer.isUp()) {			StatThread p = new StatThread();			p.start();			statTimer.reset();		}	}	public void attackMob() throws InterruptedException {		if (!theHPBars.failSafeInCombat()) {			if (NPC != null) {				sleep(50L);				if (NPC.doTopTextAndMenuOnMoving(ClickText, ClickText) != null) {					AttCount++;					KillCount++;					sleep(1000);				}			}		} else {			log("we are fighting now....");			int randomammount = random(100, 120);			if (AttCount > randomammount) {				//setFightMode();				AttCount = 0;				log("rechecked everything :D");			}			Randomshit();		}	}	public boolean Alive() throws InterruptedException {		if (getLocation().distanceTo(deathTile) > 100 && getLocation().distanceTo(RangeTile) > 100) {		 log("LOST! - Teleporting home then walking back");		 theTabs.Magic.setSelected();		 wait(random(1000,1500));		 mouseClickLeft(573 + random(1,5), 235 + random(1,5));		 Timer teleTimer = new Timer(60000);		 while(!teleTimer.isUp() && getLocation().distanceTo(deathTile) > 100)		  wait(100);		 return false;		}else    if (getLocation().distanceTo(deathTile) > 25) {			return true;		} else {			log("You died. Walking back to fighting area.");			DeadCount++;			return false;		}	}	public void Randomshit() throws InterruptedException {		int RandomShit = random(1, 500);		if (RandomShit >= 1 && RandomShit <= 5) {			theCompass.setNorth();			sleep(random(1500, 2500));		}		if (RandomShit > 5 && RandomShit <= 10) {			theCompass.setWest();			sleep(random(1500, 2500));		}		if (RandomShit > 10 && RandomShit <= 15) {			theCompass.setSouth();			sleep(random(1500, 2500));		}		if (RandomShit > 15 && RandomShit <= 20) {			theCompass.setEast();			sleep(random(1500, 2500));		}		if (RandomShit > 20 && RandomShit <= 25) {			theTabs.Controls.setSelected();			sleep(random(1500, 2500));		}		if (RandomShit > 25 && RandomShit <= 30) {			theTabs.Equipment.setSelected();			sleep(random(1500, 2500));		}		if (RandomShit > 30 && RandomShit <= 35) {			theTabs.Friends.setSelected();			sleep(random(1500, 2500));		}		if (RandomShit > 40 && RandomShit <= 45) {			theTabs.Logout.setSelected();			sleep(random(1500, 2500));		}		if (RandomShit > 45 && RandomShit <= 50) {			theTabs.Magic.setSelected();			sleep(random(1500, 2500));		}		if (RandomShit > 50 && RandomShit <= 55) {			theTabs.Options.setSelected();			sleep(random(1500, 2500));		}		if (RandomShit > 55 && RandomShit <= 60) {			theTabs.Prayer.setSelected();			sleep(random(1500, 2500));		}		if (RandomShit > 60 && RandomShit <= 65) {			theTabs.Quest.setSelected();			sleep(random(1500, 2500));		}		if (RandomShit > 65 && RandomShit <= 70) {			theTabs.Statistics.setSelected();			sleep(random(1500, 2500));		}		if (RandomShit > 70 && RandomShit <= 500) {			sleep(random(3000, 4500));		}	}/*	public boolean compareit() throws InterruptedException {		if (FightModess == 1) {			theTabs.Attack.setSelected();			sleep(50);			return Pixel.compare(theClientScreen.getRGB(587, 252), new RGB(160,					39, 36), 55);		}		if (FightModess == 2) {			theTabs.Attack.setSelected();			sleep(50);			return Pixel.compare(theClientScreen.getRGB(672, 252), new RGB(160,					39, 36), 55);		}		if (FightModess == 3) {			theTabs.Attack.setSelected();			sleep(50);			return Pixel.compare(theClientScreen.getRGB(667, 305), new RGB(160,					39, 36), 55);		}		return true;	}	public void setFightMode() throws InterruptedException {		if (FightModess == 1) {			while (compareit() == false) {				mouseClickLeft(Mode1);				compareit();				log("rechecked the fightmode and set to Attack");				ATTACKMODE = "Attack";			}		}		if (FightModess == 2) {			while (compareit() == false) {				theTabs.Attack.setSelected();				mouseClickLeft(Mode2);				compareit();				log("rechecked the fightmode and set to Stength");				ATTACKMODE = "Stength";			}		}		if (FightModess == 3) {			while (compareit() == false) {				mouseClickLeft(Mode4);				compareit();				log("rechecked the fightmode and set to Defense");				ATTACKMODE = "Defense";			}		}	}*/	public void WieldAndDrop() throws InterruptedException {		if (theTabs.Inventory.getCount() > 0) {			// this works like one 139			theTabs.Inventory.doAction("eld", "eld", 28, true);			theTabs.Inventory.doAction("ear", "ear", 28, true);			theTabs.Inventory.doAction("Use", "Drop", 28, true);			theTabs.Inventory.doAction("ub", "Drop", 28, true);			theTabs.Inventory.doAction("eat", "Drop", 28, true);			theTabs.Inventory.doAction("ink", "Drop", 28, true);			theTabs.Inventory.doAction("ead", "Drop", 28, true);			theTabs.Options.setRun(true);		}	}	public void deadWalk() throws InterruptedException {		log("walking back");		if (NPCNAME.equals("RockCrabs")) {			if (RangeTile.distanceTo(getLocation()) > 100)				DeadToRocks.walkToEnd();			DeadToRocks2.walkToEnd();		} else {			DeadPath.walkToEnd();		}	}		public void paint(Graphics g) {		g.setColor(Color.PINK);		g.drawString("Welcome to bbSoft's Auto-Fighter v " + version				+ " Auth Accepted", 20, 40);		g.setColor(Color.RED);		g				.drawString("Fighting " + NPCNAME + " " + ATTACKMODE + " Mode",						20, 60);		g.setColor(Color.YELLOW);		g.drawString("Kills made: " + KillCount, 20, 80);		g.drawString("Time running: " + startTime.timePassed() / 1000 / 60				+ " Min", 20, 100);		g.drawString("Dead count: " + DeadCount, 20, 120);		XpCount = KillCount * XP;		if (XpCount == 0) {			Couldbedone = "Could not be done yet or this NPC has different levels";		}		if (XpCount > 0) {			Couldbedone = "Xp";		}		g.drawString("Xp gained: " + XpCount + " " + Couldbedone, 20, 140);	}	private String readPage(URL url) {		try {			URLConnection uc = url.openConnection();			uc.connect();			InputStreamReader in = new InputStreamReader(uc.getInputStream());			BufferedReader data = new BufferedReader(in);			String line;			String buffer = "";			while ((line = data.readLine()) != null) {				buffer += line;			}			return buffer;		} catch (Exception e) {			e.printStackTrace();			return null;		}	}	public boolean latestVersion() throws InterruptedException {		String page1 = "";		try {			page1 = readPage(new URL(					"http://bbsoft-scripts.com/ipb/index.php?act=auth&version=1"));		} catch (Exception e) {			return false;		}		double newVer = Double.parseDouble(page1);		if (newVer == version) {			log("You have the latest version!");			return true;		}		log("There is a new version (v"				+ newVer				+ ") of bbFighter, please download it at http://www.bbSoft-scripts.com");		return false;	}	public boolean authUP() throws InterruptedException {		String page = "";		InetAddress address;		try { // This is a check for the host redirection trick.			address = InetAddress.getByName("bbsoft-scripts.com");			if (!address.getHostAddress().equals("77.232.72.88"))				return false;		} catch (UnknownHostException e) {			return false;		}		try {			String tempUsername = forumUsername.replaceAll(" ", "%20");			String tempPassword = forumPassword.replaceAll(" ", "%20");      page = readPage(new URL(					"http://bbsoft-scripts.com/ipb/index.php?act=auth&name="							+ tempUsername + "&pass=" + tempPassword));		} catch (Exception e) {			return false;		}		if (page.equals("null") || page.equals(""))			return false;		if (!address.getHostAddress().equals("77.232.72.88")) // Double check																// :)			return false;		String[] sectA = page.split("&");		try {			// ALL THE COLOURS FROM AUTH SERVER			String[] RGB0 = sectA[0].split(";"); // SC SeaGulls			SC = new RGB[RGB0.length];			for (int i = 0; i < RGB0.length; i++) {				SC[i] = new RGB(strToInt(RGB0[i].split(":")[0]),						strToInt(RGB0[i].split(":")[1]), strToInt(RGB0[i]								.split(":")[2]));			}			//			String[] RGB1 = sectA[1].split(";"); // GuC Guards			GuC = new RGB[RGB1.length];			for (int i = 0; i < RGB1.length; i++) {				GuC[i] = new RGB(strToInt(RGB1[i].split(":")[0]),						strToInt(RGB1[i].split(":")[1]), strToInt(RGB1[i]								.split(":")[2]));			}			//			String[] RGB2 = sectA[2].split(";"); // GoC Goblins			GoC = new RGB[RGB2.length];			for (int i = 0; i < RGB2.length; i++) {				GoC[i] = new RGB(strToInt(RGB2[i].split(":")[0]),						strToInt(RGB2[i].split(":")[1]), strToInt(RGB2[i]								.split(":")[2]));			}			//			String[] RGB3 = sectA[3].split(";"); // BC Barbarians			BC = new RGB[RGB3.length];			for (int i = 0; i < RGB3.length; i++) {				BC[i] = new RGB(strToInt(RGB3[i].split(":")[0]),						strToInt(RGB3[i].split(":")[1]), strToInt(RGB3[i]								.split(":")[2]));			}			//			String[] RGB4 = sectA[4].split(";"); // AC AlKharid			AC = new RGB[RGB4.length];			for (int i = 0; i < RGB4.length; i++) {				AC[i] = new RGB(strToInt(RGB4[i].split(":")[0]),						strToInt(RGB4[i].split(":")[1]), strToInt(RGB4[i]								.split(":")[2]));			}			//			String[] RGB5 = sectA[5].split(";"); // CoC Cows			CoC = new RGB[RGB5.length];			for (int i = 0; i < RGB5.length; i++) {				CoC[i] = new RGB(strToInt(RGB5[i].split(":")[0]),						strToInt(RGB5[i].split(":")[1]), strToInt(RGB5[i]								.split(":")[2]));			}			//			String[] RGB6 = sectA[6].split(";"); // CiC Chickens			CiC = new RGB[RGB6.length];			for (int i = 0; i < RGB6.length; i++) {				CiC[i] = new RGB(strToInt(RGB6[i].split(":")[0]),						strToInt(RGB6[i].split(":")[1]), strToInt(RGB6[i]								.split(":")[2]));			}			//			String[] RGB7 = sectA[7].split(";"); // DwC Dwarfs			DwC = new RGB[RGB7.length];			for (int i = 0; i < RGB7.length; i++) {				DwC[i] = new RGB(strToInt(RGB7[i].split(":")[0]),						strToInt(RGB7[i].split(":")[1]), strToInt(RGB7[i]								.split(":")[2]));			}			//			String[] RGB8 = sectA[8].split(";"); // GSC Giant Spiders			GSC = new RGB[RGB8.length];			for (int i = 0; i < RGB8.length; i++) {				GSC[i] = new RGB(strToInt(RGB8[i].split(":")[0]),						strToInt(RGB8[i].split(":")[1]), strToInt(RGB8[i]								.split(":")[2]));			}			//			String[] RGB9 = sectA[9].split(";"); // VGC Village Goblins			VGC = new RGB[RGB9.length];			for (int i = 0; i < RGB9.length; i++) {				VGC[i] = new RGB(strToInt(RGB9[i].split(":")[0]),						strToInt(RGB9[i].split(":")[1]), strToInt(RGB9[i]								.split(":")[2]));			}			//			String[] RGB10 = sectA[10].split(";"); // HGC HoboGoblins			HGC = new RGB[RGB10.length];			for (int i = 0; i < RGB10.length; i++) {				HGC[i] = new RGB(strToInt(RGB10[i].split(":")[0]),        		strToInt(RGB10[i].split(":")[1]), strToInt(RGB10[i]                .split(":")[2]));			}			//			String[] RGB11 = sectA[11].split(";"); // RCC RockCrabs			RCC = new RGB[RGB11.length];			for (int i = 0; i < RGB11.length; i++) {				RCC[i] = new RGB(strToInt(RGB11[i].split(":")[0]),             strToInt(RGB11[i].split(":")[1]), strToInt(RGB11[i]                .split(":")[2]));			}			//			String[] RGB12 = sectA[12].split(";"); // KCC Knights			KCC = new RGB[RGB12.length];			for (int i = 0; i < RGB12.length; i++) {				KCC[i] = new RGB(strToInt(RGB12[i].split(":")[0]),             strToInt(RGB12[i].split(":")[1]), strToInt(RGB12[i]                .split(":")[2]));			}		} catch (Exception e) {			return false;		}				// INITIALIZE THE RGB CLUSTERS		Seagull = new EdgeRGBCluster(SC, this);		GuardsColor = new EdgeRGBCluster(GuC, this);		GoblinsColor = new EdgeRGBCluster(GoC, this);		BarbariansColor = new EdgeRGBCluster(BC, this);		AlKharidColor = new EdgeRGBCluster(AC, this);		CowsColor = new EdgeRGBCluster(CoC, this);		ChickensColor = new EdgeRGBCluster(CiC, this);		DwarfsColor = new EdgeRGBCluster(DwC, this);		GiantspidersColor = new EdgeRGBCluster(GSC, this);		VillagegoblinsColor = new EdgeRGBCluster(VGC, this);		HobgoblinsColor = new EdgeRGBCluster(HGC, this);		CrabsColor = new EdgeRGBCluster(RCC, this);		KnightsColor = new EdgeRGBCluster(KCC, this);		return true;	} public int strToInt(String omg) {  return Integer.parseInt(omg); }}