import impsoft.nexus.bots.color.ColorBot; 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.color.util.*; import impsoft.nexus.bots.reflection.structures.*; import javax.swing.JOptionPane; import java.awt.Color; import java.awt.Graphics; import java.awt.Rectangle; public class bRanger extends ColorScript implements ChatListener, AutoPaint { //commands to show up public static String commands[] = { "Seagulls" , "Goblins" , "al-Kharid Guards" , "Guards" , "Fally Guards" , "Hobgoblins" , "Cows"}; //author(s) of script public static String author = "Beezkneez"; //Description of script public static String description = "Uses range to fight "; //Version of script public static double version = 1.0; //Tiles AryanTile killTile; AryanTile bankTile; AryanTile seagullsKill = new AryanTile(3028, 3234); AryanTile DrayBank = new AryanTile(3091, 3243); //Ints int monsterType; int deaths = 0; int randomMins; //Strings String status = ""; String fmode; String arrowType; String monsterName; //Timer private Timer runTime = new Timer(0); private Timer hideTimer = new Timer(0); private Timer randomMinutes = new Timer(0); //Booleans boolean SandWitch = false; boolean died = false; boolean bankHides = false; boolean needBow = false; boolean isFight = false; boolean banking = false; //New Prog Colors private static final Color BLACK = new Color(0, 0, 0, 100); private static final Color ORANGE = new Color(255, 128, 0, 255); private static final Color TEST = new Color(200, 200, 0, 100); // RGB EdgeRGBCluster2 monsterColor; EdgeRGBCluster2 seagullsColor = new EdgeRGBCluster2(new RGB[] { new RGB(250, 250, 249),new RGB(188, 153, 130) }, this,98, 15, 12,1, 2, 0); EdgeRGBCluster2 arrowColor = new EdgeRGBCluster2(new RGB[] { new RGB(107, 22, 13),new RGB(100, 25, 12) }, this,30, 19, 14,3, 3, 0); /* EdgeRGBCluster2 goblinsColor = new EdgeRGBCluster2; EdgeRGBCluster2 al-kharidColor = new EdgeRGBCluster2; EdgeRGBCluster2 guardsColor = new EdgeRGBCluster2; EdgeRGBCluster2 fallyGuardsColor = new EdgeRGBCluster2; EdgeRGBCluster2 hobGoblinsColor = new EdgeRGBCluster2; EdgeRGBCluster2 cowsColor = new EdgeRGBCluster2(new RGB[] { new RGB(135, 103, 76),new RGB(188, 153, 130) }, this,98, 15, 12,1, 2, 0); */ // Rectangle's public bRanger(ColorBot b, String cmd, String args[]) { super(b, false); for (int i = 0; i < commands.length; i++) { if (cmd.equals(commands)) { monsterType = i; } } Timer startTime; } public void script() throws InterruptedException { arrowType = JOptionPane.showInputDialog(null, "Please enter the arrow type you are using - (EX: addy, rune, steel)", "Arrow Type", JOptionPane.QUESTION_MESSAGE); randomMins = random(2700000, 3600000); Timer randomMinutes = new Timer(randomMins); cameraSettings(); status = "Loading Script..."; int a = monsterType; if (a == 0) { monsterColor = seagullsColor; monsterName = "Seagulls"; killTile = seagullsKill; bankTile = DrayBank; status = ("Fighting " + monsterName); } /* if (a == 1) { monsterColor = golbinsColor; monsterName = "Golbins"; killTile = goblinsKill; bankTile = goblinsBank; status = ("Fighting " + monsterName); } if (a == 2) { monsterColor = al-kharidColor; monsterName = "al-Kharid Guards"; killTile = al-kharidKill; bankTile = al-kharidBank; status = ("Fighting " + monsterName); } if (a == 3) { monsterColor = guardsColor; monsterName = "Guards"; killTile = guardsKill; bankTile = guardsBank; status = ("Fighting " + monsterName); } if (a == 4) { monsterColor = fallyGuardsColor; monsterName = "Fally Guards"; killTile = fallyGuardsKill; bankTile = fallyGuardsBank; status = ("Fighting " + monsterName); } if (a == 5) { monsterColor = hobGoblinsColor; monsterName = "Hobgoblins"; killTile = hobGoblinsKill; bankTile = hobGoblinsBank; status = ("Fighting " + monsterName); } if (a == 6) { monsterColor = cowsColor; monsterName = "Cows"; killTile = cowsKill; bankTile = cowsBank; status = ("Fighting " + monsterName); hideCheck = JOptionPane.showInputDialog(null, "Would you like to bank cow hides? (yes or no)", "Bank Hides?", JOptionPane.QUESTION_MESSAGE); if (hideCheck = ("es")) { bankHides = true; } else { bankHides = false; } log("Banking hides = " + bankHides); }*/ status = "Loading script..."; theWorldMap.walkTo(killTile); while(true) { doFight(); } } public void Randomstuff() throws InterruptedException { int RandomStuff = random(1, 30); if (RandomStuff >= 1 && RandomStuff < 5) { theCompass.setTo(90); sleep(random(500, 1500)); } if (RandomStuff >= 5 && RandomStuff < 10) { theCompass.setTo(180); sleep(random(500, 1500)); } if (RandomStuff >= 10 && RandomStuff < 15) { theCompass.setTo(270); sleep(random(500, 1500)); } if (RandomStuff >= 15 && RandomStuff < 20) { theCompass.setTo(270); sleep(random(500, 1500)); } if (RandomStuff >= 20 && RandomStuff < 30) { theCompass.setTo(90); sleep(random(500, 1500)); } } public void Bank() throws InterruptedException { status = "Getting more arrows"; theTabs.Options.setRun(true); Randomstuff(); theWorldMap.walkTo(bankTile); this.theBankV3.open(); this.theBankV3.doDepositAllBut(new String[] { "arrow" }); this.theBankV3.doWithDrawX(arrowType, (random(500, 1000))); theWorldMap.walkTo(killTile); cameraSettings(); } public void BankHides() throws InterruptedException { status = "Banking Hides"; theTabs.Options.setRun(true); Randomstuff(); theWorldMap.walkTo(bankTile); this.theBankV3.open(); this.theBankV3.doDepositAllBut(new String[] { "arrow" }); //checkArrows(); theWorldMap.walkTo(killTile); cameraSettings(); } public void BankBow() throws InterruptedException { log("Getting Bow"); theTabs.Options.setRun(true); Randomstuff(); theWorldMap.walkTo(bankTile); this.theBankV3.open(); this.theBankV3.doDepositAllBut(new String[] { "arrow" }); this.theBankV3.doWithDraw1("bow", true); theWorldMap.walkTo(killTile); cameraSettings(); } public void cameraSettings() throws InterruptedException { theCamera.setCameraUp(); theCompass.setNorth(); } public void doFight() throws InterruptedException { if (!theHPBars.failSafeInCombat() && (monsterColor != null)) { status = "We are out fight, and we found NPC"; pickupArrows(); sleep(random(25,25)); if (monsterColor.doTopTextAndMenuOnMoving("Attack", "Attack") != null) { status = "We Clicked NPC"; sleep(random(250,500)); } } else { status = "Waiting...."; sleep(random(50,50)); } } public void pickupArrows() throws InterruptedException { if (randomMinutes.isUp() && (banking == false)){ randomMinutes.reset(); log("Picking up arrows"); status = "Looking for arrows"; arrowColor.doTopTextAndMenuOnMoving("Take", "arrow"); } else { log("Cant find arrows"); } } public void deadWalk() throws InterruptedException { status = "Died, walking back"; // equip(); theWorldMap.walkTo(killTile); } public void chat(String message) throws InterruptedException { if(message.contains("strange place")) { SandWitch = true; } if(message.contains("dear")) { died = true; deaths++; deadWalk(); } if(message.contains("quiver")) { log("no ammo"); banking = true; Bank(); } } //Very sexy prog report by ~alex~ public void paint(Graphics g) { long runTimer = runTime.timePassed(); long TotalSecs = runTimer / 1000; long TotalMins = TotalSecs / 60; long TotalHours = TotalMins / 60; int seconds = (int) TotalSecs % 60; int minutes = (int) TotalMins % 60; int hours = (int) TotalHours % 60; StringBuilder b = new StringBuilder(); if (hours < 10) b.append('0'); b.append(hours); b.append(':'); if (minutes < 10) b.append('0'); b.append(minutes); b.append(':'); if (seconds < 10) b.append('0'); b.append(seconds); g.setColor(BLACK); g.fill3DRect(12, 31, 180, 180, true); g.setColor(ORANGE); g.drawString("bRanger v " + version + " by Beezkneez", 15, 50); g.drawString("Run Time " + b.toString(), 15, 75); g.drawString("Died " + deaths + " times", 15, 100); g.drawString("Banking Hides : " + bankHides, 15, 125); g.drawString("Killing " + monsterName, 15, 150); g.setColor(TEST); g.drawString("Status: " + status, 15, 205); } }