Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 37.82 KB | None | 0 0
  1. import impsoft.bots.ColorBot;
  2. import impsoft.bots.reflection.GroundItem;
  3. import impsoft.bots.reflection.NPC;
  4. import impsoft.bots.reflection.PhysicalObject;
  5. import impsoft.scripting.ibot.builtin.itemrec.ItemSlot;
  6. import impsoft.scripting.ibot.enums.Skill;
  7. import impsoft.scripting.ibot.interfaces.AutoPaint;
  8. import impsoft.scripting.ibot.structs.AryanTile;
  9. import impsoft.scripting.ibot.structs.AryanTileZone;
  10. import impsoft.scripting.types.ColorScript;
  11. import impsoft.scripting.types.parallel.scriptjobs.RepeatableScriptJob;
  12. import impsoft.utils.general.Timer;
  13. import impsoft.utils.ibot.RandomGenerator;
  14. import impsoft.utils.uber.UberClickOptions;
  15. import impsoft.utils.uber.UberScriptUtils;
  16. import impsoft.values.constant.Areas;
  17. import impsoft.values.variable.MouseSettings;
  18.  
  19. import java.awt.Color;
  20. import java.awt.Font;
  21. import java.awt.Graphics;
  22. import java.awt.Rectangle;
  23. import java.awt.event.ActionEvent;
  24. import java.util.EnumSet;
  25. import java.util.HashMap;
  26.  
  27. import javax.swing.JCheckBox;
  28.  
  29. import bergCoder.BergUtils;
  30. import bergCoder.LootItem;
  31. import bergCoder.LootTable;
  32.  
  33. public class UniKilla extends ColorScript implements AutoPaint {
  34.     public UniKilla(ColorBot arg0) {
  35.         super(arg0);
  36.     }
  37.  
  38.     public static String author = "90dragon900";
  39.     public static String description = "Unicorn Moneymaking revolution";
  40.     public static double version = 1.0;
  41.  
  42.     private BergUtils util = new BergUtils(this);
  43.  
  44.     public Timer timeran = new Timer(0);
  45.  
  46.     // Booleans
  47.  
  48.     boolean StartScript = false;
  49.     boolean trainingatk = false;
  50.     boolean trainingdef = false;
  51.     boolean trainingstr = false;
  52.     boolean trainingrng = false;
  53.     boolean trainingmag = false;
  54.     boolean burybones = false;
  55.     boolean UseSpecial = false;
  56.     boolean killUnis = false;
  57.     boolean spec = false;
  58.     boolean trainingthrownrng = false;
  59.     boolean lootcharms = false;
  60.     boolean dumpfood = false;
  61.  
  62.     LootTable lootTable = new LootTable();
  63.     int lootDistance = 4;
  64.  
  65.     public HashMap<String, LootItem> ammoHash = new HashMap<String, LootItem>();
  66.     public LootItem[] ammo = { new LootItem("Bronze bolts", 877, 0),
  67.             new LootItem("Iron bolts", 9140, 0),
  68.             new LootItem("Steel bolts", 9141, 0),
  69.             new LootItem("Mithril bolts", 9142, 80),
  70.             new LootItem("Adamantite bolts", 9143, 0),
  71.             new LootItem("Runite bolts", 9144, 0),
  72.             new LootItem("Kebbit bolts", 10158, 0),
  73.             new LootItem("Long kebbit bolts", 10159, 0),
  74.             new LootItem("Bone bolts", 8882, 0),
  75.  
  76.             new LootItem("Bronze arrow", 882, 0),
  77.             new LootItem("Iron arrow", 884, 0),
  78.             new LootItem("Steel arrow", 886, 0),
  79.             new LootItem("Mithril arrow", 888, 0),
  80.             new LootItem("Adamantite arrow", 890, 0),
  81.             new LootItem("Runite arrow", 892, 0),
  82.  
  83.             new LootItem("Bronze dart", 806, 0),
  84.             new LootItem("Iron dart", 807, 0),
  85.             new LootItem("Steel dart", 808, 0),
  86.             new LootItem("Mithril dart", 809, 0),
  87.             new LootItem("Adamantite dart", 810, 0),
  88.             new LootItem("Runite dart", 811, 0),
  89.  
  90.             new LootItem("Bronze knife", 864, 0),
  91.             new LootItem("Iron knife", 863, 0),
  92.             new LootItem("Black knife", 869, 0),
  93.             new LootItem("Steel knife", 865, 0),
  94.             new LootItem("Mithril knife", 866, 0),
  95.             new LootItem("Adamantite knife", 867, 0),
  96.             new LootItem("Runite knife", 868, 0),
  97.  
  98.             new LootItem("Broad-tipped bolt", 13281, 0),
  99.             new LootItem("Broad arrow", 4150, 0) };
  100.  
  101.  
  102.     public LootItem[] unihorns = { new LootItem("Unicorn horn", 297, 2328) };
  103.    
  104.     public LootItem[] charms =
  105.    
  106.             {
  107.    
  108.                             new LootItem("Gold charm", 563, 309), new LootItem("Green charm", 561, 232),
  109.    
  110.                             new LootItem("Crimson charm", 556, 13), new LootItem("Blue charm", 557, 11)
  111.             };
  112.    
  113.     // Strings
  114.  
  115.     String food = null;
  116.     String train = null;
  117.     String rangedPickup = null;
  118.  
  119.     // Ints
  120.  
  121.     public int xpgained = 0;
  122.     public int startxp = 0;
  123.     public int lvlsgained = 0;
  124.     public int currxp = 0;
  125.     public int startLvl = 0;
  126.     public int currentLvl = 0;
  127.     public int timesbanked = 0;
  128.     public int kills = 0;
  129.     public int loot = 0;
  130.     public int Amount = 10;
  131.     public int specialAttackPerc = 25;
  132.     public int eatfoodat = 50;
  133.     public int unicornhorn = 0;
  134.     public int swing = -1;
  135.     public int arrowsleft = 0;
  136.     public int arrowstowithdraw = 0;
  137.     public int thrownsleft = 0;
  138.     int[] id = {28121};
  139.    
  140.     String[] uni = { "Black unicorn" };
  141.  
  142.     // Tiles and Zones
  143.    
  144.     AryanTileZone BankZone = new AryanTileZone(new AryanTile(3182, 3696),
  145.             (new AryanTile(3190, 3689)));
  146.     AryanTileZone Unis = new AryanTileZone(new AryanTile(3071, 3642),
  147.             (new AryanTile(3105, 3618)));
  148.     AryanTileZone DepositBox = new AryanTileZone(new AryanTile(3133, 3628),
  149.             (new AryanTile(3137, 3624)));
  150.     AryanTile AfterTunnel = new AryanTile(3165, 3696);
  151.     AryanTile BeforeTunnel = new AryanTile(3164, 3685);
  152.     AryanTile UniBridge = new AryanTile(3164, 3685);
  153.     AryanTileZone OnWayToUnis1 = new AryanTileZone(new AryanTile(3137, 3688),
  154.             (new AryanTile(3146, 3682)));
  155.     AryanTileZone OnWayToUnis2 = new AryanTileZone(new AryanTile(3117, 3672),
  156.             (new AryanTile(3127, 3666)));
  157.     AryanTileZone OnWayToUnis3 = new AryanTileZone(new AryanTile(3102, 3684),
  158.             (new AryanTile(3106, 3678)));
  159.     AryanTileZone UnisLayer = new AryanTileZone(new AryanTile(3053, 3659),
  160.             (new AryanTile(3116, 3604)));
  161.     // Timer
  162.  
  163.     Timer Time = new Timer(0);
  164.     Timer f = new Timer((random(15, 54)) * (1000 * 60));
  165.     long scriptStartTIME = System.currentTimeMillis();
  166.  
  167.     String[] drop = { "Fire battlestaff", "Super attack (1)",
  168.             "Super strength (1)", "Vial", food, "Uncut emerald", "Uncut ruby",
  169.             "Obsidian charm" };
  170.  
  171.     public void script() throws InterruptedException, Exception {
  172.         try {
  173.             stopRandom("PublicChatOff");
  174.  
  175.             while (!isLoggedIn())
  176.                 sleep(500);
  177.  
  178.             checkInventory();
  179.             setLoot();
  180.             util.setRetaliate(true);
  181.  
  182.             util.clickTileXOffset = 0;
  183.             util.clickTileYOffset = 0;
  184.  
  185.             timeran = new Timer(0);
  186.  
  187.             util.mouseSpeedSwitcherAntiban();
  188.  
  189.             BlackUniGUI settings = new BlackUniGUI();
  190.             settings.setVisible(true);
  191.             while (!StartScript)
  192.                 sleep(100, 200);
  193.             settings.setVisible(false);
  194.             log("Done setup report any bugs on thread");
  195.            
  196.             EatingThread et = new EatingThread();
  197.             et.start();
  198.             XPThread xp = new XPThread();
  199.             xp.start();
  200.             AntiBan.start();
  201.             addScriptJob(MouseJob);
  202.            
  203.            
  204.             if (train == "Defense") {
  205.                 startLvl = theTabs.Statistics.getStatBottom(Skill.DEFENSE);
  206.                 currentLvl = theTabs.Statistics.getStatBottom(Skill.DEFENSE);
  207.                 startxp = theTabs.Statistics.getStatExperience(Skill.DEFENSE);
  208.                 currxp = theTabs.Statistics.getStatExperience(Skill.DEFENSE);
  209.                 trainingdef = true;
  210.             }
  211.             if (train == "Attack") {
  212.                 startLvl = theTabs.Statistics.getStatBottom(Skill.ATTACK);
  213.                 currentLvl = theTabs.Statistics.getStatBottom(Skill.ATTACK);
  214.                 startxp = theTabs.Statistics.getStatExperience(Skill.ATTACK);
  215.                 currxp = theTabs.Statistics.getStatExperience(Skill.ATTACK);
  216.                 trainingatk = true;
  217.             }
  218.             if (train == "Strength") {
  219.                 startLvl = theTabs.Statistics.getStatBottom(Skill.STRENGTH);
  220.                 currentLvl = theTabs.Statistics.getStatBottom(Skill.STRENGTH);
  221.                 startxp = theTabs.Statistics.getStatExperience(Skill.STRENGTH);
  222.                 currxp = theTabs.Statistics.getStatExperience(Skill.STRENGTH);
  223.                 trainingstr = true;
  224.             }
  225.             if (train == "Range") {
  226.                 startLvl = theTabs.Statistics.getStatBottom(Skill.RANGED);
  227.                 currentLvl = theTabs.Statistics.getStatBottom(Skill.RANGED);
  228.                 startxp = theTabs.Statistics.getStatExperience(Skill.RANGED);
  229.                 currxp = theTabs.Statistics.getStatExperience(Skill.RANGED);
  230.                 trainingrng = true;
  231.             }
  232.             if (train == "Magic") {
  233.                 startLvl = theTabs.Statistics.getStatBottom(Skill.MAGIC);
  234.                 currentLvl = theTabs.Statistics.getStatBottom(Skill.MAGIC);
  235.                 startxp = theTabs.Statistics.getStatExperience(Skill.MAGIC);
  236.                 currxp = theTabs.Statistics.getStatExperience(Skill.MAGIC);
  237.                 trainingmag = true;
  238.             }
  239.             while (true) {
  240.                 checkState();
  241.             }
  242.         } catch (InterruptedException e) {
  243.             log("Interrupted Exception while " + util.status + " "
  244.                     + e.getMessage());
  245.             log("Results:  Unicorns killed: " + kills);
  246.             log("Results:  loot collected: $" + loot);
  247.             screenCaptureWithDebugInfo();
  248.  
  249.             throw e;
  250.         }
  251.     }
  252.  
  253.     private void checkState() throws InterruptedException,Exception {
  254.         if (theTabs.Inventory.count("Unicorn horn") >= 15
  255.                 && theTabs.Inventory.count(food) > 7) {
  256.             DepositBoxBank();
  257.         }
  258.         if (theTabs.Inventory.count(food) < 5) {
  259.             WalkToBank();
  260.         }
  261.         if (util.isBankInterfaceUp()) {
  262.             Bank();
  263.         }
  264.         if (!UnisLayer.isInZone(getLocation()) && theTabs.Inventory.count("Unicorn horn") < 1 && theTabs.Inventory.count(food) > 5) {
  265.             WalkToUnis();
  266.         }
  267.         if (UnisLayer.isInZone(getLocation()) && theTabs.Inventory.count(food) > 5){
  268.             KillUnis();
  269.         }
  270.     }
  271.  
  272.     public void setLoot() throws InterruptedException {
  273.         lootTable.add(unihorns);
  274.         if (trainingrng) {
  275.             lootDistance = 6;
  276.             LootItem rangedAmmo = ammoHash.get(rangedPickup);
  277.             lootTable.add(rangedAmmo);
  278.         }
  279.         if (lootcharms) {
  280.             lootDistance = 6;
  281.             lootTable.add(charms);
  282.         }
  283.  
  284.     }
  285.  
  286.     public void checkInventory() throws InterruptedException {
  287.         util.setTab("Equipment");
  288.         sleep(1000);
  289.         String weaponName = theTabs.Equipment.getWeapon();
  290.         String arrowsName = theTabs.Equipment.getArrows();
  291.  
  292.         if (weaponName != null && weaponName.contains("bow")
  293.                 || weaponName.equals("seercull")) {
  294.             trainingrng = true;
  295.             log("Using a ranged weapon " + weaponName);
  296.             if (arrowsName != null) {
  297.                 rangedPickup = arrowsName;
  298.                 log("Arrows/Bolts will be picked up: " + rangedPickup);
  299.             }
  300.         } else if (weaponName != null && weaponName.contains("knife")
  301.                 || weaponName.contains("dart") || weaponName.contains("chompa")) {
  302.             trainingthrownrng = true;
  303.             log("Using thrown weapon " + weaponName);
  304.             rangedPickup = weaponName;
  305.             log("Thrown items will be picked up: " + rangedPickup);
  306.         } else if (weaponName != null) {
  307.             log("Using weapon " + weaponName);
  308.             if (weaponName.equals("Dragon Longsword")) {
  309.                 specialAttackPerc = 25;
  310.             }
  311.             if (weaponName.equals("Dragon dagger ")) {
  312.                 specialAttackPerc = 25;
  313.             }
  314.             if (weaponName.equals("Dragon dagger (p)")) {
  315.                 specialAttackPerc = 25;
  316.             }
  317.             if (weaponName.equals("Dragon dagger (p+)")) {
  318.                 specialAttackPerc = 25;
  319.             }
  320.             if (weaponName.equals("Dragon dagger (p++)")) {
  321.                 specialAttackPerc = 25;
  322.             }
  323.             if (weaponName.equals("Granite maul")) {
  324.                 specialAttackPerc = 50;
  325.             }
  326.             if (weaponName.equals("Dragon scimitar")) {
  327.                 specialAttackPerc = 55;
  328.             }
  329.            
  330.         }
  331.  
  332.     }
  333.  
  334.  
  335.  
  336.     private void Bank() throws InterruptedException, Exception {
  337.         String weaponName = theTabs.Equipment.getWeapon();
  338.         String arrowsName = theTabs.Equipment.getArrows();
  339.             if (theTabs.Inventory.count(food) > 7) {
  340.                 KillUnis();
  341.             }
  342.             if (trainingrng) {
  343.                 arrowsleft = theTabs.Equipment.getArrowsStackSize();
  344.             }
  345.             if (trainingthrownrng) {
  346.                 thrownsleft = theTabs.Equipment.getWeaponStackSize();
  347.             }
  348.            
  349.            
  350.            
  351.  
  352.             util.setFastRun(false);
  353.             theWorldMap.walkTo(BankZone.random());
  354.             theBank.open();
  355.             theBank.waitTillInterfaceIsUp();
  356.             theBank.doDepositAll();
  357.             sleep(random(300, 1000));
  358.             if (trainingrng && arrowsleft < 300){
  359.                 theBank.doWithDrawX(arrowsName, 500-arrowsleft, false);
  360.             }
  361.             if (trainingrng && thrownsleft < 300){
  362.                 theBank.doWithDrawX(weaponName, 500-thrownsleft, false);   
  363.             }
  364.             theBank.doWithDrawX(food, Amount, false);
  365.             sleep(random(300, 1000));
  366.             theBank.exit();
  367.             timesbanked++;
  368.             sleep(random(300, 1000));
  369.             if (trainingrng){
  370.             theTabs.Inventory.doAction(rangedPickup, "Wield", 1, false);
  371.             }
  372.             WalkToUnis();
  373.        
  374.     }
  375.  
  376.      private void WalkToUnis() throws InterruptedException, Exception {
  377.           setRun();
  378.           theWorldMap.walkTo(BeforeTunnel);
  379.           sleep(random(300, 600));
  380.           sleepTillStill();
  381.           clickVolcano();
  382.           sleep(random(300, 600));
  383.           sleepTillStill();
  384.            theWorldMap.walkTo(OnWayToUnis1.random());
  385.            sleep(random(300, 600));
  386.            sleepTillStill();
  387.            setRun();
  388.            theWorldMap.walkTo(OnWayToUnis2.random());
  389.            sleep(random(300, 600));
  390.            sleepTillStill();
  391.            setRun();
  392.            theWorldMap.walkTo(OnWayToUnis3.random());
  393.            sleep(random(300, 600));
  394.            sleepTillStill();
  395.            setRun();
  396.            theWorldMap.walkTo(Unis.random());
  397.           sleep(random(300, 600));
  398.           sleepTillStill();
  399.           KillUnis();
  400.           }
  401.      private void sleepTillStill() throws InterruptedException {
  402.           for (int i = 0; i < 250; i++) {
  403.            if (isMoving() || getAnimation() != -1) {
  404.             i = 0;
  405.            }
  406.            sleep(random(10, 20));
  407.           }
  408.          }
  409.      public void clickVolcano() throws InterruptedException {
  410.           int[] volcano = {28121};
  411.           PhysicalObject po = getPOI(volcano);
  412.           UberScriptUtils.clickWorldObject(this, po, null, null, EnumSet.of(
  413.             UberClickOptions.WALK_GAME_ONLY,
  414.             UberClickOptions.CLICK_USING_PRECISION,
  415.             UberClickOptions.CLICK_USING_PREDICTIONS));
  416.  
  417.          }
  418.  
  419.  
  420.      
  421.          
  422.          public PhysicalObject getPOI(int[] ids) {
  423.               PhysicalObject tr = null;
  424.               for (PhysicalObject po : getAllInteractivePhysicalObjects())
  425.                for (int i : ids)
  426.                 if (po.getID() == i)
  427.                  if (tr == null
  428.                    || tr.getLocation().distanceTo(getLocation()) > po
  429.                      .getLocation().distanceTo(getLocation()))
  430.                   tr = po;
  431.               return tr;
  432.  
  433.              }
  434.  
  435.  
  436.     private void KillUnis() throws InterruptedException, Exception {
  437.        
  438.         while(isLoggedIn())
  439.         {
  440.         setRun();
  441.         }
  442.                        
  443.                 NPC uni = util.getNPCByName("Black unicorn");
  444.                
  445.                 if (uni == null) {
  446.  
  447.                    
  448.                     log("waiting for respawn");
  449.                 }
  450.  
  451.                 else if (util.doNPC(uni, "Attack"))
  452.                     ;
  453.                 {
  454.                    
  455.                     spec();
  456.                
  457.                     if ((swing = util.waitForAnimation(1000)) != -1) {
  458.                         sleep(200, 300);
  459.                     }
  460.                    
  461.                     util.waitForKill(uni, -1);
  462.                     pickup();
  463.                     sleep(random(100, 200));
  464.                     util.sleepUntilNotMoving();
  465.                     kills++;
  466.                     unicornhorn++;
  467.                    
  468.                    
  469.                 }
  470.                 sleep(100);
  471.             }
  472.    
  473.  
  474.     public void pickup() throws Exception {
  475.         if (getMyPlayer().inCombat()){
  476.             return;
  477.         }
  478.         sleep(600, 800);
  479.         boolean full = theTabs.Inventory.isFull();
  480.         if (!full){
  481.         util.collectLoot(lootTable, 15, false, false);
  482.                         util.sleepUntilNotMoving();}
  483.         if (full && dumpfood) {
  484.             if (!theTabs.Inventory.isSelected()) {
  485.                 theTabs.Inventory.setSelected();
  486.             }
  487.             theTabs.Inventory.doAction(food, "Drop", 1, true);
  488.         }
  489.         if (full && !dumpfood){
  490.             return;
  491.         }
  492.         if (trainingrng) {
  493.             if (!theTabs.Inventory.isSelected()) {
  494.                 theTabs.Inventory.setSelected();
  495.             }
  496.             theTabs.Inventory.doAction(rangedPickup, "Wield", 1, false);
  497.         }
  498.     }
  499.     private void spec() throws InterruptedException, Exception {
  500.         while (spec = true && theTabs.Attack.getSpecialPercent() >= specialAttackPerc) {
  501.             if (!theTabs.Attack.isSelected()) {
  502.                 theTabs.Attack.setSelected();
  503.             }
  504.             theTabs.Attack.clickSpecialAttack();
  505.        
  506.         if (theTabs.Attack.getSpecialPercent() >= specialAttackPerc) {
  507.             if (!theTabs.Attack.isSelected()) {
  508.                 theTabs.Attack.setSelected();
  509.             }
  510.             theTabs.Attack.clickSpecialAttack();
  511.         }
  512.        
  513.     }
  514.         }
  515.  
  516.     private void WalkToBank() throws InterruptedException, Exception {
  517.         {
  518.             util.setStatus("Going to the bank");
  519.  
  520.             if (util.isBankInterfaceUp()) {
  521.                 Bank();
  522.             }
  523.             if (theTabs.Inventory.count(food) > 5)  {
  524.                 KillUnis();
  525.             }
  526.             if (BankZone.isInZone(getLocation())) {
  527.                 Bank();
  528.             }
  529.            
  530.                  
  531.                   setRun();
  532.                   theWorldMap.walkTo(OnWayToUnis3.random());
  533.                    sleep(random(300, 600));
  534.                    sleepTillStill();
  535.                    setRun();
  536.                    theWorldMap.walkTo(OnWayToUnis2.random());
  537.                    sleep(random(300, 600));
  538.                    sleepTillStill();
  539.                    setRun();
  540.                    theWorldMap.walkTo(OnWayToUnis1.random());
  541.                    sleep(random(300, 600));
  542.                    sleepTillStill();
  543.                    setRun();
  544.                   theWorldMap.walkTo(AfterTunnel);
  545.                   sleep(random(300, 600));
  546.                   sleepTillStill();
  547.                   setRun();
  548.                   clickVolcano();
  549.                   sleep(random(300, 600));
  550.                   sleepTillStill();
  551.                   Bank();
  552.  
  553.                  
  554.         }
  555.     }
  556.  
  557.     private void DepositBoxBank() throws InterruptedException, Exception {
  558.        
  559.         theWorldMap.walkTo(DepositBox.random());
  560.         util.sleepUntilNotMoving();
  561.    
  562.         theDepositBox.open();
  563.         sleep(random(300, 600));
  564.         theDepositBox.doDesposit("Unicorn horn", 28);
  565.         sleep(random(300, 600));
  566.         theDepositBox.exit();
  567.         sleep(random(300, 600));
  568.         timesbanked++;
  569.         KillUnis();
  570.     }
  571.      class EatingThread extends Thread {
  572.           public void run() {
  573.            setName("Eating thread");
  574.            setPriority(Thread.MAX_PRIORITY);
  575.            while (getHandler().isScriptRunning()) {
  576.             try {
  577.              if (theMiniMapIndicators.getHealthPoints() < eatfoodat
  578.                + (random(-2, 5))) {
  579.               theTabs.Inventory.doAction(food, "Eat", 1, true);
  580.               sleep(random(250, 850));
  581.              }
  582.             } catch (InterruptedException ie) {
  583.              log("Error : " + ie);
  584.             }
  585.            }
  586.  
  587.           }
  588.          }
  589.      class XPThread extends Thread {
  590.          public void run() {
  591.              setName("Xp thread");
  592.              setPriority(Thread.NORM_PRIORITY);
  593.              while (getHandler().isScriptRunning()) {
  594.                  try {
  595.              
  596.          if (trainingrng) {
  597.                 currxp = theTabs.Statistics.getStatExperience(Skill.RANGED);
  598.                 currentLvl = theTabs.Statistics.getStatBottom(Skill.RANGED);
  599.             }
  600.             if (trainingatk) {
  601.                 currxp = theTabs.Statistics.getStatExperience(Skill.ATTACK);
  602.                 currentLvl = theTabs.Statistics.getStatBottom(Skill.ATTACK);
  603.             }
  604.             if (trainingmag) {
  605.                 currxp = theTabs.Statistics.getStatExperience(Skill.MAGIC);
  606.                 currentLvl = theTabs.Statistics.getStatBottom(Skill.MAGIC);
  607.             }
  608.             if (trainingstr) {
  609.                 currxp = theTabs.Statistics.getStatExperience(Skill.STRENGTH);
  610.                 currentLvl = theTabs.Statistics.getStatBottom(Skill.STRENGTH);
  611.             }
  612.             if (trainingdef) {
  613.                 currxp = theTabs.Statistics.getStatExperience(Skill.DEFENSE);
  614.                 currentLvl = theTabs.Statistics.getStatBottom(Skill.DEFENSE);
  615.             }
  616.                  
  617.                  }catch (InterruptedException ie) {
  618.                  log("Error : " + ie);
  619.              }
  620.              }
  621.          }
  622.      }
  623.      
  624.      private void setRun() throws InterruptedException {
  625.             Rectangle a = new Rectangle(713, 102, 44, 18);
  626.             if (getSettingArray()[173] == 0) {
  627.                 if (theMiniMapIndicators.getEnergy() > (random(50, 75))) {
  628.                     Timer t = new Timer(7500);
  629.                     while (getAnimation() != -1 || theBank.isInterfaceIsUp()) {
  630.                         sleep(500);
  631.                         if (t.isUp());
  632.                         theBank.exit();
  633.                     }
  634.  
  635.                     log("Turning run on!");
  636.                     mouseClickLeft(a);
  637.                 }
  638.  
  639.             }
  640.         }
  641.      
  642.      Thread AntiBan = new Thread() {
  643.      
  644.                      public void run() {
  645.      
  646.                              log("AntiBan Started!");
  647.      
  648.                              while (getHandler().isScriptRunning()) {
  649.      
  650.      
  651.      
  652.                                      try {
  653.      
  654.                                              switch (random(0, 200)) {
  655.      
  656.                                              case 12:
  657.      
  658.                                                      mouseMove(Areas.GAME);
  659.      
  660.                                                      break;
  661.      
  662.                                              case 25:
  663.      
  664.                                                      theCamera.setYawRandom();
  665.      
  666.                                                      break;
  667.      
  668.                                              case 29:
  669.      
  670.                                                      theCamera.setYawRandom();
  671.      
  672.                                                      break;
  673.      
  674.                                              case 36:
  675.      
  676.                                                      mouseMove(Areas.ENTIRE);
  677.      
  678.                                                      break;
  679.      
  680.                                              case 44:
  681.      
  682.                                                      switch(random(0, 25))
  683.      
  684.                                                      {
  685.      
  686.                                                      case 2:
  687.      
  688.                                                      new Rectangle(525,171,233, 30);
  689.      
  690.                                                      break;
  691.      
  692.                                                      case 5:
  693.      
  694.                                                              mouseMove(Areas.GAME);
  695.      
  696.                                                              break;
  697.      
  698.                                                      case 8:
  699.      
  700.                                                              mouseClickLeft(new Rectangle(526,469,234, 29));
  701.      
  702.                                                              break;
  703.      
  704.                                                      case 4:
  705.      
  706.                                                              theCamera.setYawRandomNormal();
  707.      
  708.                                                              break;
  709.      
  710.                                                      case 9:
  711.      
  712.                                                              break;
  713.      
  714.                                                      case 15:
  715.      
  716.                                                      mouseMove(Areas.ENTIRE);
  717.      
  718.                                                      break;
  719.      
  720.                                                      case 17:
  721.      
  722.                                                              break;
  723.      
  724.                                                      case 22:
  725.      
  726.                                                              theCamera.setYawRandom();
  727.      
  728.                                                              break;
  729.      
  730.                                                      case 23:
  731.      
  732.                                                              break;
  733.      
  734.                                                      case 25:
  735.      
  736.                                                              break;
  737.      
  738.      
  739.      
  740.                                                      }
  741.      
  742.                                                      break;
  743.      
  744.                                              case 58:
  745.      
  746.                                                      theCamera.setYawRandomNormal();
  747.      
  748.                                                      break;
  749.      
  750.                                              case 63:
  751.      
  752.                                                      theCamera.setYawRandom();
  753.      
  754.                                                      break;
  755.      
  756.                                              case 77:
  757.      
  758.                                                      mouseMove(Areas.ENTIRE);
  759.      
  760.                                                      break;
  761.      
  762.                                              case 91:
  763.      
  764.                                                      theCamera.setYawRandom();
  765.      
  766.                                                      break;
  767.      
  768.                                              case 114:
  769.      
  770.                                                      mouseMove(Areas.ENTIRE);
  771.      
  772.                                                      break;
  773.      
  774.                                              case 133:
  775.      
  776.                                                      theCamera.setYawRandom();
  777.      
  778.                                                      break;
  779.      
  780.                                              case 145:
  781.      
  782.                                                      theCamera.setYawRandom();
  783.      
  784.                                                      break;
  785.      
  786.                                              case 166:
  787.      
  788.                                                      theCamera.setYawRandom();
  789.      
  790.                                                      break;
  791.      
  792.                                              case 178:
  793.      
  794.                                                      theCamera.setYawRandom();
  795.      
  796.                                                      break;
  797.      
  798.                                              case 184:
  799.      
  800.                                                      theCamera.setYawRandom();
  801.      
  802.                                                      break;
  803.      
  804.                                              case 200:
  805.      
  806.                                                      theCamera.setYawRandom();
  807.      
  808.                                                      break;
  809.      
  810.      
  811.      
  812.                                              }
  813.      
  814.                                              sleep(1000, 6000);
  815.      
  816.      
  817.      
  818.                                      } catch (InterruptedException e) {
  819.                                              e.printStackTrace();
  820.      
  821.                                      }
  822.      
  823.                              }
  824.      
  825.                      }
  826.      
  827.              };
  828.      private RepeatableScriptJob MouseJob = new RepeatableScriptJob(this) {
  829.  
  830.             @Override
  831.             public long runL() throws InterruptedException {
  832.  
  833.                 getColorBot().currentSpeed = new MouseSettings() {
  834.  
  835.                     public double getSpeed(int arg0) {
  836.                         return RandomGenerator.randomNormalDouble(1.8, 2.6);
  837.                     }
  838.                 };
  839.                 return random(25000, 140000);
  840.             }
  841.         };
  842.     public void paint(Graphics g) {
  843.         loot = unicornhorn * 2328;
  844.  
  845.         long runTime = 0;
  846.         runTime = System.currentTimeMillis() - scriptStartTIME;
  847.         int moneyperhour = 0;
  848.         int xpperhour = 0;
  849.         if ((runTime / 1000) > 0) {
  850.             xpperhour = (int) ((3600000.0 / (double) runTime) * ((currxp - startxp)));
  851.         }
  852.         if ((runTime / 1000) > 0) {
  853.             moneyperhour = (int) ((3600000.0 / (double) runTime) * ((loot)));
  854.         }
  855.  
  856.         g.setColor(new Color(255, 0, 51, 134));
  857.         g.fillRoundRect(12, 15, 484, 148, 90, 90);
  858.         g.setFont(new Font("Cambria", 0, 20));
  859.         g.setColor(new Color(255, 255, 255));
  860.         g.drawString("Unicorn Killer", 196, 39);
  861.         g.setFont(new Font("Bodoni MT Condensed", 0, 20));
  862.         g.setColor(new Color(255, 255, 255));
  863.         g.drawString("Kills: " + kills, 48, 71);
  864.         g.setFont(new Font("Bodoni MT Condensed", 0, 20));
  865.         g.setColor(new Color(255, 255, 255));
  866.         g.drawString("Looted Value: " + loot, 48, 93);
  867.         g.setFont(new Font("Bodoni MT Condensed", 0, 20));
  868.         g.setColor(new Color(255, 255, 255));
  869.         g.drawString("Loot / H: " + moneyperhour, 48, 117);
  870.         g.setFont(new Font("Bodoni MT Condensed", 0, 20));
  871.         g.setColor(new Color(255, 255, 255));
  872.         g.drawString("Time Running: " + timeran.toStringTimeElapsed(), 205, 70);
  873.         g.setFont(new Font("Bodoni MT Condensed", 0, 20));
  874.         g.setColor(new Color(255, 255, 255));
  875.         g.drawString("Times Banked: " + timesbanked, 205, 95);
  876.         g.setFont(new Font("Bodoni MT Condensed", 0, 20));
  877.         g.setColor(new Color(255, 255, 255));
  878.         g.drawString("Training: " + train, 205, 119);
  879.         g.setFont(new Font("Bodoni MT Condensed", 0, 20));
  880.         g.setColor(new Color(255, 255, 255));
  881.         g.drawString("Levels Gained: " + lvlsgained, 367, 70);
  882.         g.setFont(new Font("Bodoni MT Condensed", 0, 20));
  883.         g.setColor(new Color(255, 255, 255));
  884.         g.drawString("XP Gained: " + (currxp - startxp), 366, 95);
  885.         g.setFont(new Font("Bodoni MT Condensed", 0, 20));
  886.         g.setColor(new Color(255, 255, 255));
  887.         g.drawString("XP / H: " + xpperhour, 366, 119);
  888.         g.setFont(new Font("STXinwei", 0, 20));
  889.         g.setColor(new Color(51, 51, 51));
  890.         g.drawString("VERSION 1.0", 351, 158);
  891.     }
  892.     public class BlackUniGUI extends javax.swing.JFrame {
  893.  
  894.  
  895.         /**
  896.          *
  897.          */
  898.         private static final long serialVersionUID = 1L;
  899.         public BlackUniGUI() {
  900.             initComponents();
  901.         }
  902.  
  903.         private void initComponents() {
  904.  
  905.             TrainComboBox = new javax.swing.JComboBox();
  906.             jLabel2 = new javax.swing.JLabel();
  907.             jLabel3 = new javax.swing.JLabel();
  908.             FoodComboBox = new javax.swing.JComboBox();
  909.             jButton1 = new javax.swing.JButton();
  910.             jTextField1 = new javax.swing.JTextField();
  911.             jLabel1 = new javax.swing.JLabel();
  912.             jLabel4 = new javax.swing.JLabel();
  913.             jLabel5 = new javax.swing.JLabel();
  914.             jTextField2 = new javax.swing.JTextField();
  915.             jLabel6 = new javax.swing.JLabel();
  916.             jCheckBox1 = new javax.swing.JCheckBox();
  917.             jCheckBox2 = new javax.swing.JCheckBox();
  918.  
  919.             setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  920.  
  921.             TrainComboBox.setFont(new java.awt.Font("Times New Roman", 0, 14));
  922.             TrainComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Range", "Attack", "Strength", "Defence", "Magic" }));
  923.  
  924.             jLabel2.setFont(new java.awt.Font("Times New Roman", 0, 18));
  925.             jLabel2.setText("Train?");
  926.  
  927.             jLabel3.setFont(new java.awt.Font("Times New Roman", 0, 18));
  928.             jLabel3.setText("Food?");
  929.  
  930.             FoodComboBox.setFont(new java.awt.Font("Times New Roman", 0, 14));
  931.             FoodComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Shrimp", "Trout", "Salmon", "Tuna", "Lobster", "Swordfish", "Monkfish", "Shark", "Rocktail", " " }));
  932.  
  933.             jButton1.setFont(new java.awt.Font("Traditional Arabic", 0, 18));
  934.             jButton1.setText("START!");
  935.             jButton1.addActionListener(new java.awt.event.ActionListener() {
  936.                         public void actionPerformed(java.awt.event.ActionEvent evt) {
  937.                             StartButtonActionPerformed(evt);
  938.                         }
  939.                         });
  940.  
  941.             jTextField1.setText("EXAMPLE: 20");
  942.             jTextField1.addActionListener(new java.awt.event.ActionListener() {
  943.                                 public void actionPerformed(java.awt.event.ActionEvent evt) {
  944.                                     AmountOfFoodActionPerformed(evt);
  945.                                 }
  946.                             });
  947.  
  948.             jLabel1.setFont(new java.awt.Font("Candara", 0, 24));
  949.             jLabel1.setText("Unicorn Killer");
  950.  
  951.             jLabel4.setFont(new java.awt.Font("Times New Roman", 0, 18));
  952.             jLabel4.setText("Amount?");
  953.  
  954.             jLabel5.setFont(new java.awt.Font("Times New Roman", 0, 18));
  955.             jLabel5.setText("Eat at?");
  956.  
  957.             jTextField2.setText("EXAMPLE: 20");
  958.             jTextField2.addActionListener(new java.awt.event.ActionListener() {
  959.                                 public void actionPerformed(java.awt.event.ActionEvent evt) {
  960.                                     EatAtActionPerformed(evt);
  961.                                 }
  962.                             });
  963.             jLabel6.setText("(1 - 99)");
  964.  
  965.             jCheckBox1.setText("Special Attack?");
  966.            
  967.             jCheckBox2.setText("Loot charms?");
  968.            
  969.             jCheckBox3.setText("Eat food for loot space?");
  970.            
  971.  
  972.             javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  973.             getContentPane().setLayout(layout);
  974.             layout.setHorizontalGroup(
  975.                 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  976.                 .addGroup(layout.createSequentialGroup()
  977.                     .addGap(21, 21, 21)
  978.                     .addComponent(jLabel2)
  979.                     .addGap(45, 45, 45)
  980.                     .addComponent(jLabel3)
  981.                     .addGap(43, 43, 43)
  982.                     .addComponent(jLabel4)
  983.                     .addGap(38, 38, 38)
  984.                     .addComponent(jLabel5)
  985.                     .addContainerGap(25, Short.MAX_VALUE))
  986.                 .addGroup(layout.createSequentialGroup()
  987.                     .addGap(121, 121, 121)
  988.                     .addComponent(jLabel1)
  989.                     .addContainerGap(122, Short.MAX_VALUE))
  990.                 .addGroup(layout.createSequentialGroup()
  991.                     .addContainerGap()
  992.                     .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  993.                         .addGroup(layout.createSequentialGroup()
  994.                             .addComponent(jCheckBox1)
  995.                             .addGap(18, 18, 18)
  996.                             .addComponent(jCheckBox2)
  997.                             .addGap(18, 18, 18)
  998.                             .addComponent(jCheckBox3))
  999.                         .addGroup(layout.createSequentialGroup()
  1000.                             .addComponent(TrainComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  1001.                             .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  1002.                             .addComponent(FoodComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  1003.                             .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  1004.                             .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
  1005.                             .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  1006.                             .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)))
  1007.                     .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  1008.                 .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE)
  1009.                 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
  1010.                     .addContainerGap(313, Short.MAX_VALUE)
  1011.                     .addComponent(jLabel6)
  1012.                     .addGap(35, 35, 35))
  1013.             );
  1014.             layout.setVerticalGroup(
  1015.                 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  1016.                 .addGroup(layout.createSequentialGroup()
  1017.                     .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
  1018.                     .addGap(11, 11, 11)
  1019.                     .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  1020.                         .addComponent(jLabel2)
  1021.                         .addComponent(jLabel3)
  1022.                         .addComponent(jLabel4)
  1023.                         .addComponent(jLabel5))
  1024.                     .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  1025.                     .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  1026.                         .addComponent(TrainComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
  1027.                         .addComponent(FoodComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
  1028.                         .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  1029.                         .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  1030.                     .addGap(1, 1, 1)
  1031.                     .addComponent(jLabel6)
  1032.                     .addGap(18, 18, 18)
  1033.                     .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  1034.                         .addComponent(jCheckBox1)
  1035.                         .addComponent(jCheckBox2)
  1036.                         .addComponent(jCheckBox3))
  1037.                     .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE)
  1038.                     .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE))
  1039.             );
  1040.  
  1041.             pack();
  1042.         }
  1043.         private void StartButtonActionPerformed(ActionEvent evt) {
  1044.  
  1045.                             if (TrainComboBox.getSelectedItem() == "Attack") {
  1046.                                 train = "Attack";
  1047.                                 log("Training Attack.");
  1048.                             }
  1049.                             if (TrainComboBox.getSelectedItem() == "Range") {
  1050.                                 train = "Range";
  1051.                                 log("Training Range.");
  1052.                             }
  1053.                             if (TrainComboBox.getSelectedItem() == "Defence") {
  1054.                                 train = "Defence";
  1055.                                 log("Training Defence.");
  1056.                             }
  1057.                             if (TrainComboBox.getSelectedItem() == "Strength") {
  1058.                                 train = "Strength";
  1059.                                 log("Training Strength.");
  1060.                             }
  1061.                             if (FoodComboBox.getSelectedItem() == "Shrimp") {
  1062.                                 food = "Shrimp";
  1063.                                 log("Eating Shrimp.");
  1064.                             }
  1065.                             if (FoodComboBox.getSelectedItem() == "Trout") {
  1066.                                 food = "Trout";
  1067.                             }
  1068.                             if (FoodComboBox.getSelectedItem() == "Salmon") {
  1069.                                 food = "Salmon";
  1070.                                 log("Eating Salmon.");
  1071.                             }
  1072.                             if (FoodComboBox.getSelectedItem() == "Tuna") {
  1073.                                 food = "Tuna";
  1074.                                 log("Eating Tuna.");
  1075.                             }
  1076.                             if (FoodComboBox.getSelectedItem() == "Lobster") {
  1077.                                 food = "Lobster";
  1078.                                 log("Eating Lobster.");
  1079.                             }
  1080.                             if (FoodComboBox.getSelectedItem() == "Swordfish") {
  1081.                                 food = "Swordfish";
  1082.                                 log("Eating Swordfish.");
  1083.                             }
  1084.                             if (FoodComboBox.getSelectedItem() == "Monkfish") {
  1085.                                 food = "Monkfish";
  1086.                                 log("Eating Monkfish.");
  1087.                             }
  1088.                             if (FoodComboBox.getSelectedItem() == "Shark") {
  1089.                                 food = "Shark";
  1090.                                 log("Eating Shark.");
  1091.                             }
  1092.                             if (FoodComboBox.getSelectedItem() == "Rocktail") {
  1093.                                 food = "Rocktail";
  1094.                                 log("Eating Rocktail.");
  1095.                             }
  1096.                             if (jCheckBox1.isSelected()) {
  1097.                                 spec = true;
  1098.                                 log ("We are using special attack... It will take: " + specialAttackPerc + " of the special bar each spec we do.");
  1099.                             }
  1100.                             if (jCheckBox2.isSelected()) {
  1101.                                 lootcharms = true;
  1102.                                 log ("We are looting all charms dropped");
  1103.                             }
  1104.                             if (jCheckBox3.isSelected()) {
  1105.                                 dumpfood = true;
  1106.                                 log ("We are eating food for unicorn horns");
  1107.                             }
  1108.                            
  1109.                             Amount = Integer.parseInt(jTextField1.getText());
  1110.                             eatfoodat = Integer.parseInt(jTextField2.getText());
  1111.                             StartScript = true;
  1112.                         }
  1113.                    
  1114.                        private void EatAtActionPerformed(java.awt.event.ActionEvent evt) {
  1115.                             eatfoodat = Integer.parseInt(jTextField2.getText());
  1116.                             log("We are eating: "+food);
  1117.                         }
  1118.          
  1119.                         private void AmountOfFoodActionPerformed(java.awt.event.ActionEvent evt) {
  1120.                             Amount = Integer.parseInt(jTextField1.getText());
  1121.                             log("We will be withdrawing "+Amount+" "+food+"s and eating at "+eatfoodat+" health.");
  1122.                         }
  1123.  
  1124.         private javax.swing.JComboBox FoodComboBox;
  1125.         private javax.swing.JComboBox TrainComboBox;
  1126.         private javax.swing.JButton jButton1;
  1127.         private javax.swing.JCheckBox jCheckBox1;
  1128.         private javax.swing.JCheckBox jCheckBox2;
  1129.         private javax.swing.JCheckBox jCheckBox3;
  1130.         private javax.swing.JLabel jLabel1;
  1131.         private javax.swing.JLabel jLabel2;
  1132.         private javax.swing.JLabel jLabel3;
  1133.         private javax.swing.JLabel jLabel4;
  1134.         private javax.swing.JLabel jLabel5;
  1135.         private javax.swing.JLabel jLabel6;
  1136.         private javax.swing.JTextField jTextField1;
  1137.         private javax.swing.JTextField jTextField2;
  1138.  
  1139.     }
  1140.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement