Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import impsoft.bots.ColorBot;
- import impsoft.bots.reflection.GroundItem;
- import impsoft.bots.reflection.NPC;
- import impsoft.bots.reflection.PhysicalObject;
- import impsoft.scripting.ibot.builtin.itemrec.ItemSlot;
- import impsoft.scripting.ibot.enums.Skill;
- import impsoft.scripting.ibot.interfaces.AutoPaint;
- import impsoft.scripting.ibot.structs.AryanTile;
- import impsoft.scripting.ibot.structs.AryanTileZone;
- import impsoft.scripting.types.ColorScript;
- import impsoft.scripting.types.parallel.scriptjobs.RepeatableScriptJob;
- import impsoft.utils.general.Timer;
- import impsoft.utils.ibot.RandomGenerator;
- import impsoft.utils.uber.UberClickOptions;
- import impsoft.utils.uber.UberScriptUtils;
- import impsoft.values.constant.Areas;
- import impsoft.values.variable.MouseSettings;
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Rectangle;
- import java.awt.event.ActionEvent;
- import java.util.EnumSet;
- import java.util.HashMap;
- import javax.swing.JCheckBox;
- import bergCoder.BergUtils;
- import bergCoder.LootItem;
- import bergCoder.LootTable;
- public class UniKilla extends ColorScript implements AutoPaint {
- public UniKilla(ColorBot arg0) {
- super(arg0);
- }
- public static String author = "90dragon900";
- public static String description = "Unicorn Moneymaking revolution";
- public static double version = 1.0;
- private BergUtils util = new BergUtils(this);
- public Timer timeran = new Timer(0);
- // Booleans
- boolean StartScript = false;
- boolean trainingatk = false;
- boolean trainingdef = false;
- boolean trainingstr = false;
- boolean trainingrng = false;
- boolean trainingmag = false;
- boolean burybones = false;
- boolean UseSpecial = false;
- boolean killUnis = false;
- boolean spec = false;
- boolean trainingthrownrng = false;
- boolean lootcharms = false;
- boolean dumpfood = false;
- LootTable lootTable = new LootTable();
- int lootDistance = 4;
- public HashMap<String, LootItem> ammoHash = new HashMap<String, LootItem>();
- public LootItem[] ammo = { new LootItem("Bronze bolts", 877, 0),
- new LootItem("Iron bolts", 9140, 0),
- new LootItem("Steel bolts", 9141, 0),
- new LootItem("Mithril bolts", 9142, 80),
- new LootItem("Adamantite bolts", 9143, 0),
- new LootItem("Runite bolts", 9144, 0),
- new LootItem("Kebbit bolts", 10158, 0),
- new LootItem("Long kebbit bolts", 10159, 0),
- new LootItem("Bone bolts", 8882, 0),
- new LootItem("Bronze arrow", 882, 0),
- new LootItem("Iron arrow", 884, 0),
- new LootItem("Steel arrow", 886, 0),
- new LootItem("Mithril arrow", 888, 0),
- new LootItem("Adamantite arrow", 890, 0),
- new LootItem("Runite arrow", 892, 0),
- new LootItem("Bronze dart", 806, 0),
- new LootItem("Iron dart", 807, 0),
- new LootItem("Steel dart", 808, 0),
- new LootItem("Mithril dart", 809, 0),
- new LootItem("Adamantite dart", 810, 0),
- new LootItem("Runite dart", 811, 0),
- new LootItem("Bronze knife", 864, 0),
- new LootItem("Iron knife", 863, 0),
- new LootItem("Black knife", 869, 0),
- new LootItem("Steel knife", 865, 0),
- new LootItem("Mithril knife", 866, 0),
- new LootItem("Adamantite knife", 867, 0),
- new LootItem("Runite knife", 868, 0),
- new LootItem("Broad-tipped bolt", 13281, 0),
- new LootItem("Broad arrow", 4150, 0) };
- public LootItem[] unihorns = { new LootItem("Unicorn horn", 297, 2328) };
- public LootItem[] charms =
- {
- new LootItem("Gold charm", 563, 309), new LootItem("Green charm", 561, 232),
- new LootItem("Crimson charm", 556, 13), new LootItem("Blue charm", 557, 11)
- };
- // Strings
- String food = null;
- String train = null;
- String rangedPickup = null;
- // Ints
- public int xpgained = 0;
- public int startxp = 0;
- public int lvlsgained = 0;
- public int currxp = 0;
- public int startLvl = 0;
- public int currentLvl = 0;
- public int timesbanked = 0;
- public int kills = 0;
- public int loot = 0;
- public int Amount = 10;
- public int specialAttackPerc = 25;
- public int eatfoodat = 50;
- public int unicornhorn = 0;
- public int swing = -1;
- public int arrowsleft = 0;
- public int arrowstowithdraw = 0;
- public int thrownsleft = 0;
- int[] id = {28121};
- String[] uni = { "Black unicorn" };
- // Tiles and Zones
- AryanTileZone BankZone = new AryanTileZone(new AryanTile(3182, 3696),
- (new AryanTile(3190, 3689)));
- AryanTileZone Unis = new AryanTileZone(new AryanTile(3071, 3642),
- (new AryanTile(3105, 3618)));
- AryanTileZone DepositBox = new AryanTileZone(new AryanTile(3133, 3628),
- (new AryanTile(3137, 3624)));
- AryanTile AfterTunnel = new AryanTile(3165, 3696);
- AryanTile BeforeTunnel = new AryanTile(3164, 3685);
- AryanTile UniBridge = new AryanTile(3164, 3685);
- AryanTileZone OnWayToUnis1 = new AryanTileZone(new AryanTile(3137, 3688),
- (new AryanTile(3146, 3682)));
- AryanTileZone OnWayToUnis2 = new AryanTileZone(new AryanTile(3117, 3672),
- (new AryanTile(3127, 3666)));
- AryanTileZone OnWayToUnis3 = new AryanTileZone(new AryanTile(3102, 3684),
- (new AryanTile(3106, 3678)));
- AryanTileZone UnisLayer = new AryanTileZone(new AryanTile(3053, 3659),
- (new AryanTile(3116, 3604)));
- // Timer
- Timer Time = new Timer(0);
- Timer f = new Timer((random(15, 54)) * (1000 * 60));
- long scriptStartTIME = System.currentTimeMillis();
- String[] drop = { "Fire battlestaff", "Super attack (1)",
- "Super strength (1)", "Vial", food, "Uncut emerald", "Uncut ruby",
- "Obsidian charm" };
- public void script() throws InterruptedException, Exception {
- try {
- stopRandom("PublicChatOff");
- while (!isLoggedIn())
- sleep(500);
- checkInventory();
- setLoot();
- util.setRetaliate(true);
- util.clickTileXOffset = 0;
- util.clickTileYOffset = 0;
- timeran = new Timer(0);
- util.mouseSpeedSwitcherAntiban();
- BlackUniGUI settings = new BlackUniGUI();
- settings.setVisible(true);
- while (!StartScript)
- sleep(100, 200);
- settings.setVisible(false);
- log("Done setup report any bugs on thread");
- EatingThread et = new EatingThread();
- et.start();
- XPThread xp = new XPThread();
- xp.start();
- AntiBan.start();
- addScriptJob(MouseJob);
- if (train == "Defense") {
- startLvl = theTabs.Statistics.getStatBottom(Skill.DEFENSE);
- currentLvl = theTabs.Statistics.getStatBottom(Skill.DEFENSE);
- startxp = theTabs.Statistics.getStatExperience(Skill.DEFENSE);
- currxp = theTabs.Statistics.getStatExperience(Skill.DEFENSE);
- trainingdef = true;
- }
- if (train == "Attack") {
- startLvl = theTabs.Statistics.getStatBottom(Skill.ATTACK);
- currentLvl = theTabs.Statistics.getStatBottom(Skill.ATTACK);
- startxp = theTabs.Statistics.getStatExperience(Skill.ATTACK);
- currxp = theTabs.Statistics.getStatExperience(Skill.ATTACK);
- trainingatk = true;
- }
- if (train == "Strength") {
- startLvl = theTabs.Statistics.getStatBottom(Skill.STRENGTH);
- currentLvl = theTabs.Statistics.getStatBottom(Skill.STRENGTH);
- startxp = theTabs.Statistics.getStatExperience(Skill.STRENGTH);
- currxp = theTabs.Statistics.getStatExperience(Skill.STRENGTH);
- trainingstr = true;
- }
- if (train == "Range") {
- startLvl = theTabs.Statistics.getStatBottom(Skill.RANGED);
- currentLvl = theTabs.Statistics.getStatBottom(Skill.RANGED);
- startxp = theTabs.Statistics.getStatExperience(Skill.RANGED);
- currxp = theTabs.Statistics.getStatExperience(Skill.RANGED);
- trainingrng = true;
- }
- if (train == "Magic") {
- startLvl = theTabs.Statistics.getStatBottom(Skill.MAGIC);
- currentLvl = theTabs.Statistics.getStatBottom(Skill.MAGIC);
- startxp = theTabs.Statistics.getStatExperience(Skill.MAGIC);
- currxp = theTabs.Statistics.getStatExperience(Skill.MAGIC);
- trainingmag = true;
- }
- while (true) {
- checkState();
- }
- } catch (InterruptedException e) {
- log("Interrupted Exception while " + util.status + " "
- + e.getMessage());
- log("Results: Unicorns killed: " + kills);
- log("Results: loot collected: $" + loot);
- screenCaptureWithDebugInfo();
- throw e;
- }
- }
- private void checkState() throws InterruptedException,Exception {
- if (theTabs.Inventory.count("Unicorn horn") >= 15
- && theTabs.Inventory.count(food) > 7) {
- DepositBoxBank();
- }
- if (theTabs.Inventory.count(food) < 5) {
- WalkToBank();
- }
- if (util.isBankInterfaceUp()) {
- Bank();
- }
- if (!UnisLayer.isInZone(getLocation()) && theTabs.Inventory.count("Unicorn horn") < 1 && theTabs.Inventory.count(food) > 5) {
- WalkToUnis();
- }
- if (UnisLayer.isInZone(getLocation()) && theTabs.Inventory.count(food) > 5){
- KillUnis();
- }
- }
- public void setLoot() throws InterruptedException {
- lootTable.add(unihorns);
- if (trainingrng) {
- lootDistance = 6;
- LootItem rangedAmmo = ammoHash.get(rangedPickup);
- lootTable.add(rangedAmmo);
- }
- if (lootcharms) {
- lootDistance = 6;
- lootTable.add(charms);
- }
- }
- public void checkInventory() throws InterruptedException {
- util.setTab("Equipment");
- sleep(1000);
- String weaponName = theTabs.Equipment.getWeapon();
- String arrowsName = theTabs.Equipment.getArrows();
- if (weaponName != null && weaponName.contains("bow")
- || weaponName.equals("seercull")) {
- trainingrng = true;
- log("Using a ranged weapon " + weaponName);
- if (arrowsName != null) {
- rangedPickup = arrowsName;
- log("Arrows/Bolts will be picked up: " + rangedPickup);
- }
- } else if (weaponName != null && weaponName.contains("knife")
- || weaponName.contains("dart") || weaponName.contains("chompa")) {
- trainingthrownrng = true;
- log("Using thrown weapon " + weaponName);
- rangedPickup = weaponName;
- log("Thrown items will be picked up: " + rangedPickup);
- } else if (weaponName != null) {
- log("Using weapon " + weaponName);
- if (weaponName.equals("Dragon Longsword")) {
- specialAttackPerc = 25;
- }
- if (weaponName.equals("Dragon dagger ")) {
- specialAttackPerc = 25;
- }
- if (weaponName.equals("Dragon dagger (p)")) {
- specialAttackPerc = 25;
- }
- if (weaponName.equals("Dragon dagger (p+)")) {
- specialAttackPerc = 25;
- }
- if (weaponName.equals("Dragon dagger (p++)")) {
- specialAttackPerc = 25;
- }
- if (weaponName.equals("Granite maul")) {
- specialAttackPerc = 50;
- }
- if (weaponName.equals("Dragon scimitar")) {
- specialAttackPerc = 55;
- }
- }
- }
- private void Bank() throws InterruptedException, Exception {
- String weaponName = theTabs.Equipment.getWeapon();
- String arrowsName = theTabs.Equipment.getArrows();
- if (theTabs.Inventory.count(food) > 7) {
- KillUnis();
- }
- if (trainingrng) {
- arrowsleft = theTabs.Equipment.getArrowsStackSize();
- }
- if (trainingthrownrng) {
- thrownsleft = theTabs.Equipment.getWeaponStackSize();
- }
- util.setFastRun(false);
- theWorldMap.walkTo(BankZone.random());
- theBank.open();
- theBank.waitTillInterfaceIsUp();
- theBank.doDepositAll();
- sleep(random(300, 1000));
- if (trainingrng && arrowsleft < 300){
- theBank.doWithDrawX(arrowsName, 500-arrowsleft, false);
- }
- if (trainingrng && thrownsleft < 300){
- theBank.doWithDrawX(weaponName, 500-thrownsleft, false);
- }
- theBank.doWithDrawX(food, Amount, false);
- sleep(random(300, 1000));
- theBank.exit();
- timesbanked++;
- sleep(random(300, 1000));
- if (trainingrng){
- theTabs.Inventory.doAction(rangedPickup, "Wield", 1, false);
- }
- WalkToUnis();
- }
- private void WalkToUnis() throws InterruptedException, Exception {
- setRun();
- theWorldMap.walkTo(BeforeTunnel);
- sleep(random(300, 600));
- sleepTillStill();
- clickVolcano();
- sleep(random(300, 600));
- sleepTillStill();
- theWorldMap.walkTo(OnWayToUnis1.random());
- sleep(random(300, 600));
- sleepTillStill();
- setRun();
- theWorldMap.walkTo(OnWayToUnis2.random());
- sleep(random(300, 600));
- sleepTillStill();
- setRun();
- theWorldMap.walkTo(OnWayToUnis3.random());
- sleep(random(300, 600));
- sleepTillStill();
- setRun();
- theWorldMap.walkTo(Unis.random());
- sleep(random(300, 600));
- sleepTillStill();
- KillUnis();
- }
- private void sleepTillStill() throws InterruptedException {
- for (int i = 0; i < 250; i++) {
- if (isMoving() || getAnimation() != -1) {
- i = 0;
- }
- sleep(random(10, 20));
- }
- }
- public void clickVolcano() throws InterruptedException {
- int[] volcano = {28121};
- PhysicalObject po = getPOI(volcano);
- UberScriptUtils.clickWorldObject(this, po, null, null, EnumSet.of(
- UberClickOptions.WALK_GAME_ONLY,
- UberClickOptions.CLICK_USING_PRECISION,
- UberClickOptions.CLICK_USING_PREDICTIONS));
- }
- public PhysicalObject getPOI(int[] ids) {
- PhysicalObject tr = null;
- for (PhysicalObject po : getAllInteractivePhysicalObjects())
- for (int i : ids)
- if (po.getID() == i)
- if (tr == null
- || tr.getLocation().distanceTo(getLocation()) > po
- .getLocation().distanceTo(getLocation()))
- tr = po;
- return tr;
- }
- private void KillUnis() throws InterruptedException, Exception {
- while(isLoggedIn())
- {
- setRun();
- }
- NPC uni = util.getNPCByName("Black unicorn");
- if (uni == null) {
- log("waiting for respawn");
- }
- else if (util.doNPC(uni, "Attack"))
- ;
- {
- spec();
- if ((swing = util.waitForAnimation(1000)) != -1) {
- sleep(200, 300);
- }
- util.waitForKill(uni, -1);
- pickup();
- sleep(random(100, 200));
- util.sleepUntilNotMoving();
- kills++;
- unicornhorn++;
- }
- sleep(100);
- }
- public void pickup() throws Exception {
- if (getMyPlayer().inCombat()){
- return;
- }
- sleep(600, 800);
- boolean full = theTabs.Inventory.isFull();
- if (!full){
- util.collectLoot(lootTable, 15, false, false);
- util.sleepUntilNotMoving();}
- if (full && dumpfood) {
- if (!theTabs.Inventory.isSelected()) {
- theTabs.Inventory.setSelected();
- }
- theTabs.Inventory.doAction(food, "Drop", 1, true);
- }
- if (full && !dumpfood){
- return;
- }
- if (trainingrng) {
- if (!theTabs.Inventory.isSelected()) {
- theTabs.Inventory.setSelected();
- }
- theTabs.Inventory.doAction(rangedPickup, "Wield", 1, false);
- }
- }
- private void spec() throws InterruptedException, Exception {
- while (spec = true && theTabs.Attack.getSpecialPercent() >= specialAttackPerc) {
- if (!theTabs.Attack.isSelected()) {
- theTabs.Attack.setSelected();
- }
- theTabs.Attack.clickSpecialAttack();
- if (theTabs.Attack.getSpecialPercent() >= specialAttackPerc) {
- if (!theTabs.Attack.isSelected()) {
- theTabs.Attack.setSelected();
- }
- theTabs.Attack.clickSpecialAttack();
- }
- }
- }
- private void WalkToBank() throws InterruptedException, Exception {
- {
- util.setStatus("Going to the bank");
- if (util.isBankInterfaceUp()) {
- Bank();
- }
- if (theTabs.Inventory.count(food) > 5) {
- KillUnis();
- }
- if (BankZone.isInZone(getLocation())) {
- Bank();
- }
- setRun();
- theWorldMap.walkTo(OnWayToUnis3.random());
- sleep(random(300, 600));
- sleepTillStill();
- setRun();
- theWorldMap.walkTo(OnWayToUnis2.random());
- sleep(random(300, 600));
- sleepTillStill();
- setRun();
- theWorldMap.walkTo(OnWayToUnis1.random());
- sleep(random(300, 600));
- sleepTillStill();
- setRun();
- theWorldMap.walkTo(AfterTunnel);
- sleep(random(300, 600));
- sleepTillStill();
- setRun();
- clickVolcano();
- sleep(random(300, 600));
- sleepTillStill();
- Bank();
- }
- }
- private void DepositBoxBank() throws InterruptedException, Exception {
- theWorldMap.walkTo(DepositBox.random());
- util.sleepUntilNotMoving();
- theDepositBox.open();
- sleep(random(300, 600));
- theDepositBox.doDesposit("Unicorn horn", 28);
- sleep(random(300, 600));
- theDepositBox.exit();
- sleep(random(300, 600));
- timesbanked++;
- KillUnis();
- }
- class EatingThread extends Thread {
- public void run() {
- setName("Eating thread");
- setPriority(Thread.MAX_PRIORITY);
- while (getHandler().isScriptRunning()) {
- try {
- if (theMiniMapIndicators.getHealthPoints() < eatfoodat
- + (random(-2, 5))) {
- theTabs.Inventory.doAction(food, "Eat", 1, true);
- sleep(random(250, 850));
- }
- } catch (InterruptedException ie) {
- log("Error : " + ie);
- }
- }
- }
- }
- class XPThread extends Thread {
- public void run() {
- setName("Xp thread");
- setPriority(Thread.NORM_PRIORITY);
- while (getHandler().isScriptRunning()) {
- try {
- if (trainingrng) {
- currxp = theTabs.Statistics.getStatExperience(Skill.RANGED);
- currentLvl = theTabs.Statistics.getStatBottom(Skill.RANGED);
- }
- if (trainingatk) {
- currxp = theTabs.Statistics.getStatExperience(Skill.ATTACK);
- currentLvl = theTabs.Statistics.getStatBottom(Skill.ATTACK);
- }
- if (trainingmag) {
- currxp = theTabs.Statistics.getStatExperience(Skill.MAGIC);
- currentLvl = theTabs.Statistics.getStatBottom(Skill.MAGIC);
- }
- if (trainingstr) {
- currxp = theTabs.Statistics.getStatExperience(Skill.STRENGTH);
- currentLvl = theTabs.Statistics.getStatBottom(Skill.STRENGTH);
- }
- if (trainingdef) {
- currxp = theTabs.Statistics.getStatExperience(Skill.DEFENSE);
- currentLvl = theTabs.Statistics.getStatBottom(Skill.DEFENSE);
- }
- }catch (InterruptedException ie) {
- log("Error : " + ie);
- }
- }
- }
- }
- private void setRun() throws InterruptedException {
- Rectangle a = new Rectangle(713, 102, 44, 18);
- if (getSettingArray()[173] == 0) {
- if (theMiniMapIndicators.getEnergy() > (random(50, 75))) {
- Timer t = new Timer(7500);
- while (getAnimation() != -1 || theBank.isInterfaceIsUp()) {
- sleep(500);
- if (t.isUp());
- theBank.exit();
- }
- log("Turning run on!");
- mouseClickLeft(a);
- }
- }
- }
- Thread AntiBan = new Thread() {
- public void run() {
- log("AntiBan Started!");
- while (getHandler().isScriptRunning()) {
- try {
- switch (random(0, 200)) {
- case 12:
- mouseMove(Areas.GAME);
- break;
- case 25:
- theCamera.setYawRandom();
- break;
- case 29:
- theCamera.setYawRandom();
- break;
- case 36:
- mouseMove(Areas.ENTIRE);
- break;
- case 44:
- switch(random(0, 25))
- {
- case 2:
- new Rectangle(525,171,233, 30);
- break;
- case 5:
- mouseMove(Areas.GAME);
- break;
- case 8:
- mouseClickLeft(new Rectangle(526,469,234, 29));
- break;
- case 4:
- theCamera.setYawRandomNormal();
- break;
- case 9:
- break;
- case 15:
- mouseMove(Areas.ENTIRE);
- break;
- case 17:
- break;
- case 22:
- theCamera.setYawRandom();
- break;
- case 23:
- break;
- case 25:
- break;
- }
- break;
- case 58:
- theCamera.setYawRandomNormal();
- break;
- case 63:
- theCamera.setYawRandom();
- break;
- case 77:
- mouseMove(Areas.ENTIRE);
- break;
- case 91:
- theCamera.setYawRandom();
- break;
- case 114:
- mouseMove(Areas.ENTIRE);
- break;
- case 133:
- theCamera.setYawRandom();
- break;
- case 145:
- theCamera.setYawRandom();
- break;
- case 166:
- theCamera.setYawRandom();
- break;
- case 178:
- theCamera.setYawRandom();
- break;
- case 184:
- theCamera.setYawRandom();
- break;
- case 200:
- theCamera.setYawRandom();
- break;
- }
- sleep(1000, 6000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
- };
- private RepeatableScriptJob MouseJob = new RepeatableScriptJob(this) {
- @Override
- public long runL() throws InterruptedException {
- getColorBot().currentSpeed = new MouseSettings() {
- public double getSpeed(int arg0) {
- return RandomGenerator.randomNormalDouble(1.8, 2.6);
- }
- };
- return random(25000, 140000);
- }
- };
- public void paint(Graphics g) {
- loot = unicornhorn * 2328;
- long runTime = 0;
- runTime = System.currentTimeMillis() - scriptStartTIME;
- int moneyperhour = 0;
- int xpperhour = 0;
- if ((runTime / 1000) > 0) {
- xpperhour = (int) ((3600000.0 / (double) runTime) * ((currxp - startxp)));
- }
- if ((runTime / 1000) > 0) {
- moneyperhour = (int) ((3600000.0 / (double) runTime) * ((loot)));
- }
- g.setColor(new Color(255, 0, 51, 134));
- g.fillRoundRect(12, 15, 484, 148, 90, 90);
- g.setFont(new Font("Cambria", 0, 20));
- g.setColor(new Color(255, 255, 255));
- g.drawString("Unicorn Killer", 196, 39);
- g.setFont(new Font("Bodoni MT Condensed", 0, 20));
- g.setColor(new Color(255, 255, 255));
- g.drawString("Kills: " + kills, 48, 71);
- g.setFont(new Font("Bodoni MT Condensed", 0, 20));
- g.setColor(new Color(255, 255, 255));
- g.drawString("Looted Value: " + loot, 48, 93);
- g.setFont(new Font("Bodoni MT Condensed", 0, 20));
- g.setColor(new Color(255, 255, 255));
- g.drawString("Loot / H: " + moneyperhour, 48, 117);
- g.setFont(new Font("Bodoni MT Condensed", 0, 20));
- g.setColor(new Color(255, 255, 255));
- g.drawString("Time Running: " + timeran.toStringTimeElapsed(), 205, 70);
- g.setFont(new Font("Bodoni MT Condensed", 0, 20));
- g.setColor(new Color(255, 255, 255));
- g.drawString("Times Banked: " + timesbanked, 205, 95);
- g.setFont(new Font("Bodoni MT Condensed", 0, 20));
- g.setColor(new Color(255, 255, 255));
- g.drawString("Training: " + train, 205, 119);
- g.setFont(new Font("Bodoni MT Condensed", 0, 20));
- g.setColor(new Color(255, 255, 255));
- g.drawString("Levels Gained: " + lvlsgained, 367, 70);
- g.setFont(new Font("Bodoni MT Condensed", 0, 20));
- g.setColor(new Color(255, 255, 255));
- g.drawString("XP Gained: " + (currxp - startxp), 366, 95);
- g.setFont(new Font("Bodoni MT Condensed", 0, 20));
- g.setColor(new Color(255, 255, 255));
- g.drawString("XP / H: " + xpperhour, 366, 119);
- g.setFont(new Font("STXinwei", 0, 20));
- g.setColor(new Color(51, 51, 51));
- g.drawString("VERSION 1.0", 351, 158);
- }
- public class BlackUniGUI extends javax.swing.JFrame {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- public BlackUniGUI() {
- initComponents();
- }
- private void initComponents() {
- TrainComboBox = new javax.swing.JComboBox();
- jLabel2 = new javax.swing.JLabel();
- jLabel3 = new javax.swing.JLabel();
- FoodComboBox = new javax.swing.JComboBox();
- jButton1 = new javax.swing.JButton();
- jTextField1 = new javax.swing.JTextField();
- jLabel1 = new javax.swing.JLabel();
- jLabel4 = new javax.swing.JLabel();
- jLabel5 = new javax.swing.JLabel();
- jTextField2 = new javax.swing.JTextField();
- jLabel6 = new javax.swing.JLabel();
- jCheckBox1 = new javax.swing.JCheckBox();
- jCheckBox2 = new javax.swing.JCheckBox();
- setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
- TrainComboBox.setFont(new java.awt.Font("Times New Roman", 0, 14));
- TrainComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Range", "Attack", "Strength", "Defence", "Magic" }));
- jLabel2.setFont(new java.awt.Font("Times New Roman", 0, 18));
- jLabel2.setText("Train?");
- jLabel3.setFont(new java.awt.Font("Times New Roman", 0, 18));
- jLabel3.setText("Food?");
- FoodComboBox.setFont(new java.awt.Font("Times New Roman", 0, 14));
- FoodComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Shrimp", "Trout", "Salmon", "Tuna", "Lobster", "Swordfish", "Monkfish", "Shark", "Rocktail", " " }));
- jButton1.setFont(new java.awt.Font("Traditional Arabic", 0, 18));
- jButton1.setText("START!");
- jButton1.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- StartButtonActionPerformed(evt);
- }
- });
- jTextField1.setText("EXAMPLE: 20");
- jTextField1.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- AmountOfFoodActionPerformed(evt);
- }
- });
- jLabel1.setFont(new java.awt.Font("Candara", 0, 24));
- jLabel1.setText("Unicorn Killer");
- jLabel4.setFont(new java.awt.Font("Times New Roman", 0, 18));
- jLabel4.setText("Amount?");
- jLabel5.setFont(new java.awt.Font("Times New Roman", 0, 18));
- jLabel5.setText("Eat at?");
- jTextField2.setText("EXAMPLE: 20");
- jTextField2.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- EatAtActionPerformed(evt);
- }
- });
- jLabel6.setText("(1 - 99)");
- jCheckBox1.setText("Special Attack?");
- jCheckBox2.setText("Loot charms?");
- jCheckBox3.setText("Eat food for loot space?");
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
- getContentPane().setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addGap(21, 21, 21)
- .addComponent(jLabel2)
- .addGap(45, 45, 45)
- .addComponent(jLabel3)
- .addGap(43, 43, 43)
- .addComponent(jLabel4)
- .addGap(38, 38, 38)
- .addComponent(jLabel5)
- .addContainerGap(25, Short.MAX_VALUE))
- .addGroup(layout.createSequentialGroup()
- .addGap(121, 121, 121)
- .addComponent(jLabel1)
- .addContainerGap(122, Short.MAX_VALUE))
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addComponent(jCheckBox1)
- .addGap(18, 18, 18)
- .addComponent(jCheckBox2)
- .addGap(18, 18, 18)
- .addComponent(jCheckBox3))
- .addGroup(layout.createSequentialGroup()
- .addComponent(TrainComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(FoodComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
- .addContainerGap(313, Short.MAX_VALUE)
- .addComponent(jLabel6)
- .addGap(35, 35, 35))
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(11, 11, 11)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel2)
- .addComponent(jLabel3)
- .addComponent(jLabel4)
- .addComponent(jLabel5))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(TrainComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(FoodComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGap(1, 1, 1)
- .addComponent(jLabel6)
- .addGap(18, 18, 18)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jCheckBox1)
- .addComponent(jCheckBox2)
- .addComponent(jCheckBox3))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE)
- .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE))
- );
- pack();
- }
- private void StartButtonActionPerformed(ActionEvent evt) {
- if (TrainComboBox.getSelectedItem() == "Attack") {
- train = "Attack";
- log("Training Attack.");
- }
- if (TrainComboBox.getSelectedItem() == "Range") {
- train = "Range";
- log("Training Range.");
- }
- if (TrainComboBox.getSelectedItem() == "Defence") {
- train = "Defence";
- log("Training Defence.");
- }
- if (TrainComboBox.getSelectedItem() == "Strength") {
- train = "Strength";
- log("Training Strength.");
- }
- if (FoodComboBox.getSelectedItem() == "Shrimp") {
- food = "Shrimp";
- log("Eating Shrimp.");
- }
- if (FoodComboBox.getSelectedItem() == "Trout") {
- food = "Trout";
- }
- if (FoodComboBox.getSelectedItem() == "Salmon") {
- food = "Salmon";
- log("Eating Salmon.");
- }
- if (FoodComboBox.getSelectedItem() == "Tuna") {
- food = "Tuna";
- log("Eating Tuna.");
- }
- if (FoodComboBox.getSelectedItem() == "Lobster") {
- food = "Lobster";
- log("Eating Lobster.");
- }
- if (FoodComboBox.getSelectedItem() == "Swordfish") {
- food = "Swordfish";
- log("Eating Swordfish.");
- }
- if (FoodComboBox.getSelectedItem() == "Monkfish") {
- food = "Monkfish";
- log("Eating Monkfish.");
- }
- if (FoodComboBox.getSelectedItem() == "Shark") {
- food = "Shark";
- log("Eating Shark.");
- }
- if (FoodComboBox.getSelectedItem() == "Rocktail") {
- food = "Rocktail";
- log("Eating Rocktail.");
- }
- if (jCheckBox1.isSelected()) {
- spec = true;
- log ("We are using special attack... It will take: " + specialAttackPerc + " of the special bar each spec we do.");
- }
- if (jCheckBox2.isSelected()) {
- lootcharms = true;
- log ("We are looting all charms dropped");
- }
- if (jCheckBox3.isSelected()) {
- dumpfood = true;
- log ("We are eating food for unicorn horns");
- }
- Amount = Integer.parseInt(jTextField1.getText());
- eatfoodat = Integer.parseInt(jTextField2.getText());
- StartScript = true;
- }
- private void EatAtActionPerformed(java.awt.event.ActionEvent evt) {
- eatfoodat = Integer.parseInt(jTextField2.getText());
- log("We are eating: "+food);
- }
- private void AmountOfFoodActionPerformed(java.awt.event.ActionEvent evt) {
- Amount = Integer.parseInt(jTextField1.getText());
- log("We will be withdrawing "+Amount+" "+food+"s and eating at "+eatfoodat+" health.");
- }
- private javax.swing.JComboBox FoodComboBox;
- private javax.swing.JComboBox TrainComboBox;
- private javax.swing.JButton jButton1;
- private javax.swing.JCheckBox jCheckBox1;
- private javax.swing.JCheckBox jCheckBox2;
- private javax.swing.JCheckBox jCheckBox3;
- private javax.swing.JLabel jLabel1;
- private javax.swing.JLabel jLabel2;
- private javax.swing.JLabel jLabel3;
- private javax.swing.JLabel jLabel4;
- private javax.swing.JLabel jLabel5;
- private javax.swing.JLabel jLabel6;
- private javax.swing.JTextField jTextField1;
- private javax.swing.JTextField jTextField2;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement