Xeroday

Untitled

Jun 7th, 2011
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 200.33 KB | None | 0 0
  1. /**
  2.  * @author White Bear
  3.  * @copyright (C)2010-2011 White Bear
  4.  *          No one except White Bear has the right to modify this script!
  5.  */
  6.  
  7. import java.util.ArrayList;
  8. import java.util.Properties;
  9. import java.util.logging.Level;
  10. import java.awt.*;
  11. import java.awt.event.*;
  12.  
  13. import javax.swing.*;
  14.  
  15. import java.awt.geom.Rectangle2D;
  16. import java.io.BufferedReader;
  17. import java.io.File;
  18. import java.io.FileInputStream;
  19. import java.io.FileWriter;
  20. import java.io.InputStreamReader;
  21. import java.net.URL;
  22. import java.net.URLConnection;
  23. import java.text.NumberFormat;
  24. import java.text.DecimalFormat;
  25.  
  26. import org.rsbot.event.events.MessageEvent;
  27. import org.rsbot.event.listeners.MessageListener;
  28. import org.rsbot.event.listeners.PaintListener;
  29. import org.rsbot.script.Script;
  30. import org.rsbot.script.ScriptManifest;
  31. import org.rsbot.script.methods.*;
  32. import org.rsbot.script.util.Filter;
  33. import org.rsbot.script.wrappers.*;
  34. import org.rsbot.Configuration;
  35.  
  36. @ScriptManifest(authors = {"WhiteBear"}, keywords = "All in One Fighter", name = "White Bear AIO Fighter", version = 0.993, description =
  37.         "Fixed June 7, 2011", website = "http://whitebearrs.orgfree.com")
  38.  
  39. public class WhiteBearAIOFighter extends Script implements PaintListener, MessageListener, MouseListener {
  40.  
  41.     //------------VARIABLES--------------\\
  42.     final ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
  43.     WhiteBearPaint thePainter = new WhiteBearPaint();
  44.     StartupPaint setup = new StartupPaint();
  45.     ChatResponder chatRes;
  46.     Antiban antiban = new Antiban();
  47.     Banker banker = new Banker();
  48.  
  49.     private static final int loadData = 6;
  50.     private int runEnergy = random(50, 88), lvlAmt = 0, minMS = 4, maxMS = 6;
  51.     private int exitStage = 0, camTurned = 0, resCount = 0;
  52.     private int midTime = 90, randTime = 120, midLength = 10, randLength = 20, gainedEXP = 0;
  53.     private static final int[] bones = {526, 532, 530, 528, 3183, 2859, 534, 3125, 4834, 14793, 4812, 3123, 4832, 6729, 536};
  54.     private long stopTime = -1, nextBreak = System.currentTimeMillis(), nextLength = 60000;
  55.     private long nextRun = System.currentTimeMillis();
  56.     private boolean unactivated = true, foundType = false, breakLogout = false, tradeResponse = false, useChatRes = true;
  57.     private boolean useBreaking = false, randomBreaking = false, currentlyBreaking = false, logOutR = false;
  58.     private String totalTime = "00:00:00", status = "Loading...", lastMessage = null;
  59.  
  60.     private int stage = 0, maxDist = 5, minHealth = 100, logoutLevel = -1, breakAmt = 2, logoutSkill = 0, pathRecord = 0;
  61.     private int pathRecordBack = 0, antibanAmt = 1, foodInt = 9999, arrowInt = 9999, priority = 0;
  62.     private int[] logoutSkillsID = {0, 2, 1, 3, 4, 6}, area = {0, 0, 0, 0}, changedSkills = {}, mobId;
  63.     private boolean guiDefine = false, stayArea = true, ranging = false, buryBones = false, Bbreaking = false, useLogout = false, eatFood = true;
  64.     private boolean startPaint = true, doBanking = true, chatResponder = true, cabbage = false, checkUpdate = false, guiOpen = false;
  65.     private boolean useBones = false, useAlch = false, useTabs = false, useLow = true, usePrayer = false, usePrayerPotion = false, usePrayerLogout = true;
  66.     private boolean looting = true, rangeEquip = false, multiway = false, idsInstead = false, guiOpen2 = false, onlyLoot = false, totalMode = false;
  67.     private long underAttack = System.currentTimeMillis() - 100000;
  68.     private String mobNames = "", itemNames = "", arrowName = "";
  69.     private String[] mobName, allLoots, breakAmts = {"Very Common", "Common", "Average", "Rare", "Very Rare"}, userLoots; // user specified loots
  70.     private static String[] logoutSkills = {"Attack", "Strength", "Defence", "Constitution", "Ranged", "Magic"}, antibanAmts = {"Low", "Average", "High"};
  71.     private static String[] step = {"GUI Settings", "Prayer Settings", "Safe Spot", "Banking", "Returning", "Antiban", "Logout", "Save Profile"};
  72.     private String[] slots = {"(Empty Slot)", "(Empty Slot)", "(Empty Slot)", "(Empty Slot)", "(Empty Slot)"};
  73.     private RSTile safeSpot, startLoc;
  74.  
  75.     private enum State {Antiban, InBattle, Fight, Loot, Eat, Alch, Full, Bury, Peaches, Bank, Range, OnPrayer, OffPrayer, PrayerPotion, DropVial, NoPot}
  76.  
  77.     //------------MAIN LOOP--------------\\
  78.     public int loop() {
  79.         try {
  80.             mouse.setSpeed(random(minMS, maxMS));
  81.             if (game.getClientState() != 10) {
  82.                 interfaces.getComponent(976, 6).doClick();
  83.                 env.enableRandom("Login");
  84.                 return random(50, 100);
  85.             }
  86.             env.disableRandom("Login");
  87.             if (startPaint && stage == 11) {
  88.                 if (unactivated)
  89.                     activate();
  90.                 else
  91.                     startPaint = false;
  92.             }
  93.             if (startPaint)
  94.                 return 400;
  95.             if (logOutR) {
  96.                 doLogOut(false, true);
  97.                 return 1000;
  98.             }
  99.             if (useLogout) {
  100.                 if (skills.getCurrentLevel(logoutSkillsID[logoutSkill]) >= logoutLevel) {
  101.                     log("Logging out because we have reached the target level.");
  102.                     logOutR = true;
  103.                     return 100;
  104.                 }
  105.             }
  106.             if (stopTime > 0 && System.currentTimeMillis() > stopTime) {
  107.                 log("Stop Time Reached. Logging off in 5 seconds.");
  108.                 sleep(random(4950, 5600));
  109.                 doLogOut(false, true);
  110.             }
  111.             if (antiban.breakingCheck() && useBreaking) {
  112.                 long endTime = System.currentTimeMillis() + nextLength;
  113.                 currentlyBreaking = true;
  114.                 if (breakLogout) {
  115.                     doLogOut(true, false);
  116.                 }
  117.                 log("Taking a break for " + thePainter.formatTime((int) nextLength));
  118.                 while (System.currentTimeMillis() < endTime && currentlyBreaking == true) {
  119.                     sleep(1000);
  120.                 }
  121.                 currentlyBreaking = false;
  122.                 antiban.breakingNew();
  123.                 return 10;
  124.             }
  125.  
  126.             if (!thePainter.savedStats) {
  127.                 camera.setPitch(true);
  128.                 thePainter.saveStats();
  129.                 return 100;
  130.             }
  131.  
  132.             // interface checks
  133.             interfaces.getComponent(741, 9).doClick();
  134.             interfaces.getComponent(620, 18).doClick();
  135.             interfaces.getComponent(109, 13).doClick();
  136.             interfaces.getComponent(335, 19).doClick();
  137.  
  138.             try {
  139.                 RSPlayer modC = antiban.getNearbyMod();
  140.                 if (modC != null) {
  141.                     if (System.currentTimeMillis() < chatRes.nextModAlert) {
  142.                         chatRes.nextModAlert += 150000;
  143.                         log.warning("[MOD] There is a Moderator nearby! Name: " + modC.getName());
  144.                     }
  145.                 }
  146.             } catch (Exception e) {
  147.             }
  148.  
  149.             startRunning(runEnergy);
  150.             return doAction();
  151.         } catch (java.lang.Throwable t) {
  152.             return 100;
  153.         }
  154.     }
  155.  
  156.     private int doAction() {
  157.         State s;
  158.         if (priority == 1) {
  159.             s = getStateMob();
  160.         } else if (priority == 2 && (looting || buryBones || ranging)) {
  161.             s = getStateItem();
  162.         } else {
  163.             s = getState();
  164.         }
  165.         switch (s) {
  166.             case InBattle:
  167.                 RSNPC mobbie = interactingNpc();
  168.                 if (mobbie != null) {
  169.                     mouse.move(mobbie.getModel().getPoint());
  170.                     onPoint(mobbie.getModel().getPoint(), "Attack");
  171.                     sleep(random(500, 700));
  172.                     int mm = 0;
  173.                     while (valid() && mm < 21 && getMyPlayer().isMoving()) {
  174.                         mm++;
  175.                         sleep(50);
  176.                     }
  177.                 } else {
  178.                     sleep(random(800, 1100));
  179.                 }
  180.                 return random(300, 500);
  181.             case Fight:
  182.                 RSNPC mob = idsInstead ? nearestNpc(mobId) : nearestNpc(mobName);
  183.                 if (mob != null) {
  184.                     int m = 0;
  185.                     if (!calc.pointOnScreen(calc.tileToScreen(mob.getLocation(), 0.5, 0.5, 0))) {
  186.                         walking.walkTileMM(mob.getLocation());
  187.                         sleep(random(500, 700));
  188.                         while (valid() && m < 21 && getMyPlayer().isMoving()) {
  189.                             m++;
  190.                             sleep(50);
  191.                             if (calc.pointOnScreen(calc.tileToScreen(mob.getLocation(), 0.5, 0.5, 0)))
  192.                                 return 10;
  193.                         }
  194.                     } else {
  195.                         mouse.move(mob.getModel().getPoint());
  196.                         onPoint(mob.getModel().getPoint(), "Attack");
  197.                         sleep(random(500, 700));
  198.                         while (valid() && m < 21 && getMyPlayer().isMoving()) {
  199.                             m++;
  200.                             sleep(50);
  201.                         }
  202.                     }
  203.                 } else
  204.                     return 10;
  205.                 return random(300, 500);
  206.             case Loot:
  207.                 return loot();
  208.             case Eat:
  209.                 RSItem food = inventory.getItem(new int[]{foodInt, 6883});
  210.                 if (eatFood && food != null) {
  211.                     int hp = Integer.parseInt(interfaces.getComponent(748, 8).getText());
  212.                     if (food.doAction("Eat")) {
  213.                         int m = 0;
  214.                         while (valid() && m < 31) {
  215.                             m++;
  216.                             sleep(50);
  217.                             if (Integer.parseInt(interfaces.getComponent(748, 8).getText()) > hp + 2)
  218.                                 break;
  219.                         }
  220.                         RSCharacter intx = getMyPlayer().getInteracting();
  221.                         if (intx != null) {
  222.                             mouse.move(intx.getModel().getPoint());
  223.                             if (onPoint(intx.getModel().getPoint(), "Attack")) {
  224.                                 sleep(random(300, 500));
  225.                             }
  226.                         }
  227.                         RSNPC int_ = interactingNpc();
  228.                         if (int_ != null) {
  229.                             mouse.move(int_.getModel().getPoint());
  230.                             if (onPoint(int_.getModel().getPoint(), "Attack")) {
  231.                                 sleep(random(300, 500));
  232.                             }
  233.                         }
  234.                     } else {
  235.                         sleep(1000);
  236.                     }
  237.                 } else {
  238.                     if (eatFood && doBanking && banker.withdrawFood) {
  239.                         if (banker.bankType == 0) {
  240.                             onlyLoot = true;
  241.                         } else {
  242.                             banker.bankingReason = 0;
  243.                             banker.banking = true;
  244.                             camera.setPitch(true);
  245.                         }
  246.                         return 100;
  247.                     }
  248.                     if (cabbage) {
  249.                         if (calc.distanceTo(new RSTile(3054, 3289)) > 8) {
  250.                             // An extra check, just in case
  251.                             RSItem foodTest = inventory.getItem(new int[]{foodInt, 6883});
  252.                             if (eatFood && foodTest != null) {
  253.                                 return 100;
  254.                             }
  255.                             if (!equipment.getItem(Equipment.RING).doAction("Cabbage-port")) {
  256.                                 sleep(random(400, 600));
  257.                                 if (!equipment.getItem(Equipment.RING).doAction("Cabbage-port")) {
  258.                                     sleep(random(400, 600));
  259.                                     if (!equipment.getItem(Equipment.RING).doAction("Cabbage-port")) {
  260.                                         sleep(random(400, 600));
  261.                                         if (!equipment.getItem(Equipment.RING).doAction("Cabbage-port")) {
  262.                                             log.warning("Unable to teleport to cabbage patch!");
  263.                                             log.warning("Logging out because we have run out of food!");
  264.                                             logOutR = true;
  265.                                         }
  266.                                     }
  267.                                 }
  268.                             }
  269.                             sleep(random(700, 800));
  270.                             int f = 0;
  271.                             while (valid() && calc.distanceTo(new RSTile(3054, 3289)) > 8 && f < 61) {
  272.                                 sleep(50);
  273.                                 f++;
  274.                             }
  275.                             log.warning("Logging out because we have run out of food!");
  276.                             logOutR = true;
  277.                         } else {
  278.                             log.warning("Logging out because we have run out of food!");
  279.                             logOutR = true;
  280.                         }
  281.                     } else {
  282.                         if (calc.distanceTo(safeSpot) > 2) {
  283.                             walking.walkTileMM(walking.getClosestTileOnMap(safeSpot));
  284.                             sleep(random(700, 800));
  285.                             int f = 0;
  286.                             while (valid() && getMyPlayer().isMoving() && calc.distanceTo(walking.getDestination()) > 0 && f < 51) {
  287.                                 sleep(50);
  288.                                 f++;
  289.                             }
  290.                             if (calc.distanceTo(safeSpot) < 2) {
  291.                                 log.warning("Logging out because we have run out of food!");
  292.                                 logOutR = true;
  293.                             }
  294.                         } else {
  295.                             log.warning("Logging out because we have run out of food!");
  296.                             logOutR = true;
  297.                         }
  298.                     }
  299.                 }
  300.                 return random(300, 500);
  301.             case Alch:
  302.                 magic.castSpell(useLow ? Magic.SPELL_LOW_LEVEL_ALCHEMY : Magic.SPELL_HIGH_LEVEL_ALCHEMY);
  303.                 int m2 = 0;
  304.                 while (valid() && m2 < 21) {
  305.                     m2++;
  306.                     sleep(50);
  307.                     if (game.getCurrentTab() == Game.TAB_INVENTORY)
  308.                         break;
  309.                 }
  310.                 RSComponent item = selectItem(userLoots);
  311.                 if (item != null)
  312.                     item.doAction("Cast");
  313.                 sleep(500);
  314.                 int maxA = 0;
  315.                 while (valid() && game.getCurrentTab() != 7 && maxA <= 23) {
  316.                     maxA += 1;
  317.                     sleep(random(99, 102));
  318.                 }
  319.                 RSNPC mob1 = idsInstead ? nearestNpc(mobId) : nearestNpc(mobName);
  320.                 if (mob1 == null)
  321.                     magic.castSpell(useLow ? Magic.SPELL_LOW_LEVEL_ALCHEMY : Magic.SPELL_HIGH_LEVEL_ALCHEMY);
  322.                 return random(100, 200);
  323.             case Full:
  324.                 if (doBanking) {
  325.                     if (eatFood) {
  326.                         game.openTab(Game.TAB_INVENTORY);
  327.                         int amt = countLoots();
  328.                         if (amt > 4) {
  329.                             banker.banking = true;
  330.                             banker.bankingReason = 1;
  331.                             camera.setPitch(true);
  332.                             log.info("Going to Bank, reason: Inventory Full");
  333.                         }
  334.                     } else {
  335.                         banker.banking = true;
  336.                         banker.bankingReason = 1;
  337.                         camera.setPitch(true);
  338.                         log.info("Going to Bank, reason: Inventory Full");
  339.                     }
  340.                 } else {
  341.                     log.warning("Inventory is full! Logging out!");
  342.                     logOutR = true;
  343.                     return random(300, 500);
  344.                 }
  345.             case Bury:
  346.                 int count = 0, rand = random(3, 6);
  347.                 for (int i = 0; i < 28; i++) {
  348.                     int c = interfaces.getComponent(149, 0).getComponent(i).getComponentID();
  349.                     for (int x : bones) {
  350.                         if (c == x)
  351.                             if (interfaces.getComponent(149, 0).getComponent(i).doAction("Bury")) {
  352.                                 count++;
  353.                                 sleep(random(300, 500));
  354.                             }
  355.                     }
  356.                     RSNPC mob2 = idsInstead ? nearestNpc(mobId) : nearestNpc(mobName);
  357.                     if (mob2 != null && count >= rand)
  358.                         return random(100, 200);
  359.                     if (!valid())
  360.                         break;
  361.                 }
  362.                 return random(300, 500);
  363.             case Peaches:
  364.                 if (useTabs) {
  365.                     RSItem i = inventory.getItem(8015);
  366.                     if (i != null) {
  367.                         i.doAction("Break");
  368.                         sleep(random(500, 700));
  369.                         int m = 0;
  370.                         while (valid() && m < 21 && getMyPlayer().getAnimation() != -1) {
  371.                             m++;
  372.                             sleep(50);
  373.                         }
  374.                     } else {
  375.                         log.warning("Could not find Bones to Peaches Tabs!");
  376.                         useBones = false;
  377.                         return 100;
  378.                     }
  379.                 } else {
  380.                     magic.castSpell(Magic.SPELL_BONES_TO_PEACHES);
  381.                     if (!magic.castSpell(Magic.SPELL_BONES_TO_PEACHES))
  382.                         magic.castSpell(Magic.SPELL_BONES_TO_PEACHES);
  383.                     sleep(random(300, 500));
  384.                 }
  385.                 return random(300, 500);
  386.             case Bank:
  387.                 int foodCount = inventory.getCount(new int[]{foodInt, 6883});
  388.                 if (((banker.bankType == 0) ? foodCount >= 3 : !inventory.isFull()) && inArea(getMyPlayer().getLocation())) {
  389.                     banker.banking = false;
  390.                     return random(300, 500);
  391.                 }
  392.                 if ((banker.bankType == 0) ? foodCount < 3 : inventory.isFull()) {
  393.                     if (banker.actions[banker.actions.length - 1].distance() > 3) {
  394.                         status = "Walking to Bank";
  395.                         Action a = getNextAction(false);
  396.                         if (a != null) {
  397.                             a.doAction();
  398.                         }
  399.                     } else {
  400.                         status = "Banking";
  401.                         banker.doBank();
  402.                     }
  403.                 } else {
  404.                     status = "Walking Back";
  405.                     Action a = getNextAction(true);
  406.                     if (a != null) {
  407.                         a.doAction();
  408.                     }
  409.                 }
  410.                 return random(300, 500);
  411.             case Range:
  412.                 if (ranging) {
  413.                     RSComponent arrow = selectItem(new String[]{arrowName});
  414.                     if (arrow != null) {
  415.                         if (arrow.doAction("Wield")) {
  416.                             rangeEquip = false;
  417.                             sleep(random(500, 800));
  418.                             return random(50, 100);
  419.                         }
  420.                     } else {
  421.                         log.warning("Out of arrows, logging out!");
  422.                         logOutR = true;
  423.                     }
  424.                 } else {
  425.                     log.warning("Out of arrows, logging out!");
  426.                     logOutR = true;
  427.                 }
  428.                 return random(300, 500);
  429.             case OnPrayer:
  430.                 if (interfaces.getComponent(749, 2).getBackgroundColor() == 1209) {
  431.                     interfaces.getComponent(749, 1).doAction("Turn quick prayers on");
  432.                     for (int i = 0; i < 21; i++) {
  433.                         if (interfaces.getComponent(749, 2).getBackgroundColor() != 1209)
  434.                             break;
  435.                         sleep(50);
  436.                     }
  437.                 }
  438.                 return random(300, 500);
  439.             case OffPrayer:
  440.                 if (interfaces.getComponent(749, 2).getBackgroundColor() != 1209) {
  441.                     interfaces.getComponent(749, 1).doAction("Turn prayers off");
  442.                     for (int i = 0; i < 21; i++) {
  443.                         if (interfaces.getComponent(749, 2).getBackgroundColor() == 1209)
  444.                             break;
  445.                         sleep(50);
  446.                     }
  447.                 }
  448.                 return random(300, 500);
  449.             case PrayerPotion:
  450.                 RSItem pp = inventory.getItem(new int[]{2434, 139, 141, 143, 11465, 11467});
  451.                 if (pp != null) {
  452.                     int prayer = Integer.parseInt(interfaces.getComponent(749, 4).getText().trim());
  453.                     pp.doAction("Drink");
  454.                     for (int i = 0; i < 26; i++) {
  455.                         sleep(50);
  456.                         if (Integer.parseInt(interfaces.getComponent(749, 4).getText().trim()) != prayer) {
  457.                             break;
  458.                         }
  459.                     }
  460.                 }
  461.                 return random(300, 500);
  462.             case NoPot:
  463.                 log.warning("No more prayer potions! Logging out!");
  464.                 logOutR = true;
  465.                 return random(300, 500);
  466.             case DropVial:
  467.                 RSItem v = inventory.getItem(229);
  468.                 if (v != null) {
  469.                     v.doAction("Drop");
  470.                     sleep(random(400, 600));
  471.                 }
  472.                 return random(300, 500);
  473.             case Antiban:
  474.                 if (!antiban.lookAway())
  475.                     antiban.main(true);
  476.                 return random(48, 55);
  477.         }
  478.         return 100;
  479.     }
  480.  
  481.     private State getState() {
  482.         if (onlyLoot) {
  483.             status = "Looting";
  484.             return State.Loot;
  485.         }
  486.         if (banker.banking)
  487.             return State.Bank;
  488.         if (rangeEquip) {
  489.             status = "Equip Arrows";
  490.             return State.Range;
  491.         }
  492.         if (underAttack + 1000 > System.currentTimeMillis()) {
  493.             status = "Under Attack!";
  494.             return State.InBattle;
  495.         }
  496.         if (inCombat()) {
  497.             if (eatFood && Integer.parseInt(interfaces.getComponent(748, 8).getText()) < minHealth) {
  498.                 RSItem food = inventory.getItem(new int[]{foodInt, 6883});
  499.                 if (food == null && useBones) {
  500.                     status = "Bones to Peaches";
  501.                     return State.Peaches;
  502.                 }
  503.                 status = "Eating";
  504.                 return State.Eat;
  505.             } else {
  506.                 status = "Antiban";
  507.                 return State.Antiban;
  508.             }
  509.         } else {
  510.             if (eatFood && Integer.parseInt(interfaces.getComponent(748, 8).getText()) < minHealth) {
  511.                 RSItem food = inventory.getItem(new int[]{foodInt, 6883});
  512.                 if (food == null && useBones) {
  513.                     status = "Bones to Peaches";
  514.                     return State.Peaches;
  515.                 }
  516.                 status = "Eating";
  517.                 return State.Eat;
  518.             }
  519.             RSNPC mob = idsInstead ? nearestNpc(mobId) : nearestNpc(mobName);
  520.             if (mob != null) {
  521.                 if (calc.distanceTo(mob.getLocation()) < 3) {
  522.                     int prayer = Integer.parseInt(interfaces.getComponent(749, 4).getText().trim());
  523.                     double percent = (double) prayer / (double) skills.getRealLevel(Skills.PRAYER);
  524.                     if (usePrayer) {
  525.                         if (usePrayerPotion && percent <= 0.33) {
  526.                             if (inventory.getItem(new int[]{2434, 139, 141, 143, 11465, 11467}) != null) {
  527.                                 status = "Prayer Potion";
  528.                                 return State.PrayerPotion;
  529.                             } else if (usePrayerLogout) {
  530.                                 status = "No more Prayer Potion";
  531.                                 return State.NoPot;
  532.                             }
  533.                         }
  534.                         if (interfaces.getComponent(749, 4).getBackgroundColor() == 1209 && prayer > 0) {
  535.                             status = "Activating Prayer";
  536.                             return State.OnPrayer;
  537.                         }
  538.                     }
  539.                     status = "Fighting";
  540.                     return State.Fight;
  541.                 } else {
  542.                     if (looting || buryBones || ranging) {
  543.                         RSGroundItem item = nearestItem(allLoots);
  544.                         if (item != null && calc.distanceTo(item.getLocation()) < 5) {
  545.                             if (!inventory.isFull()) {
  546.                                 status = "Looting";
  547.                                 return State.Loot;
  548.                             } else {
  549.                                 if (usePrayer && usePrayerPotion && inventory.getItem(229) != null) {
  550.                                     status = "Dropping Vials";
  551.                                     return State.DropVial;
  552.                                 }
  553.                                 RSComponent bone = selectItem(new String[]{"bone"}, "peach");
  554.                                 if (buryBones && bone != null) {
  555.                                     status = "Burying Bones";
  556.                                     return State.Bury;
  557.                                 }
  558.                                 int foodCount = inventory.getCount(new int[]{foodInt, 6883});
  559.                                 if (doBanking) {
  560.                                     if (inventory.isFull() && foodCount < 3) {
  561.                                         if (interfaces.getComponent(749, 4).getBackgroundColor() != 1209 && Integer.parseInt(interfaces.getComponent(749, 4).getText().trim()) > 0) {
  562.                                             status = "Deactivating Prayer";
  563.                                             return State.OffPrayer;
  564.                                         }
  565.                                         if (banker.bankType == 1)
  566.                                             return State.Full;
  567.                                     }
  568.                                 } else {
  569.                                     if (useAlch) {
  570.                                         status = "Doing Alchemy";
  571.                                         return State.Alch;
  572.                                     } else if (inventory.isFull() && foodCount < 3) {
  573.                                         status = "Inventory Full!";
  574.                                         return State.Full;
  575.                                     }
  576.                                 }
  577.                             }
  578.                         } else {
  579.                             int prayer = Integer.parseInt(interfaces.getComponent(749, 4).getText().trim());
  580.                             double percent = (double) prayer / (double) skills.getRealLevel(Skills.PRAYER);
  581.                             if (usePrayer) {
  582.                                 if (usePrayerPotion && percent <= 0.33) {
  583.                                     if (inventory.getItem(new int[]{2434, 139, 141, 143, 11465, 11467}) != null) {
  584.                                         status = "Prayer Potion";
  585.                                         return State.PrayerPotion;
  586.                                     } else if (usePrayerLogout) {
  587.                                         status = "No more Prayer Potion";
  588.                                         return State.NoPot;
  589.                                     }
  590.                                 }
  591.                                 if (interfaces.getComponent(749, 4).getBackgroundColor() == 1209 && prayer > 0) {
  592.                                     status = "Activating Prayer";
  593.                                     return State.OnPrayer;
  594.                                 }
  595.                             }
  596.                             status = "Fighting";
  597.                             return State.Fight;
  598.                         }
  599.                     } else {
  600.                         status = "Fighting";
  601.                         return State.Fight;
  602.                     }
  603.                 }
  604.             } else {
  605.                 if (looting || buryBones || ranging) {
  606.                     RSGroundItem item = nearestItem(allLoots);
  607.                     if (item != null && !inventory.isFull()) {
  608.                         status = "Looting";
  609.                         return State.Loot;
  610.                     } else {
  611.                         if (usePrayer && usePrayerPotion && inventory.getItem(229) != null) {
  612.                             status = "Dropping Vials";
  613.                             return State.DropVial;
  614.                         }
  615.                         RSComponent bone = selectItem(new String[]{"bone"}, "peach");
  616.                         if (buryBones && bone != null) {
  617.                             status = "Burying Bones";
  618.                             return State.Bury;
  619.                         }
  620.                         int foodCount = inventory.getCount(new int[]{foodInt, 6883});
  621.                         if (doBanking) {
  622.                             if (inventory.isFull() && foodCount < 3) {
  623.                                 if (usePrayer && interfaces.getComponent(749, 4).getBackgroundColor() != 1209 && Integer.parseInt(interfaces.getComponent(749, 4).getText().trim()) > 0) {
  624.                                     status = "Deactivating Prayer";
  625.                                     return State.OffPrayer;
  626.                                 }
  627.                                 if (banker.bankType == 1)
  628.                                     return State.Full;
  629.                             }
  630.                         } else {
  631.                             if (useAlch) {
  632.                                 status = "Doing Alchemy";
  633.                                 return State.Alch;
  634.                             } else if (inventory.isFull() && foodCount < 3) {
  635.                                 status = "Inventory Full!";
  636.                                 return State.Full;
  637.                             }
  638.                         }
  639.                     }
  640.                 }
  641.             }
  642.         }
  643.         status = "Waiting";
  644.         return State.Antiban;
  645.     }
  646.  
  647.     private State getStateMob() {
  648.         if (onlyLoot) {
  649.             status = "Looting";
  650.             return State.Loot;
  651.         }
  652.         if (banker.banking)
  653.             return State.Bank;
  654.         if (rangeEquip) {
  655.             status = "Equip Arrows";
  656.             return State.Range;
  657.         }
  658.         if (underAttack + 1000 > System.currentTimeMillis()) {
  659.             status = "Under Attack!";
  660.             return State.InBattle;
  661.         }
  662.         if (inCombat()) {
  663.             if (eatFood && Integer.parseInt(interfaces.getComponent(748, 8).getText()) < minHealth) {
  664.                 RSItem food = inventory.getItem(new int[]{foodInt, 6883});
  665.                 if (food == null && useBones) {
  666.                     status = "Bones to Peaches";
  667.                     return State.Peaches;
  668.                 }
  669.                 status = "Eating";
  670.                 return State.Eat;
  671.             } else {
  672.                 status = "Antiban";
  673.                 return State.Antiban;
  674.             }
  675.         } else {
  676.             if (eatFood && Integer.parseInt(interfaces.getComponent(748, 8).getText()) < minHealth) {
  677.                 RSItem food = inventory.getItem(new int[]{foodInt, 6883});
  678.                 if (food == null && useBones) {
  679.                     status = "Bones to Peaches";
  680.                     return State.Peaches;
  681.                 }
  682.                 status = "Eating";
  683.                 return State.Eat;
  684.             }
  685.             RSNPC mob = idsInstead ? nearestNpc(mobId) : nearestNpc(mobName);
  686.             if (mob != null) {
  687.                 int prayer = Integer.parseInt(interfaces.getComponent(749, 4).getText().trim());
  688.                 double percent = (double) prayer / (double) skills.getRealLevel(Skills.PRAYER);
  689.                 if (usePrayer) {
  690.                     if (usePrayerPotion && percent <= 0.33) {
  691.                         if (inventory.getItem(new int[]{2434, 139, 141, 143, 11465, 11467}) != null) {
  692.                             status = "Prayer Potion";
  693.                             return State.PrayerPotion;
  694.                         } else if (usePrayerLogout) {
  695.                             status = "No more Prayer Potion";
  696.                             return State.NoPot;
  697.                         }
  698.                     }
  699.                     if (interfaces.getComponent(749, 4).getBackgroundColor() == 1209 && prayer > 0) {
  700.                         status = "Activating Prayer";
  701.                         return State.OnPrayer;
  702.                     }
  703.                 }
  704.                 status = "Fighting";
  705.                 return State.Fight;
  706.             } else {
  707.                 if (looting || buryBones || ranging) {
  708.                     RSGroundItem item = nearestItem(allLoots);
  709.                     if (item != null && !inventory.isFull()) {
  710.                         status = "Looting";
  711.                         return State.Loot;
  712.                     } else {
  713.                         if (usePrayer && usePrayerPotion && inventory.getItem(229) != null) {
  714.                             status = "Dropping Vials";
  715.                             return State.DropVial;
  716.                         }
  717.                         RSComponent bone = selectItem(new String[]{"bone"}, "peach");
  718.                         if (buryBones && bone != null) {
  719.                             status = "Burying Bones";
  720.                             return State.Bury;
  721.                         }
  722.                         int foodCount = inventory.getCount(new int[]{foodInt, 6883});
  723.                         if (doBanking) {
  724.                             if (inventory.isFull() && foodCount < 3) {
  725.                                 if (usePrayer && interfaces.getComponent(749, 4).getBackgroundColor() != 1209 && Integer.parseInt(interfaces.getComponent(749, 4).getText().trim()) > 0) {
  726.                                     status = "Deactivating Prayer";
  727.                                     return State.OffPrayer;
  728.                                 }
  729.                                 if (banker.bankType == 1)
  730.                                     return State.Full;
  731.                             }
  732.                         } else {
  733.                             if (useAlch) {
  734.                                 status = "Doing Alchemy";
  735.                                 return State.Alch;
  736.                             } else if (inventory.isFull() && foodCount < 3) {
  737.                                 status = "Inventory Full!";
  738.                                 return State.Full;
  739.                             }
  740.                         }
  741.                     }
  742.                 }
  743.             }
  744.         }
  745.         status = "Waiting";
  746.         return State.Antiban;
  747.     }
  748.  
  749.     private State getStateItem() {
  750.         if (onlyLoot) {
  751.             status = "Looting";
  752.             return State.Loot;
  753.         }
  754.         if (banker.banking)
  755.             return State.Bank;
  756.         if (rangeEquip) {
  757.             status = "Equip Arrows";
  758.             return State.Range;
  759.         }
  760.         if (underAttack + 1000 > System.currentTimeMillis()) {
  761.             status = "Under Attack!";
  762.             return State.InBattle;
  763.         }
  764.         if (inCombat()) {
  765.             if (eatFood && Integer.parseInt(interfaces.getComponent(748, 8).getText()) < minHealth) {
  766.                 RSItem food = inventory.getItem(new int[]{foodInt, 6883});
  767.                 if (food == null && useBones) {
  768.                     status = "Bones to Peaches";
  769.                     return State.Peaches;
  770.                 }
  771.                 status = "Eating";
  772.                 return State.Eat;
  773.             } else {
  774.                 status = "Antiban";
  775.                 return State.Antiban;
  776.             }
  777.         } else {
  778.             if (looting || buryBones || ranging) {
  779.                 RSGroundItem item = nearestItem(allLoots);
  780.                 if (item != null) {
  781.                     if (!inventory.isFull()) {
  782.                         status = "Looting";
  783.                         return State.Loot;
  784.                     } else {
  785.                         if (usePrayer && usePrayerPotion && inventory.getItem(229) != null) {
  786.                             status = "Dropping Vials";
  787.                             return State.DropVial;
  788.                         }
  789.                         RSComponent bone = selectItem(new String[]{"bone"}, "peach");
  790.                         if (buryBones && bone != null) {
  791.                             status = "Burying Bones";
  792.                             return State.Bury;
  793.                         }
  794.                         int foodCount = inventory.getCount(new int[]{foodInt, 6883});
  795.                         if (doBanking) {
  796.                             if (inventory.isFull() && foodCount < 3) {
  797.                                 if (interfaces.getComponent(749, 4).getBackgroundColor() != 1209 && Integer.parseInt(interfaces.getComponent(749, 4).getText().trim()) > 0) {
  798.                                     status = "Deactivating Prayer";
  799.                                     return State.OffPrayer;
  800.                                 }
  801.                                 if (banker.bankType == 1)
  802.                                     return State.Full;
  803.                             }
  804.                         } else {
  805.                             if (useAlch) {
  806.                                 status = "Doing Alchemy";
  807.                                 return State.Alch;
  808.                             } else if (inventory.isFull() && foodCount < 3) {
  809.                                 status = "Inventory Full!";
  810.                                 return State.Full;
  811.                             }
  812.                         }
  813.                     }
  814.                 }
  815.             }
  816.             RSNPC mob = idsInstead ? nearestNpc(mobId) : nearestNpc(mobName);
  817.             if (mob != null) {
  818.                 if (calc.distanceTo(mob.getLocation()) < 3) {
  819.                     int prayer = Integer.parseInt(interfaces.getComponent(749, 4).getText().trim());
  820.                     double percent = (double) prayer / (double) skills.getRealLevel(Skills.PRAYER);
  821.                     if (usePrayer) {
  822.                         if (usePrayerPotion && percent <= 0.33) {
  823.                             if (inventory.getItem(new int[]{2434, 139, 141, 143, 11465, 11467}) != null) {
  824.                                 status = "Prayer Potion";
  825.                                 return State.PrayerPotion;
  826.                             } else if (usePrayerLogout) {
  827.                                 status = "No more Prayer Potion";
  828.                                 return State.NoPot;
  829.                             }
  830.                         }
  831.                         if (interfaces.getComponent(749, 4).getBackgroundColor() == 1209 && prayer > 0) {
  832.                             status = "Activating Prayer";
  833.                             return State.OnPrayer;
  834.                         }
  835.                     }
  836.                     status = "Fighting";
  837.                     return State.Fight;
  838.                 }
  839.             }
  840.         }
  841.         status = "Waiting";
  842.         return State.Antiban;
  843.     }
  844.  
  845.     //--------------CLASSES---------------\\
  846.     public class Action {
  847.         private RSTile tile;
  848.         private int actionType;
  849.         private int floor;
  850.         private int object;
  851.         private String action;
  852.  
  853.         public Action(final RSTile tile, final int floor) {
  854.             this.tile = tile;
  855.             this.floor = floor;
  856.             this.actionType = 0;
  857.             this.object = -1;
  858.             this.action = "nil";
  859.         }
  860.  
  861.         public Action(final RSTile tile, final int actionType, final int floor, final int object, final String action) {
  862.             this.tile = tile;
  863.             this.actionType = actionType;
  864.             this.floor = floor;
  865.             this.object = object;
  866.             if (action.isEmpty())
  867.                 this.action = "nil";
  868.             else
  869.                 this.action = action;
  870.         }
  871.  
  872.         public int distance() {
  873.             return calc.distanceTo(tile);
  874.         }
  875.  
  876.         public String getAction() {
  877.             return action;
  878.         }
  879.  
  880.         public RSTile getTile() {
  881.             return tile;
  882.         }
  883.  
  884.         public int getActionType() {
  885.             return actionType;
  886.         }
  887.  
  888.         public int getFloor() {
  889.             return floor;
  890.         }
  891.  
  892.         public int getObject() {
  893.             return object;
  894.         }
  895.  
  896.         public boolean canUse() {
  897.             if (actionType == 2) {
  898.                 if (tileObjectCheck(tile, object) != null) {
  899.                     return (calc.distanceTo(tile) < 13);
  900.                 } else {
  901.                     return false;
  902.                 }
  903.             } else {
  904.                 if (floor != game.getPlane())
  905.                     return false;
  906.                 return (calc.distanceTo(tile) < 13);
  907.             }
  908.         }
  909.  
  910.         public String toString() {
  911.             return tile.getX() + "," + tile.getY() + "," + actionType + "," + floor + "," + object + "," + action;
  912.         }
  913.  
  914.         public void doAction() {
  915.             if (actionType == 0) { // tiles
  916.                 walking.walkTileMM(tile);
  917.                 sleep(random(550, 700));
  918.                 for (int i = 0; i < 18; i++) {
  919.                     antiban.main(false);
  920.                     sleep(50);
  921.                     if (walking.getDestination() == null)
  922.                         break;
  923.                     if (calc.distanceTo(walking.getDestination()) < 3)
  924.                         break;
  925.                 }
  926.             } else if (actionType == 3) { // teleports
  927.                 RSItem i = inventory.getItem(object);
  928.                 if (i != null) {
  929.                     i.doAction(action);
  930.                     sleep(random(600, 700));
  931.                     int max = 0;
  932.                     while (max < 21 && getMyPlayer().getAnimation() != -1) {
  933.                         max++;
  934.                         sleep(50);
  935.                     }
  936.                 } else {
  937.                     log.warning("Could not find item needed for teleporting!");
  938.                     logOutR = true;
  939.                 }
  940.             } else { // ladders/ropes/doors
  941.                 RSObject o = tileObjectCheck(tile, object);
  942.                 if (o == null) {
  943.                     if (actionType == 1) {
  944.                         log.warning("Could not find object " + object + " on RSTile " + tile.toString() + "! Stopping script.");
  945.                         logOutR = true;
  946.                     } else {
  947.                         return;
  948.                     }
  949.                 } else {
  950.                     Point p = o.getModel().getPoint();
  951.                     if (p.getX() > -1 && p.getY() > -1) {
  952.                         mouse.move(p);
  953.                         onPoint(p, action);
  954.                         sleep(random(550, 700));
  955.                         for (int i = 0; i < 18; i++) {
  956.                             antiban.main(false);
  957.                             sleep(50);
  958.                             if (walking.getDestination() == null)
  959.                                 break;
  960.                             if (calc.distanceTo(walking.getDestination()) < 3)
  961.                                 break;
  962.                         }
  963.                     } else {
  964.                         walking.walkTileMM(tile);
  965.                         sleep(random(550, 700));
  966.                         for (int i = 0; i < 18; i++) {
  967.                             antiban.main(false);
  968.                             sleep(50);
  969.                             if (walking.getDestination() == null)
  970.                                 break;
  971.                             if (calc.distanceTo(walking.getDestination()) < 3)
  972.                                 break;
  973.                         }
  974.                     }
  975.                 }
  976.             }
  977.         }
  978.     }
  979.  
  980.     public class Banker {
  981.         public boolean withdrawFood = true, banking = false;
  982.         public int bankingReason = -1, bankMode = 0, foodLimit = 28, bankType = 0;
  983.  
  984.         public ArrayList<Action> actionsList = new ArrayList<Action>();
  985.         public ArrayList<Action> actionsListReverse = new ArrayList<Action>();
  986.         public Action[] actions = null;
  987.         public Action[] actionsReverse = null;
  988.  
  989.         private void doBank() {
  990.             int failCount = 0;
  991.             try {
  992.                 if (!bank.isOpen()) {
  993.                     RSTile loc = npcs.getNearest(Bank.NPC_BANKERS).getLocation();
  994.                     String msg = "Bank Banker";
  995.                     if (banker.bankMode == 1) {
  996.                         loc = objects.getNearest(Bank.OBJECT_BANKS).getLocation();
  997.                         msg = "Use-quickly";
  998.                     } else if (banker.bankMode == 2) {
  999.                         loc = objects.getNearest(Bank.OBJECT_BANKS).getLocation();
  1000.                         msg = "Bank";
  1001.                     }
  1002.                     if (loc == null || calc.distanceTo(loc) > 6) {
  1003.                         log.warning("Could not find bank! Logging out!");
  1004.                         logOutR = true;
  1005.                         return;
  1006.                     }
  1007.                     if (onTile(loc, msg, 0.5, 0.5, 0)) {
  1008.                         walking.sleep(700);
  1009.                         while (valid() && !bank.isOpen() && failCount < 11) {
  1010.                             sleep(random(95, 105));
  1011.                             if (getMyPlayer().isMoving())
  1012.                                 failCount = 0;
  1013.                             failCount++;
  1014.                         }
  1015.                     } else {
  1016.                         if (onTile(loc, "Use", 0.5, 0.5, 0)) {
  1017.                             walking.sleep(700);
  1018.                             while (valid() && !bank.isOpen() && failCount < 11) {
  1019.                                 sleep(random(95, 105));
  1020.                                 if (getMyPlayer().isMoving())
  1021.                                     failCount = 0;
  1022.                                 failCount++;
  1023.                             }
  1024.                         } else
  1025.                             sleep(random(200, 250));
  1026.                     }
  1027.                 }
  1028.                 if (bank.isOpen()) {
  1029.                     int[] disallowed = {8015, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 4694, 4695, 4696, 4697, 4698, 4699};
  1030.                     if (eatFood)
  1031.                         disallowed = addElement(foodInt, disallowed);
  1032.                     if (ranging)
  1033.                         disallowed = addElement(arrowInt, disallowed);
  1034.                     if (usePrayer && usePrayerPotion) {
  1035.                         disallowed = addElement(2434, disallowed);
  1036.                         disallowed = addElement(139, disallowed);
  1037.                         disallowed = addElement(141, disallowed);
  1038.                         disallowed = addElement(143, disallowed);
  1039.                         disallowed = addElement(11465, disallowed);
  1040.                         disallowed = addElement(11467, disallowed);
  1041.                     }
  1042.                     if (inventory.getCountExcept(disallowed) > 0) {
  1043.                         int inv = inventory.getCount();
  1044.                         bank.depositAllExcept(disallowed);
  1045.                         bank.depositAllExcept(disallowed);
  1046.                         for (int i = 0; i < 23; i++) {
  1047.                             sleep(50);
  1048.                             if (inventory.getCount(foodInt) != inv)
  1049.                                 break;
  1050.                         }
  1051.                         return;
  1052.                     }
  1053.                     int prayerPotCount = inventory.getCount(new int[]{2434, 139, 141, 143, 11465, 11467});
  1054.                     int foodIntCount = inventory.getCount(foodInt);
  1055.                     if (usePrayer && usePrayerPotion && prayerPotCount < 2) {
  1056.                         RSComponent p = searchBank(new int[]{2434, 139, 141, 143, 11465, 11467});
  1057.                         if (p != null) {
  1058.                             if (p.doAction("Withdraw-5")) {
  1059.                                 sleep(random(700, 1000));
  1060.                             }
  1061.                         } else {
  1062.                             usePrayer = false;
  1063.                         }
  1064.                     }
  1065.                     if (eatFood && banker.withdrawFood && foodIntCount < 4) {
  1066.                         int amt = bank.getCount(foodInt);
  1067.                         if (amt == 0) {
  1068.                             log.warning("Cannot withdraw food from bank, logging out!");
  1069.                             logOutR = true;
  1070.                             return;
  1071.                         } else if (amt < 4) {
  1072.                             log.warning("Insufficient food in bank, logging out!");
  1073.                             logOutR = true;
  1074.                             return;
  1075.                         } else {
  1076.                             if (bank.withdraw(foodInt, banker.foodLimit)) {
  1077.                                 sleep(random(700, 1000));
  1078.                             }
  1079.                         }
  1080.                     }
  1081.                     sleep(random(50, 100));
  1082.                 }
  1083.             } catch (final Exception e) {
  1084.             }
  1085.         }
  1086.     }
  1087.  
  1088.     //--------------ON START--------------\\
  1089.     public boolean onStart() {
  1090.         chatRes = new ChatResponder();
  1091.         chatRes.start();
  1092.         env.disableRandom("Login");
  1093.         for (int i = 0; i < 5; i++) {
  1094.             Properties WBini = new Properties();
  1095.             try {
  1096.                 WBini.load(new FileInputStream(new File(Configuration.Paths.getScriptCacheDirectory(), "WhiteBearAIOFighter" + (i + 1) + ".ini")));
  1097.                 slots[i] = "Mobs: " + WBini.getProperty("MobNames") + " Items: " + WBini.getProperty("ItemNames");
  1098.             } catch (java.lang.Exception ee) {
  1099.                 slots[i] = "(Empty Slot)";
  1100.             }
  1101.         }
  1102.         if (!game.isLoggedIn()) {
  1103.             log.warning("You must start the script logged in!");
  1104.         }
  1105.         return true;
  1106.     }
  1107.  
  1108.     //--------------ON FINISH-------------\\
  1109.     public void onFinish() {
  1110.         totalMode = true;
  1111.         chatRes.run = false;
  1112.         if (game.isLoggedIn() && exitStage < 2 && thePainter.runTime >= 3600000) {
  1113.             env.saveScreenshot(false);
  1114.         }
  1115.         log.info("In just " + totalTime + ", you gained a total of " + gainedEXP + " experience.");
  1116.     }
  1117.  
  1118.     //--------------ON REPAINT------------\\
  1119.     public void onRepaint(final Graphics g) {
  1120.         if (startPaint) {
  1121.             RSTile loc = getMyPlayer().getLocation();
  1122.             if (stage == 4 && pathRecord == 1) {
  1123.                 if (banker.actionsList.size() < 0) {
  1124.                     Action aa = new Action(loc, game.getPlane());
  1125.                     banker.actionsList.add(aa);
  1126.                 } else {
  1127.                     RSTile prevLoc = banker.actionsList.get(banker.actionsList.size() - 1).getTile();
  1128.                     if (loc.getX() != prevLoc.getX() || loc.getY() != prevLoc.getY()) {
  1129.                         Action aa = new Action(loc, game.getPlane());
  1130.                         banker.actionsList.add(aa);
  1131.                     }
  1132.                 }
  1133.             } else if (stage == 5 && pathRecordBack == 1) {
  1134.                 if (banker.actionsListReverse.size() < 0) {
  1135.                     Action aa = new Action(loc, game.getPlane());
  1136.                     banker.actionsListReverse.add(aa);
  1137.                 } else {
  1138.                     RSTile prevLoc = banker.actionsListReverse.get(banker.actionsListReverse.size() - 1).getTile();
  1139.                     if (loc.getX() != prevLoc.getX() || loc.getY() != prevLoc.getY()) {
  1140.                         Action aa = new Action(loc, game.getPlane());
  1141.                         banker.actionsListReverse.add(aa);
  1142.                     }
  1143.                 }
  1144.             }
  1145.         }
  1146.         try {
  1147.             if (game.isLoggedIn()) {
  1148.                 final Rectangle nameBlock = new Rectangle(interfaces.get(137).getComponent(54).getAbsoluteX(), interfaces.get(137).getComponent(54).getAbsoluteY() + 2, 89, 13);
  1149.                 g.setColor(new Color(211, 192, 155, 253));
  1150.                 try {
  1151.                     g.fillRect(nameBlock.x, nameBlock.y, nameBlock.width, nameBlock.height);
  1152.                 } catch (Exception e) {
  1153.                 }
  1154.             }
  1155.             g.setFont(new Font("sansserif", Font.PLAIN, 12));
  1156.             ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  1157.             ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
  1158.             ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
  1159.             if (currentlyBreaking) {
  1160.                 g.setColor(new Color(0, 0, 0));
  1161.                 g.setColor(Color.BLACK);
  1162.                 g.setFont(new Font("sansserif", Font.BOLD, 14));
  1163.                 g.drawString("Currently taking a break!", 10, 30);
  1164.             }
  1165.  
  1166.             // Paints the Mouse Location
  1167.             Point mousey = mouse.getLocation();
  1168.             int x = (int) mousey.getX();
  1169.             int y = (int) mousey.getY();
  1170.             if (System.currentTimeMillis() - mouse.getPressTime() < 900)
  1171.                 g.setColor(new Color(255, 0, 0, 170));
  1172.             else
  1173.                 g.setColor(new Color(255, 0, 0, 75));
  1174.             g.drawLine(x, 0, x, game.getHeight());
  1175.             g.drawLine(0, y, game.getWidth(), y);
  1176.             g.fillRect(x - 1, y - 1, 3, 3);
  1177.  
  1178.             if (startPaint) {
  1179.                 setup.paint(g);
  1180.             } else {
  1181.                 if (thePainter.savedStats == true && game.getClientState() == 10) {
  1182.                     thePainter.doPaint(g);
  1183.                 }
  1184.             }
  1185.         } catch (java.lang.Exception e) {
  1186.         }
  1187.     }
  1188.  
  1189.     private class WhiteBearPaint {
  1190.         private final Color color1 = new Color(205, 187, 154);
  1191.         private final Color color2 = new Color(191, 184, 145);
  1192.         private final Color color3 = new Color(153, 153, 153);
  1193.         private final Color color4 = new Color(204, 204, 204);
  1194.         private final Color color5 = new Color(0, 102, 0);
  1195.         private final Color color6 = new Color(0, 0, 0);
  1196.         private final Color color7 = new Color(51, 153, 0);
  1197.         private final Color color8 = new Color(153, 102, 0, 160);
  1198.         private final Color color9 = new Color(153, 102, 0);
  1199.         private final Font font1 = new Font("Arial", 1, 12);
  1200.         private final Font font2 = new Font("Arial", 1, 15);
  1201.         private final Font font3 = new Font("Arial", 1, 11);
  1202.  
  1203.         String[] skillName = {"Attack", "Strength", "Defence", "Constitution", "Ranged", "Magic", "Prayer"};
  1204.         int[] skillID = {0, 2, 1, 3, 4, 6, 5};
  1205.         int paintSkill = 0;
  1206.         int[] start_exp = {-1, -1, -1, -1, -1, -1, -1};
  1207.         int[] start_level = {-1, -1, -1, -1, -1, -1, -1};
  1208.         int[] gained_exp = {0, 0, 0, 0, 0, 0, 0};
  1209.         int[] gained_level = {0, 0, 0, 0, 0, 0, 0};
  1210.  
  1211.         boolean savedStats = false, showPaint = true;
  1212.  
  1213.         final NumberFormat nf = NumberFormat.getInstance();
  1214.  
  1215.         long timeStart = System.currentTimeMillis();
  1216.         long runTime = System.currentTimeMillis() - timeStart;
  1217.  
  1218.         private void doPaint(final Graphics g) {
  1219.             getStats();
  1220.             NumberFormat formatter = new DecimalFormat("#,###,###");
  1221.             runTime = System.currentTimeMillis() - timeStart;
  1222.             totalTime = formatTime((int) runTime);
  1223.             if (showPaint) {
  1224.                 g.setColor(color1);
  1225.                 g.fillRect(8, 346, 487, 111);
  1226.                 g.setColor(color2);
  1227.                 g.drawRect(8, 346, 487, 111);
  1228.                 if (totalMode) {
  1229.                     g.setColor(color5);
  1230.                     g.fillRect(416, 443, 80, 15);
  1231.                     g.setColor(color6);
  1232.                     g.drawRect(416, 443, 80, 15);
  1233.                     g.setColor(color9);
  1234.                     g.setFont(font1);
  1235.                     g.drawString("Total Mode", 426, 456);
  1236.                     g.setFont(new Font("Arial", 1, 17));
  1237.                     g.setColor(new Color(0, 140, 0));
  1238.                     g.drawString("White Bear AIO Fighter", 119, 366);
  1239.                     g.setFont(new Font("Arial", 1, 14));
  1240.                     g.drawString("Version: " + properties.version(), 374, 366);
  1241.                     g.setFont(font1);
  1242.                     g.setColor(color5);
  1243.                     final int totalXp = gained_exp[0] + gained_exp[1] + gained_exp[2] + gained_exp[3] + gained_exp[4] + gained_exp[5] + gained_exp[6];
  1244.                     final int xpHour = ((int) ((3600000.0 / (double) runTime) * totalXp));
  1245.                     final int totalLvl = gained_level[0] + gained_level[1] + gained_level[2] + gained_level[3] + gained_level[4] + gained_level[5] + gained_level[6];
  1246.                     drawString(g, formatter.format((long) totalXp) + " (" + formatter.format((long) xpHour) + "/hr)", 2, false);
  1247.                     drawString(g, status, 1, false);
  1248.                     drawString(g, "A: " + skills.getCurrentLevel(skillID[0]) + ", S: " + skills.getCurrentLevel(skillID[1])
  1249.                             + ", D: " + skills.getCurrentLevel(skillID[2]) + ", C: " + skills.getCurrentLevel(skillID[3])
  1250.                             + ", R: " + skills.getCurrentLevel(skillID[4]) + ", M: " + skills.getCurrentLevel(skillID[5])
  1251.                             + ", P: " + skills.getCurrentLevel(skillID[6]), 3, false);
  1252.                     drawString(g, totalLvl + " levels", 2, true);
  1253.                     drawString(g, totalTime, 1, true);
  1254.  
  1255.                     g.setColor(color6);
  1256.                     g.drawLine(226, 377, 226, 422);
  1257.                     g.setColor(color9);
  1258.                     g.drawString("XP Gained:", 246, 415);
  1259.                     g.drawString("Status:", 246, 390);
  1260.                     g.drawString("Current Levels:", 18, 440);
  1261.                     g.drawString("Levels Gained:", 18, 415);
  1262.                     g.drawString("Time Running:", 18, 390);
  1263.                 } else {
  1264.                     g.setColor(color5);
  1265.                     g.fillRect(416, 443, 80, 15);
  1266.                     g.setColor(color6);
  1267.                     g.drawRect(416, 443, 80, 15);
  1268.                     g.setColor(color9);
  1269.                     g.setFont(font1);
  1270.                     g.drawString("Normal Mode", 420, 456);
  1271.                     g.setColor(color3);
  1272.                     g.fillRect(32, 359, 427, 10);
  1273.                     g.setColor(color4);
  1274.                     g.fillRect(32, 349, 427, 10);
  1275.                     g.setColor(color7);
  1276.                     g.fillRect(462, 352, 12, 12);
  1277.                     g.setColor(color6);
  1278.                     g.drawRect(462, 352, 12, 12);
  1279.                     g.setColor(color7);
  1280.                     g.fillRect(16, 352, 12, 12);
  1281.                     g.setColor(color6);
  1282.                     g.drawRect(16, 352, 12, 12);
  1283.                     g.drawRect(31, 349, 428, 19);
  1284.                     final int percent = skills.getPercentToNextLevel(skillID[paintSkill]);
  1285.                     g.setColor(color8);
  1286.                     g.fillRect(35, 352, (int) (((double) 421 / 100.0) * (double) percent), 14);
  1287.                     g.setFont(font1);
  1288.                     g.setColor(color5);
  1289.                     final int xpHour = ((int) ((3600000.0 / (double) runTime) * gained_exp[paintSkill]));
  1290.                     final int TTL = (int) (((double) skills.getExpToNextLevel(skillID[paintSkill]) / (double) xpHour) * 3600000);
  1291.                     drawString(g, formatter.format((long) skills.getExpToNextLevel(skillID[paintSkill])), 3, false);
  1292.                     drawString(g, formatter.format((long) gained_exp[paintSkill]) + " (" + formatter.format((long) xpHour) + "/hr)", 2, false);
  1293.                     drawString(g, status, 1, false);
  1294.                     drawString(g, formatTime(TTL), 3, true);
  1295.                     drawString(g, skills.getCurrentLevel(skillID[paintSkill]) + " (" + gained_level[paintSkill] + " gained)", 2, true);
  1296.                     drawString(g, totalTime, 1, true);
  1297.  
  1298.                     g.setColor(color6);
  1299.                     g.drawLine(226, 377, 226, 448);
  1300.                     g.setColor(color9);
  1301.                     g.drawString("XP to Level:", 246, 440);
  1302.                     g.drawString("XP Gained:", 246, 415);
  1303.                     g.drawString("Status:", 246, 390);
  1304.                     g.drawString("Time to Level:", 18, 440);
  1305.                     g.drawString("Current Level:", 18, 415);
  1306.                     g.drawString("Time Running:", 18, 390);
  1307.                     g.setFont(font2);
  1308.                     g.drawString(">", 465, 363);
  1309.                     g.drawString("<", 19, 364);
  1310.                     g.setFont(font3);
  1311.                     g.setColor(color6);
  1312.                     g.drawString(skills.getPercentToNextLevel(skillID[paintSkill]) + "%", 429, 363);
  1313.                     g.drawString(skillName[paintSkill], 38, 363);
  1314.                 }
  1315.                 g.setColor(color5);
  1316.                 g.fillRect(483, 344, 13, 15);
  1317.                 g.setColor(color6);
  1318.                 g.drawRect(483, 344, 13, 15);
  1319.                 g.setFont(new Font("Arial", 1, 14));
  1320.                 g.setColor(color9);
  1321.                 g.drawString("X", 486, 357);
  1322.             } else {
  1323.                 g.setColor(color5);
  1324.                 g.fillRect(483, 344, 13, 15);
  1325.                 g.setColor(color6);
  1326.                 g.drawRect(483, 344, 13, 15);
  1327.                 g.setFont(new Font("Arial", 1, 14));
  1328.                 g.setColor(color9);
  1329.                 g.drawString("0", 486, 357);
  1330.             }
  1331.         }
  1332.  
  1333.         public void saveStats() {
  1334.             if (skills.getCurrentLevel(Skills.ATTACK) > 0 && game.isLoggedIn()) {
  1335.                 nf.setMinimumIntegerDigits(2);
  1336.                 for (int i = 0; i < 7; i++) {
  1337.                     start_exp[i] = skills.getCurrentExp(skillID[i]);
  1338.                     start_level[i] = skills.getCurrentLevel(skillID[i]);
  1339.                 }
  1340.                 savedStats = true;
  1341.             }
  1342.         }
  1343.  
  1344.         public void getStats() {
  1345.             if (savedStats) {
  1346.                 for (int i = 0; i < 7; i++) {
  1347.                     gained_exp[i] = skills.getCurrentExp(skillID[i]) - start_exp[i];
  1348.                     gained_level[i] = skills.getCurrentLevel(skillID[i]) - start_level[i];
  1349.                     if (gained_exp[i] > 0) {
  1350.                         if (changedSkills.length == 0)
  1351.                             changedSkills = new int[]{i};
  1352.                         else {
  1353.                             boolean canAdd = true;
  1354.                             for (int e = 0; e < changedSkills.length; e++) {
  1355.                                 if (changedSkills[e] == i) {
  1356.                                     canAdd = false;
  1357.                                     break;
  1358.                                 }
  1359.                             }
  1360.                             if (canAdd)
  1361.                                 addElement(i, changedSkills);
  1362.                         }
  1363.                     }
  1364.                 }
  1365.                 int exp = 0;
  1366.                 for (int i = 0; i < 7; i++) {
  1367.                     exp = exp + gained_exp[i];
  1368.                 }
  1369.                 gainedEXP = exp;
  1370.             }
  1371.         }
  1372.  
  1373.         public void drawString(final Graphics g, final String val, final int index, final boolean leftSide) {
  1374.             final FontMetrics font = g.getFontMetrics();
  1375.             final Rectangle2D bounds = font.getStringBounds(val, g);
  1376.             final int width = (int) bounds.getWidth();
  1377.             if (leftSide)
  1378.                 g.drawString(val, (210 - width), (365 + index * 25));
  1379.             else
  1380.                 g.drawString(val, (466 - width), (365 + index * 25));
  1381.         }
  1382.  
  1383.         public String formatTime(final long milliseconds) {
  1384.             final long t_seconds = milliseconds / 1000;
  1385.             final long t_minutes = t_seconds / 60;
  1386.             final long t_hours = t_minutes / 60;
  1387.             final long seconds = t_seconds % 60;
  1388.             final long minutes = t_minutes % 60;
  1389.             final long hours = t_hours;
  1390.             return (nf.format(hours) + ":" + nf.format(minutes) + ":" + nf.format(seconds));
  1391.         }
  1392.     }
  1393.  
  1394.     private class StartupPaint {
  1395.         private final Font font1 = new Font("Arial", 1, 16);
  1396.         private final Font font2 = new Font("Arial", 1, 12);
  1397.         private final Font font3 = new Font("Arial", 1, 14);
  1398.         private final Font font4 = new Font("Arial", 1, 15);
  1399.         private final Font font5 = new Font("Arial", 1, 13);
  1400.  
  1401.         Rectangle main = new Rectangle(8, 346, 487, 111);
  1402.         Rectangle prev = new Rectangle(383, 347, 59, 15);
  1403.         Rectangle next = new Rectangle(446, 347, 46, 15);
  1404.  
  1405.         private void paintStage2(final Graphics g) {
  1406.             g.setColor(new Color(51, 153, 0));
  1407.             g.fillRect(next.x, next.y, next.width, next.height);
  1408.             g.setColor(new Color(0, 0, 0));
  1409.             g.drawRect(next.x, next.y, next.width, next.height);
  1410.             g.setColor(new Color(153, 102, 0));
  1411.             g.setFont(font2);
  1412.             g.drawString("next", 457, 359);
  1413.  
  1414.             g.setFont(new Font("Arial", 1, 15));
  1415.             g.setColor(new Color(153, 102, 0));
  1416.             g.drawString("Logout when no potion", 77, 447);
  1417.             g.drawString("Use Prayer Potions", 102, 417);
  1418.             g.drawString("Use Quick Prayers", 107, 386);
  1419.  
  1420.             if (usePrayer) {
  1421.                 g.setColor(new Color(153, 153, 153));
  1422.                 g.fillRoundRect(291, 370, 38, 22, 5, 5);//"OFF"
  1423.                 g.setColor(new Color(0, 0, 0));
  1424.                 g.drawRoundRect(291, 370, 38, 22, 5, 5);
  1425.                 g.setColor(new Color(0, 153, 204));
  1426.                 g.fillRoundRect(260, 370, 40, 22, 5, 5);
  1427.                 g.setColor(new Color(0, 0, 0));
  1428.                 g.drawRoundRect(260, 370, 40, 22, 5, 5);
  1429.                 g.setFont(new Font("Arial", 1, 14));
  1430.                 g.setColor(new Color(255, 255, 255));
  1431.                 g.drawString("ON", 271, 387);
  1432.             } else {
  1433.                 g.setColor(new Color(153, 153, 153));
  1434.                 g.fillRoundRect(260, 370, 38, 22, 5, 5);//"ON"
  1435.                 g.setColor(new Color(0, 0, 0));
  1436.                 g.drawRoundRect(260, 370, 38, 22, 5, 5);
  1437.                 g.setColor(new Color(204, 204, 204));
  1438.                 g.fillRoundRect(289, 370, 40, 22, 5, 5);
  1439.                 g.setColor(new Color(0, 0, 0));
  1440.                 g.drawRoundRect(289, 370, 40, 22, 5, 5);
  1441.                 g.setFont(new Font("Arial", 1, 14));
  1442.                 g.setColor(new Color(0, 0, 0));
  1443.                 g.drawString("OFF", 295, 387);
  1444.             }
  1445.             if (usePrayerPotion) {
  1446.                 g.setColor(new Color(153, 153, 153));
  1447.                 g.fillRoundRect(291, 401, 38, 22, 5, 5);//"OFF"
  1448.                 g.setColor(new Color(0, 0, 0));
  1449.                 g.drawRoundRect(291, 401, 38, 22, 5, 5);
  1450.                 g.setColor(new Color(0, 153, 204));
  1451.                 g.fillRoundRect(260, 401, 40, 22, 5, 5);
  1452.                 g.setColor(new Color(0, 0, 0));
  1453.                 g.drawRoundRect(260, 401, 40, 22, 5, 5);
  1454.                 g.setFont(new Font("Arial", 1, 14));
  1455.                 g.setColor(new Color(255, 255, 255));
  1456.                 g.drawString("ON", 271, 418);
  1457.             } else {
  1458.                 g.setColor(new Color(153, 153, 153));
  1459.                 g.fillRoundRect(260, 401, 38, 22, 5, 5);//"ON"
  1460.                 g.setColor(new Color(0, 0, 0));
  1461.                 g.drawRoundRect(260, 401, 38, 22, 5, 5);
  1462.                 g.setColor(new Color(204, 204, 204));
  1463.                 g.fillRoundRect(289, 401, 40, 22, 5, 5);
  1464.                 g.setColor(new Color(0, 0, 0));
  1465.                 g.drawRoundRect(289, 401, 40, 22, 5, 5);
  1466.                 g.setFont(new Font("Arial", 1, 14));
  1467.                 g.setColor(new Color(0, 0, 0));
  1468.                 g.drawString("OFF", 295, 418);
  1469.             }
  1470.             if (usePrayerLogout) {
  1471.                 g.setColor(new Color(153, 153, 153));
  1472.                 g.fillRoundRect(291, 431, 38, 22, 5, 5);//"OFF"
  1473.                 g.setColor(new Color(0, 0, 0));
  1474.                 g.drawRoundRect(291, 431, 38, 22, 5, 5);
  1475.                 g.setColor(new Color(0, 153, 204));
  1476.                 g.fillRoundRect(260, 431, 40, 22, 5, 5);
  1477.                 g.setColor(new Color(0, 0, 0));
  1478.                 g.drawRoundRect(260, 431, 40, 22, 5, 5);
  1479.                 g.setFont(new Font("Arial", 1, 14));
  1480.                 g.setColor(new Color(255, 255, 255));
  1481.                 g.drawString("ON", 271, 448);
  1482.             } else {
  1483.                 g.setColor(new Color(153, 153, 153));
  1484.                 g.fillRoundRect(260, 431, 38, 22, 5, 5);//"ON"
  1485.                 g.setColor(new Color(0, 0, 0));
  1486.                 g.drawRoundRect(260, 431, 38, 22, 5, 5);
  1487.                 g.setColor(new Color(204, 204, 204));
  1488.                 g.fillRoundRect(289, 431, 40, 22, 5, 5);
  1489.                 g.setColor(new Color(0, 0, 0));
  1490.                 g.drawRoundRect(289, 431, 40, 22, 5, 5);
  1491.                 g.setFont(new Font("Arial", 1, 14));
  1492.                 g.setColor(new Color(0, 0, 0));
  1493.                 g.drawString("OFF", 295, 448);
  1494.             }
  1495.         }
  1496.  
  1497.         public void paint(final Graphics g) {
  1498.             ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  1499.             g.setColor(new Color(205, 187, 154));
  1500.             g.fillRect(main.x, main.y, main.width, main.height);
  1501.             g.setColor(new Color(191, 184, 145));
  1502.             g.drawRect(main.x, main.y, main.width, main.height);
  1503.             if (stage > 0 && stage < 9) {
  1504.                 g.setFont(font2);
  1505.                 g.setColor(new Color(51, 153, 0));
  1506.                 g.fillRect(prev.x, prev.y, prev.width, prev.height);
  1507.                 g.setColor(new Color(0, 0, 0));
  1508.                 g.drawRect(prev.x, prev.y, prev.width, prev.height);
  1509.                 g.setColor(new Color(153, 102, 0));
  1510.                 g.drawString("Step " + stage + "/8: " + step[stage - 1], 11, 360);
  1511.                 g.drawString("previous", 389, 359);
  1512.             }
  1513.             switch (stage) {
  1514.                 case 0:
  1515.                     g.setColor(new Color(51, 153, 0));
  1516.                     g.fillRoundRect(156, 411, 188, 26, 8, 8);
  1517.                     g.fillRoundRect(149, 361, 204, 28, 8, 8);
  1518.                     g.setColor(new Color(0, 0, 0));
  1519.                     g.drawRoundRect(156, 411, 188, 26, 8, 8);
  1520.                     g.drawRoundRect(149, 361, 204, 28, 8, 8);
  1521.                     g.setFont(font1);
  1522.                     g.setColor(new Color(117, 78, 0));
  1523.                     g.drawString("Load Profile", 205, 430);
  1524.                     g.drawString("Create New Profile", 182, 381);
  1525.                     break;
  1526.                 case 1:
  1527.                     g.setColor(new Color(102, 153, 0));
  1528.                     g.fillRoundRect(126, 389, 253, 28, 8, 8);
  1529.                     g.setColor(new Color(0, 0, 0));
  1530.                     g.drawRoundRect(126, 389, 253, 28, 8, 8);
  1531.                     if (guiDefine) {
  1532.                         g.setColor(new Color(51, 153, 0));
  1533.                         g.fillRect(next.x, next.y, next.width, next.height);
  1534.                         g.setColor(new Color(0, 0, 0));
  1535.                         g.drawRect(next.x, next.y, next.width, next.height);
  1536.                         g.setColor(new Color(153, 102, 0));
  1537.                         g.setFont(font2);
  1538.                         g.drawString("next", 457, 359);
  1539.  
  1540.                         g.setFont(font1);
  1541.                         g.drawString("Edit GUI Settings", 190, 409);
  1542.                     } else {
  1543.                         g.setFont(font1);
  1544.                         g.drawString("Click here to open GUI", 169, 409);
  1545.                     }
  1546.                     break;
  1547.                 case 2:
  1548.                     paintStage2(g);
  1549.                     break;
  1550.                 case 3:
  1551.                     g.setColor(new Color(51, 153, 0));
  1552.                     g.fillRect(next.x, next.y, next.width, next.height);
  1553.                     g.setColor(new Color(0, 0, 0));
  1554.                     g.drawRect(next.x, next.y, next.width, next.height);
  1555.                     g.setColor(new Color(153, 102, 0));
  1556.                     g.setFont(font2);
  1557.                     g.drawString("next", 457, 359);
  1558.                     if (cabbage) {
  1559.                         g.setColor(new Color(102, 153, 0));
  1560.                         g.fillRoundRect(278, 427, 205, 21, 5, 5);//"use safe spot"
  1561.                         g.setColor(new Color(0, 0, 0));
  1562.                         g.drawRoundRect(278, 427, 205, 21, 5, 5);
  1563.                         g.setFont(font3);
  1564.                         g.setColor(new Color(153, 102, 0));
  1565.                         g.drawString("Use Safe Spot instead", 308, 443);
  1566.                         g.setFont(font5);
  1567.                         g.drawString("Please ensure that an Explorer's Ring 3 or 4 is equipped.", 17, 413);
  1568.                         g.setFont(font4);
  1569.                         g.drawString("Using Cabbage Teleport instead of Safe Spot", 46, 388);
  1570.  
  1571.                     } else {
  1572.                         g.setColor(new Color(102, 153, 0));
  1573.                         g.fillRoundRect(251, 428, 234, 21, 5, 5);//"use cabbage teleport"
  1574.                         g.setColor(new Color(0, 0, 0));
  1575.                         g.drawRoundRect(251, 428, 234, 21, 5, 5);
  1576.                         g.setFont(font3);
  1577.                         g.setColor(new Color(153, 102, 0));
  1578.                         g.drawString("Use Cabbage Teleport Instead", 263, 444);
  1579.                         g.setFont(font5);
  1580.                         g.drawString("safe spot before being logged out.", 17, 431);
  1581.                         g.drawString("When out of food and your lifepoint is low, you will be moved to the", 17, 413);
  1582.                         g.setFont(font4);
  1583.                         g.drawString("Walk to Safe Spot, then click next.", 46, 388);
  1584.                     }
  1585.                     break;
  1586.                 case 4:
  1587.                     if (pathRecord == 0) {
  1588.                         g.setColor(new Color(51, 153, 0));
  1589.                         g.fillRoundRect(86, 408, 59, 22, 5, 5);//"start"
  1590.                         g.setColor(new Color(0, 0, 0));
  1591.                         g.drawRoundRect(86, 408, 59, 22, 5, 5);
  1592.                         g.setFont(font4);
  1593.                         g.setColor(new Color(153, 102, 0));
  1594.                         g.drawString("Start", 100, 425);
  1595.                         g.drawString("When ready, click Start and walk to bank.", 46, 388);
  1596.                     } else if (pathRecord == 1) {
  1597.                         g.setColor(new Color(204, 0, 0));
  1598.                         g.fillRoundRect(85, 406, 52, 22, 5, 5);//"stop"
  1599.                         g.setColor(new Color(0, 0, 0));
  1600.                         g.drawRoundRect(85, 406, 52, 22, 5, 5);
  1601.                         g.setFont(font4);
  1602.                         g.setColor(new Color(153, 102, 0));
  1603.                         g.drawString("Stop", 95, 422);
  1604.                         g.drawString("Click stop when you have reached the bank.", 46, 388);
  1605.                         g.setColor(new Color(102, 153, 0));
  1606.                         g.fillRoundRect(339, 428, 144, 20, 5, 5);
  1607.                         g.setColor(new Color(0, 0, 0));
  1608.                         g.drawRoundRect(339, 428, 144, 20, 5, 5);//add special action
  1609.                         g.setFont(new Font("Arial", 1, 14));
  1610.                         g.setColor(new Color(153, 102, 0));
  1611.                         g.drawString("Add Special Action", 347, 443);
  1612.                     } else {
  1613.                         g.setColor(new Color(51, 153, 0));
  1614.                         g.fillRect(next.x, next.y, next.width, next.height);
  1615.                         g.setColor(new Color(0, 0, 0));
  1616.                         g.drawRect(next.x, next.y, next.width, next.height);
  1617.                         g.setColor(new Color(153, 102, 0));
  1618.                         g.setFont(font2);
  1619.                         g.drawString("next", 457, 359);
  1620.  
  1621.                         g.setColor(new Color(204, 0, 0));
  1622.                         g.fillRoundRect(85, 406, 52, 22, 5, 5);//"clear"
  1623.                         g.setColor(new Color(0, 0, 0));
  1624.                         g.drawRoundRect(85, 406, 52, 22, 5, 5);
  1625.                         g.setFont(font4);
  1626.                         g.setColor(new Color(153, 102, 0));
  1627.                         g.drawString("Clear", 92, 422);
  1628.                         g.drawString("To set a new path, click Clear.", 46, 388);
  1629.                     }
  1630.                     break;
  1631.                 case 5:
  1632.                     if (pathRecordBack == 0) {
  1633.                         g.setColor(new Color(204, 0, 0));
  1634.                         g.setColor(new Color(51, 153, 0));
  1635.                         g.fillRoundRect(86, 408, 59, 22, 5, 5);//"start"
  1636.                         g.setColor(new Color(0, 0, 0));
  1637.                         g.drawRoundRect(86, 408, 59, 22, 5, 5);
  1638.                         g.setFont(font4);
  1639.                         g.setColor(new Color(153, 102, 0));
  1640.                         g.drawString("Start", 100, 425);
  1641.                         g.drawString("When ready, click Start and walk to the monsters.", 46, 388);
  1642.                     } else if (pathRecordBack == 1) {
  1643.                         g.setColor(new Color(204, 0, 0));
  1644.                         g.fillRoundRect(85, 406, 52, 22, 5, 5);//"stop"
  1645.                         g.setColor(new Color(0, 0, 0));
  1646.                         g.drawRoundRect(85, 406, 52, 22, 5, 5);
  1647.                         g.setFont(font4);
  1648.                         g.setColor(new Color(153, 102, 0));
  1649.                         g.drawString("Stop", 95, 422);
  1650.                         g.drawString("Click stop when you have reached the monsters.", 46, 388);
  1651.                         g.setColor(new Color(102, 153, 0));
  1652.                         g.fillRoundRect(339, 428, 144, 20, 5, 5);
  1653.                         g.setColor(new Color(0, 0, 0));
  1654.                         g.drawRoundRect(339, 428, 144, 20, 5, 5);//add special action
  1655.                         g.setFont(new Font("Arial", 1, 14));
  1656.                         g.setColor(new Color(153, 102, 0));
  1657.                         g.drawString("Add Special Action", 347, 443);
  1658.                     } else {
  1659.                         g.setColor(new Color(51, 153, 0));
  1660.                         g.fillRect(next.x, next.y, next.width, next.height);
  1661.                         g.setColor(new Color(0, 0, 0));
  1662.                         g.drawRect(next.x, next.y, next.width, next.height);
  1663.                         g.setColor(new Color(153, 102, 0));
  1664.                         g.setFont(font2);
  1665.                         g.drawString("next", 457, 359);
  1666.  
  1667.                         g.setColor(new Color(204, 0, 0));
  1668.                         g.fillRoundRect(85, 406, 52, 22, 5, 5);//"clear"
  1669.                         g.setColor(new Color(0, 0, 0));
  1670.                         g.drawRoundRect(85, 406, 52, 22, 5, 5);
  1671.                         g.setFont(font4);
  1672.                         g.setColor(new Color(153, 102, 0));
  1673.                         g.drawString("Clear", 92, 422);
  1674.                         g.drawString("To set a new path, click Clear.", 46, 388);
  1675.                     }
  1676.                     break;
  1677.                 case 6:
  1678.                     g.setColor(new Color(51, 153, 0));
  1679.                     g.fillRect(next.x, next.y, next.width, next.height);
  1680.                     g.setColor(new Color(0, 0, 0));
  1681.                     g.drawRect(next.x, next.y, next.width, next.height);
  1682.                     g.setColor(new Color(153, 102, 0));
  1683.                     g.setFont(font2);
  1684.                     g.drawString("next", 457, 359);
  1685.  
  1686.                     g.setColor(new Color(51, 153, 0));
  1687.                     if (Bbreaking)
  1688.                         g.fillRect(444, 423, 12, 12);//breaking >
  1689.                     g.fillRect(183, 423, 12, 12);//antiban >
  1690.                     g.setColor(new Color(204, 0, 0));
  1691.                     if (Bbreaking)
  1692.                         g.fillRect(314, 423, 12, 12);//breaking <
  1693.                     g.fillRect(88, 423, 12, 12);//antiban <
  1694.                     g.setColor(new Color(0, 0, 0));
  1695.                     if (Bbreaking) {
  1696.                         g.drawRect(444, 423, 12, 12);
  1697.                         g.drawRect(314, 423, 12, 12);
  1698.                     }
  1699.                     g.drawRect(183, 423, 12, 12);
  1700.                     g.drawRect(88, 423, 12, 12);
  1701.                     g.setColor(new Color(204, 204, 204));
  1702.                     if (Bbreaking)
  1703.                         g.fillRoundRect(331, 419, 108, 19, 5, 5);
  1704.                     g.fillRoundRect(105, 419, 73, 19, 5, 5);
  1705.                     g.setColor(new Color(0, 0, 0));
  1706.                     g.drawRoundRect(105, 419, 73, 19, 5, 5);
  1707.                     if (Bbreaking)
  1708.                         g.drawRoundRect(331, 419, 108, 19, 5, 5);
  1709.                     g.setFont(font4);
  1710.                     g.setColor(new Color(153, 102, 0));
  1711.                     if (Bbreaking) {
  1712.                         g.drawString(">", 447, 434);
  1713.                         g.drawString("<", 317, 434);
  1714.                     }
  1715.                     g.drawString(">", 186, 434);
  1716.                     g.drawString("<", 91, 434);
  1717.                     g.drawString("Use Breaking", 249, 394);
  1718.                     if (Bbreaking)
  1719.                         g.drawString("Breaking", 241, 435);
  1720.                     g.drawString("Antiban", 28, 435);
  1721.                     g.drawString("Chat Responder", 23, 393);
  1722.                     g.setFont(new Font("Arial", 1, 13));
  1723.                     if (Bbreaking)
  1724.                         g.drawString(breakAmts[breakAmt], 339, 433);
  1725.                     g.drawString(antibanAmts[antibanAmt], 114, 434);
  1726.                     if (chatResponder) {
  1727.                         g.setColor(new Color(153, 153, 153));
  1728.                         g.fillRoundRect(177, 376, 38, 22, 5, 5);//"OFF"
  1729.                         g.setColor(new Color(0, 0, 0));
  1730.                         g.drawRoundRect(177, 376, 38, 22, 5, 5);
  1731.                         g.setColor(new Color(0, 153, 204));
  1732.                         g.fillRoundRect(144, 376, 40, 22, 5, 5);
  1733.                         g.setColor(new Color(0, 0, 0));
  1734.                         g.drawRoundRect(144, 376, 40, 22, 5, 5);
  1735.                         g.setFont(font3);
  1736.                         g.setColor(new Color(255, 255, 255));
  1737.                         g.drawString("ON", 154, 393);
  1738.                     } else {
  1739.                         g.setColor(new Color(153, 153, 153));
  1740.                         g.fillRoundRect(144, 376, 38, 22, 5, 5);//"ON"
  1741.                         g.setColor(new Color(0, 0, 0));
  1742.                         g.drawRoundRect(144, 376, 38, 22, 5, 5);
  1743.                         g.setColor(new Color(204, 204, 204));
  1744.                         g.fillRoundRect(174, 376, 40, 22, 5, 5);
  1745.                         g.setColor(new Color(0, 0, 0));
  1746.                         g.drawRoundRect(174, 376, 40, 22, 5, 5);
  1747.                         g.setFont(font3);
  1748.                         g.setColor(new Color(0, 0, 0));
  1749.                         g.drawString("OFF", 180, 393);
  1750.                     }
  1751.                     if (Bbreaking) {
  1752.                         g.setColor(new Color(153, 153, 153));
  1753.                         g.fillRoundRect(385, 376, 38, 22, 5, 5);//"OFF"
  1754.                         g.setColor(new Color(0, 0, 0));
  1755.                         g.drawRoundRect(385, 376, 38, 22, 5, 5);
  1756.                         g.setColor(new Color(0, 153, 204));
  1757.                         g.fillRoundRect(352, 376, 40, 22, 5, 5);
  1758.                         g.setColor(new Color(0, 0, 0));
  1759.                         g.drawRoundRect(352, 376, 40, 22, 5, 5);
  1760.                         g.setFont(font3);
  1761.                         g.setColor(new Color(255, 255, 255));
  1762.                         g.drawString("ON", 362, 393);
  1763.                     } else {
  1764.                         g.setColor(new Color(153, 153, 153));
  1765.                         g.fillRoundRect(352, 376, 38, 22, 5, 5);//"ON"
  1766.                         g.setColor(new Color(0, 0, 0));
  1767.                         g.drawRoundRect(352, 376, 38, 22, 5, 5);
  1768.                         g.setColor(new Color(204, 204, 204));
  1769.                         g.fillRoundRect(382, 376, 40, 22, 5, 5);
  1770.                         g.setColor(new Color(0, 0, 0));
  1771.                         g.drawRoundRect(382, 376, 40, 22, 5, 5);
  1772.                         g.setFont(font3);
  1773.                         g.setColor(new Color(0, 0, 0));
  1774.                         g.drawString("OFF", 388, 393);
  1775.                     }
  1776.                     break;
  1777.                 case 7:
  1778.                     g.setColor(new Color(51, 153, 0));
  1779.                     g.fillRect(next.x, next.y, next.width, next.height);
  1780.                     g.setColor(new Color(0, 0, 0));
  1781.                     g.drawRect(next.x, next.y, next.width, next.height);
  1782.                     g.setColor(new Color(153, 102, 0));
  1783.                     g.setFont(font2);
  1784.                     g.drawString("next", 457, 359);
  1785.  
  1786.                     g.setColor(new Color(204, 0, 0));
  1787.                     g.fillRoundRect(407, 423, 57, 19, 5, 5);//"skip"
  1788.                     g.fillRect(364, 385, 12, 12);//level -
  1789.                     g.fillRect(118, 385, 12, 12);//skill <
  1790.                     g.setColor(new Color(51, 153, 0));
  1791.                     g.fillRect(426, 385, 12, 12);//level +
  1792.                     g.fillRect(230, 385, 12, 12);//skill >
  1793.                     g.setColor(new Color(204, 204, 204));
  1794.                     g.fillRoundRect(382, 381, 38, 19, 5, 5);
  1795.                     g.fillRoundRect(136, 381, 88, 19, 5, 5);
  1796.                     g.setColor(new Color(0, 0, 0));
  1797.                     g.drawRoundRect(407, 423, 57, 19, 5, 5);
  1798.                     g.drawRect(426, 385, 12, 12);
  1799.                     g.drawRect(364, 385, 12, 12);
  1800.                     g.drawRect(230, 385, 12, 12);
  1801.                     g.drawRect(118, 385, 12, 12);
  1802.                     g.drawRoundRect(382, 381, 38, 19, 5, 5);
  1803.                     g.drawRoundRect(136, 381, 88, 19, 5, 5);
  1804.                     g.setFont(new Font("Arial", 1, 14));
  1805.                     g.setColor(new Color(153, 102, 0));
  1806.                     g.drawString(Integer.toString(logoutLevel), 393, 396);
  1807.                     g.setFont(new Font("Arial", 1, 13));
  1808.                     g.drawString(logoutSkills[logoutSkill], 142, 396);
  1809.                     g.setFont(new Font("Arial", 1, 15));
  1810.                     g.drawString("+", 429, 398);
  1811.                     g.drawString("-", 368, 395);
  1812.                     g.drawString(">", 233, 397);
  1813.                     g.drawString("<", 121, 396);
  1814.                     g.drawString("Skip", 420, 438);
  1815.                     g.drawString("is above Level", 252, 397);
  1816.                     g.drawString("Logout when", 18, 397);
  1817.                     break;
  1818.                 case 8:
  1819.                     break;
  1820.                 case 9:
  1821.                     g.setColor(new Color(102, 153, 0));
  1822.                     g.fillRect(446, 347, 46, 15);//"back"
  1823.                     g.setColor(new Color(0, 0, 0));
  1824.                     g.drawRect(446, 347, 46, 15);
  1825.                     g.setFont(new Font("Arial", 1, 12));
  1826.                     g.setColor(new Color(153, 102, 0));
  1827.                     g.drawString("back", 456, 359);
  1828.                     g.drawString("Load Profile:", 11, 360);
  1829.                     break;
  1830.                 case 10:
  1831.                     g.setColor(new Color(204, 0, 0));
  1832.                     g.fillRoundRect(247, 404, 50, 20, 5, 5);//"no"
  1833.                     g.setColor(new Color(51, 153, 0));
  1834.                     g.fillRoundRect(166, 404, 50, 20, 5, 5);//"yes"
  1835.                     g.setColor(new Color(0, 0, 0));
  1836.                     g.drawRoundRect(247, 404, 50, 20, 5, 5);
  1837.                     g.drawRoundRect(166, 404, 50, 20, 5, 5);
  1838.                     g.setFont(new Font("Arial", 1, 15));
  1839.                     g.setColor(new Color(153, 102, 0));
  1840.                     g.drawString("No", 263, 420);
  1841.                     g.drawString("Yes", 177, 420);
  1842.                     g.drawString("Do you wish to Check for Updates?", 120, 386);
  1843.                     break;
  1844.                 case 11:
  1845.                     g.setFont(new Font("Arial", 1, 15));
  1846.                     g.setColor(new Color(153, 102, 0));
  1847.                     g.drawString("Loading, please wait...", 58, 393);
  1848.                     break;
  1849.             }
  1850.             if (stage == 8 || stage == 9) {
  1851.                 g.setColor(new Color(153, 153, 153));
  1852.                 g.fillRect(59, 431, 429, 15);//slot 5
  1853.                 g.fillRect(59, 401, 429, 15);//slot 3
  1854.                 g.fillRect(59, 371, 429, 15);//slot 1
  1855.                 g.setColor(new Color(204, 204, 204));
  1856.                 g.fillRect(59, 416, 429, 15);//slot 4
  1857.                 g.fillRect(59, 386, 429, 15);//slot 2
  1858.                 g.setColor(new Color(0, 0, 0));
  1859.                 g.drawRect(59, 431, 429, 15);
  1860.                 g.drawRect(59, 416, 429, 15);
  1861.                 g.drawRect(59, 401, 429, 15);
  1862.                 g.drawRect(59, 386, 429, 15);
  1863.                 g.drawRect(59, 371, 429, 15);
  1864.                 g.setFont(font5);
  1865.                 g.setColor(new Color(153, 102, 0));
  1866.                 g.drawString("Slot 5", 17, 444);
  1867.                 g.drawString("Slot 4", 17, 429);
  1868.                 g.drawString("Slot 3", 17, 414);
  1869.                 g.drawString("Slot 2", 17, 399);
  1870.                 g.drawString("Slot 1", 17, 384);
  1871.                 g.setFont(font2);
  1872.                 g.drawString(slots[4], 63, 444);
  1873.                 g.drawString(slots[3], 63, 429);
  1874.                 g.drawString(slots[2], 63, 414);
  1875.                 g.drawString(slots[1], 63, 399);
  1876.                 g.drawString(slots[0], 63, 384);
  1877.             }
  1878.  
  1879.         }
  1880.     }
  1881.  
  1882.     //--------------SERVER MSG------------\\
  1883.     public void messageReceived(MessageEvent arg0) {
  1884.         try {
  1885.             String serverString = arg0.getMessage();
  1886.             if (arg0.getID() > 0 && arg0.getID() < 10)
  1887.                 return;
  1888.             if (serverString.contains("You've just advanced")) {
  1889.                 if (lvlAmt == 0) {
  1890.                     log("[Alert] You have just leveled, thanks to White Bear AIO Fighter!");
  1891.                 } else {
  1892.                     log("[Alert] Another level by White Bear AIO Fighter!");
  1893.                 }
  1894.                 lvlAmt += 1;
  1895.             }
  1896.             if (serverString.contains("Prayer button next to the minimap to")) {
  1897.                 if (usePrayer) {
  1898.                     log.severe("Could not use prayer! Use prayer disabled!");
  1899.                     usePrayer = false;
  1900.                 }
  1901.             }
  1902.             if (serverString.contains("Nature Runes to cast this spell")) {
  1903.                 if (useAlch) {
  1904.                     log.severe("Out of runes! Alchemy disabled!");
  1905.                     useAlch = false;
  1906.                 }
  1907.                 if (useBones && !useTabs) {
  1908.                     log.severe("Out of runes! Bones to Peaches disabled!");
  1909.                     useBones = false;
  1910.                 }
  1911.             }
  1912.             if (serverString.contains("no ammo left")) {
  1913.                 rangeEquip = true;
  1914.             }
  1915.             if (serverString.contains("already under attack")) {
  1916.                 underAttack = System.currentTimeMillis();
  1917.             }
  1918.             if (serverString.contains("runes to cast this spell")) {
  1919.                 log.severe("Out of runes! Logging out!");
  1920.                 logOutR = true;
  1921.             }
  1922.             if (serverString.contains("Oh dear")) {
  1923.                 log.severe("[Alert] You were killed! Aborting script!");
  1924.                 logOutR = true;
  1925.             }
  1926.             if (serverString.contains("System update in")) {
  1927.                 log.warning("There will be a system update soon, so we logged out");
  1928.                 logOutR = true;
  1929.             }
  1930.             if (serverString.contains("wishes to trade with you")) {
  1931.                 tradeResponse = true;
  1932.             }
  1933.         } catch (java.lang.Throwable t) {
  1934.         }
  1935.     }
  1936.  
  1937.     //---------------ANTIBAN--------------\\
  1938.     private class Antiban {
  1939.         int cam = 27;
  1940.         int[] skillInterfaces = {1, 4, 22, 2, 46, 87, 70};
  1941.         boolean checkFriend = false, checkExperience = true, screenLookaway = false;
  1942.  
  1943.         //Antiban timeouts and next times
  1944.         long timeOutB1 = 600000, timeOutB2 = 800000;
  1945.         long timeFriend = System.currentTimeMillis(), timeExp = System.currentTimeMillis();
  1946.         long timeLook = System.currentTimeMillis();
  1947.         long timeOutFriend = 20000, timeOutExp = 20000;
  1948.  
  1949.         private void main(boolean extras) {
  1950.             mouse.setSpeed(random(minMS + 1, maxMS + 1));
  1951.             if (!chatRes.typing) {
  1952.                 if (nextRun < System.currentTimeMillis() && walking.getEnergy() >= random(79, 90)) {
  1953.                     nextRun = System.currentTimeMillis() + 7000;
  1954.                     walking.setRun(true);
  1955.                     sleep(100);
  1956.                 }
  1957.                 int random = random(1, 21);
  1958.                 if (random == 1) {
  1959.                     if (random(1, 3) == 1) {
  1960.                         chatRes.wait = true;
  1961.                         mouse.move(random(5, game.getWidth()), random(5, game.getHeight()));
  1962.                         chatRes.wait = false;
  1963.                     }
  1964.                 }
  1965.                 if (random == 2) {
  1966.                     int randCamera = random(1, cam);
  1967.                     if (randCamera <= 4) {
  1968.                         camTurned += 1;
  1969.                         chatRes.wait = true;
  1970.                         turnCamera();
  1971.                         chatRes.wait = false;
  1972.                     }
  1973.                 }
  1974.                 if (extras) {
  1975.                     if (checkExperience && random == 6 && changedSkills.length > 0) {
  1976.                         if (System.currentTimeMillis() > timeExp && random(1, 46) == 1) {
  1977.                             if (game.getCurrentTab() != 1) {
  1978.                                 int r = changedSkills[random(0, changedSkills.length)];
  1979.                                 chatRes.wait = true;
  1980.                                 game.openTab(1);
  1981.                                 Point stats = new Point(interfaces.get(320).getComponent(skillInterfaces[r]).getAbsoluteX() + 20, interfaces.get(320).getComponent(skillInterfaces[r]).getAbsoluteY() + 10);
  1982.                                 mouse.move(stats, 5, 5);
  1983.                                 sleepCR(random(28, 31));
  1984.                                 timeExp = System.currentTimeMillis() + (long) random(timeOutExp - 1500, timeOutExp + 1500);
  1985.                                 chatRes.wait = false;
  1986.                             }
  1987.                         }
  1988.                     }
  1989.                     if (random == 7) {
  1990.                         if (random(0, 2) == 0) {
  1991.                             if (checkFriend && System.currentTimeMillis() > timeFriend && random(1, 19) == 1) {
  1992.                                 chatRes.wait = true;
  1993.                                 game.openTab(9);
  1994.                                 sleepCR(random(18, 25));
  1995.                                 timeFriend = System.currentTimeMillis() + (long) random(timeOutFriend - 1500, timeOutFriend + 1500);
  1996.                                 chatRes.wait = false;
  1997.                             }
  1998.                         }
  1999.                     }
  2000.                     if (random == 8) {
  2001.                         final int chance2 = random(1, 20);
  2002.                         if (chance2 == 1) {
  2003.                             RSPlayer player = players.getNearest(Players.ALL_FILTER);
  2004.                             if (player != null && calc.distanceTo(player) != 0) {
  2005.                                 chatRes.wait = true;
  2006.                                 mouse.move(player.getScreenLocation(), 5, 5);
  2007.                                 sleepCR(random(6, 9));
  2008.                                 mouse.click(false);
  2009.                                 sleepCR(random(15, 17));
  2010.                                 mouse.move(random(10, 450), random(10, 495));
  2011.                                 chatRes.wait = false;
  2012.                             }
  2013.                         }
  2014.                     }
  2015.                 }
  2016.             }
  2017.             mouse.setSpeed(random(minMS, maxMS));
  2018.         }
  2019.  
  2020.         private void turnCamera() {
  2021.             final char[] LR = new char[]{KeyEvent.VK_LEFT,
  2022.                     KeyEvent.VK_RIGHT};
  2023.             final char[] UD = new char[]{KeyEvent.VK_DOWN,
  2024.                     KeyEvent.VK_UP};
  2025.             final char[] LRUD = new char[]{KeyEvent.VK_LEFT,
  2026.                     KeyEvent.VK_RIGHT, KeyEvent.VK_UP,
  2027.                     KeyEvent.VK_DOWN};
  2028.             final int randomLR = random(0, 2);
  2029.             final int randomUD = random(0, 2);
  2030.             int randomAll = random(0, 4);
  2031.             if (!banker.banking)
  2032.                 randomAll = random(0, 2);
  2033.  
  2034.  
  2035.             if (random(0, 3) == 0) {
  2036.                 keyboard.pressKey(LR[randomLR]);
  2037.                 sleepCR(random(2, 9));
  2038.                 if (!banker.banking)
  2039.                     keyboard.pressKey(UD[randomUD]);
  2040.                 sleepCR(random(6, 10));
  2041.                 if (!banker.banking)
  2042.                     keyboard.releaseKey(UD[randomUD]);
  2043.                 sleepCR(random(2, 7));
  2044.                 keyboard.releaseKey(LR[randomLR]);
  2045.             } else {
  2046.                 keyboard.pressKey(LRUD[randomAll]);
  2047.                 if (randomAll > 1) {
  2048.                     sleepCR(random(6, 11));
  2049.                 } else {
  2050.                     sleepCR(random(9, 12));
  2051.                 }
  2052.                 keyboard.releaseKey(LRUD[randomAll]);
  2053.             }
  2054.         }
  2055.  
  2056.         private boolean lookAway() {
  2057.             if (!chatRes.typing && screenLookaway && timeLook < System.currentTimeMillis() && inCombat() && random(0, 111) == 0) {
  2058.                 chatRes.pause = true;
  2059.                 status = "Looking Away";
  2060.                 if (random(0, 75) <= 50) {
  2061.                     mouse.setSpeed(random(3, 5));
  2062.                     mouse.move(random(40, game.getWidth() - 50), game.getHeight());
  2063.                     mouse.setSpeed(random(minMS, maxMS));
  2064.                 }
  2065.                 int r1 = random(0, 101);
  2066.                 if (!foundType)
  2067.                     r1 = 1;
  2068.                 int to = 0;
  2069.                 try {
  2070.                     if (getMyPlayer().getInteracting().getHPPercent() > 6) {
  2071.                         int m = 0;
  2072.                         while (valid() && inCombat() && m < 601) {
  2073.                             m++;
  2074.                             sleep(50);
  2075.                             if (getMyPlayer().getInteracting().getHPPercent() < 6) {
  2076.                                 break;
  2077.                             }
  2078.                         }
  2079.                         if (r1 > 57) {
  2080.                             to = random(500, 3500);
  2081.                             sleep(to);
  2082.                         }
  2083.                         timeLook = (long) (System.currentTimeMillis() + random(timeOutB1, timeOutB2));
  2084.                     }
  2085.                 } catch (Throwable e) {
  2086.                 }
  2087.                 chatRes.pause = false;
  2088.                 return true;
  2089.             }
  2090.             return false;
  2091.         }
  2092.  
  2093.         private RSPlayer getNearbyMod() {
  2094.             RSPlayer[] modCheck = players.getAll();
  2095.             int Dist = 18;
  2096.             RSPlayer closest = null;
  2097.             int element = 0;
  2098.             int size = modCheck.length;
  2099.             while (element < size) {
  2100.                 if (modCheck[element] != null) {
  2101.                     try {
  2102.                         if (modCheck[element].getName().startsWith("Mod")) {
  2103.                             int distance = calc.distanceTo(modCheck[element]);
  2104.                             if (distance < Dist) {
  2105.                                 Dist = distance;
  2106.                                 closest = modCheck[element];
  2107.                             }
  2108.                         }
  2109.                     } catch (Exception ignored) {
  2110.                     }
  2111.                 }
  2112.                 element += 1;
  2113.             }
  2114.             return closest;
  2115.         }
  2116.  
  2117.         private void breakingNew() {
  2118.             if (randomBreaking) {
  2119.                 long varTime = random(7200000, 18000000);
  2120.                 nextBreak = System.currentTimeMillis() + varTime;
  2121.                 long varLength = random(120000, 600000);
  2122.                 nextLength = varLength;
  2123.             } else {
  2124.                 int diff = randTime * 1000 * 60;
  2125.                 long varTime = random((midTime * 1000 * 60) - diff, (midTime * 1000 * 60) + diff);
  2126.                 nextBreak = System.currentTimeMillis() + varTime;
  2127.                 int diff2 = randLength * 1000 * 60;
  2128.                 long varLength = random((midLength * 1000 * 60) - diff2, (midLength * 1000 * 60) + diff2);
  2129.                 nextLength = varLength;
  2130.             }
  2131.         }
  2132.  
  2133.         private boolean breakingCheck() {
  2134.             if (nextBreak <= System.currentTimeMillis()) {
  2135.                 return true;
  2136.             }
  2137.             return false;
  2138.         }
  2139.  
  2140.         private boolean sleepCR(int amtOfHalfSecs) {
  2141.             for (int x = 0; x < (amtOfHalfSecs + 1); x++) {
  2142.                 sleep(random(48, 53));
  2143.                 if (chatRes.typing) {
  2144.                     return false;
  2145.                 }
  2146.             }
  2147.             return true;
  2148.         }
  2149.     }
  2150.  
  2151.     //--------------METHODS---------------\\
  2152.     private int loot() {
  2153.         RSGroundItem item = nearestItem(allLoots);
  2154.         if (allLoots == null && onlyLoot) {
  2155.             onlyLoot = false;
  2156.             banker.bankingReason = 0;
  2157.             banker.banking = true;
  2158.             camera.setPitch(true);
  2159.             log.info("Going to Bank, reason: Out of Food");
  2160.         }
  2161.         if (item != null) {
  2162.             int m = 0;
  2163.             if (!calc.pointOnScreen(calc.tileToScreen(item.getLocation(), 0.5, 0.5, 0))) {
  2164.                 // Item not within sight; walk towards it
  2165.                 walking.walkTileMM(item.getLocation());
  2166.                 sleep(random(500, 700));
  2167.                 while (valid() && m < 21 && getMyPlayer().isMoving()) {
  2168.                     m++;
  2169.                     sleep(50);
  2170.                     if (calc.pointOnScreen(calc.tileToScreen(item.getLocation(), 0.5, 0.5, 0)))
  2171.                         return 10;
  2172.                 }
  2173.             } else {
  2174.                 // Takes the item
  2175.                 int count = inventory.getCount();
  2176.                 mouse.move(calc.tileToScreen(item.getLocation(), 0.5, 0.5, 0));
  2177.                 sleep(10);
  2178.                 onTile(item.getLocation(), "Take " + item.getItem().getName(), 0.5, 0.5, 0);
  2179.                 sleep(random(500, 700));
  2180.                 while (valid() && m < 21) {
  2181.                     m++;
  2182.                     sleep(50);
  2183.                     if (inventory.getCount() != count)
  2184.                         break;
  2185.                 }
  2186.             }
  2187.         } else {
  2188.             if (onlyLoot) {
  2189.                 onlyLoot = false;
  2190.                 banker.bankingReason = 0;
  2191.                 banker.banking = true;
  2192.                 camera.setPitch(true);
  2193.                 log.info("Going to Bank, reason: Out of Food");
  2194.             }
  2195.             return 10;
  2196.         }
  2197.         return random(300, 500);
  2198.     }
  2199.  
  2200.     private void activate() {
  2201.         if (!game.isFixed()) {
  2202.             log.warning("Your screen size is not Fixed!");
  2203.             log.warning("This script will encounter problems if you don't change it to fixed!");
  2204.         }
  2205.         area[0] = startLoc.getX() - maxDist;
  2206.         area[1] = startLoc.getY() - maxDist;
  2207.         area[2] = startLoc.getX() + maxDist;
  2208.         area[3] = startLoc.getY() + maxDist;
  2209.         if (usePrayerPotion) {
  2210.             RSItem[] items = inventory.getItems(new int[]{2434, 139, 141, 143, 11465, 11467});
  2211.             if (items == null || items.length < 1) {
  2212.                 log.warning("Could not find Prayer Potions. Allowed IDs: 2434,139,141,143,11465,11467");
  2213.                 log.warning("We will not be using Prayer Potions.");
  2214.                 usePrayerPotion = false;
  2215.             }
  2216.         }
  2217.  
  2218.         if (looting) {
  2219.             for (String s : userLoots) {
  2220.                 allLoots = addElement(s, allLoots);
  2221.             }
  2222.         }
  2223.         if (ranging) {
  2224.             game.openTab(Game.TAB_EQUIPMENT);
  2225.             sleep(random(300, 500));
  2226.             allLoots = addElement(equipment.getItem(Equipment.AMMO).getName(), allLoots);
  2227.             arrowName = equipment.getItem(Equipment.AMMO).getName();
  2228.         }
  2229.         switch (antibanAmt) {
  2230.             case 0:
  2231.                 antiban.cam = 200;
  2232.                 antiban.checkExperience = false;
  2233.                 antiban.checkFriend = false;
  2234.                 antiban.screenLookaway = false;
  2235.                 break;
  2236.             case 1:
  2237.                 antiban.cam = 25;
  2238.                 antiban.checkExperience = true;
  2239.                 antiban.checkFriend = false;
  2240.                 antiban.screenLookaway = false;
  2241.                 break;
  2242.             case 2:
  2243.                 antiban.cam = 25;
  2244.                 antiban.checkExperience = true;
  2245.                 antiban.checkFriend = true;
  2246.                 antiban.screenLookaway = true;
  2247.                 break;
  2248.         }
  2249.         switch (breakAmt) {
  2250.             case 0:
  2251.                 randLength = 7;
  2252.                 midLength = 12;
  2253.                 randTime = 30;
  2254.                 midTime = 60;
  2255.                 break;
  2256.             case 1:
  2257.                 randLength = 7;
  2258.                 midLength = 17;
  2259.                 randTime = 30;
  2260.                 midTime = 90;
  2261.                 break;
  2262.             case 2:
  2263.                 randLength = 10;
  2264.                 midLength = 25;
  2265.                 randTime = 30;
  2266.                 midTime = 150;
  2267.                 break;
  2268.             case 3:
  2269.                 randLength = 7;
  2270.                 midLength = 32;
  2271.                 randTime = 30;
  2272.                 midTime = 210;
  2273.                 break;
  2274.             case 4:
  2275.                 randLength = 10;
  2276.                 midLength = 40;
  2277.                 randTime = 30;
  2278.                 midTime = 270;
  2279.                 break;
  2280.         }
  2281.         if (checkUpdate) {
  2282.             URLConnection url = null;
  2283.             BufferedReader in = null;
  2284.             try {
  2285.                 url = new URL("http://whitebearrs.orgfree.com/content/updater.php?script=fighter&type=all").openConnection();
  2286.                 in = new BufferedReader(new InputStreamReader(url.getInputStream()));
  2287.                 String ver = in.readLine();
  2288.                 String link = in.readLine();
  2289.                 String update = in.readLine();
  2290.                 if (Double.parseDouble(ver) > properties.version()) {
  2291.                     log.warning("Latest version: " + ver + "! Please update the script!");
  2292.                     log.info("In this update: " + update);
  2293.                     log.info("Download from: " + link);
  2294.                 } else if (Double.parseDouble(ver) < properties.version()) {
  2295.                     log.info("You are using a beta version of this script!");
  2296.                 } else {
  2297.                     log.info("You are using the latest version of this script!");
  2298.                 }
  2299.                 if (in != null)
  2300.                     in.close();
  2301.             } catch (java.lang.Exception e) {
  2302.                 log.warning("An error occurred while checking for update!");
  2303.             }
  2304.         }
  2305.         antiban.breakingNew();
  2306.         thePainter.timeStart = System.currentTimeMillis();
  2307.         unactivated = false;
  2308.     }
  2309.  
  2310.     private int countLoots() {
  2311.         int count = 0;
  2312.         int[] not = {8015, 526, 532, 530, 528, 3183, 2859, 534, 3125, 4834, 14793, 4812, 3123, 4832, 6729, 536, foodInt, arrowInt};
  2313.         for (int i = 0; i < 28; i++) {
  2314.             int c = interfaces.getComponent(149, 0).getComponent(i).getComponentID();
  2315.             boolean canAdd = true;
  2316.             for (int x = 0; x < not.length; x++) {
  2317.                 if (c == not[x]) {
  2318.                     canAdd = false;
  2319.                     break;
  2320.                 }
  2321.             }
  2322.             if (canAdd)
  2323.                 count++;
  2324.         }
  2325.         return count;
  2326.     }
  2327.  
  2328.     private boolean doLogOut(boolean toLobby, boolean stopScript) {
  2329.         status = "Logging out";
  2330.         while (bank.isOpen()) {
  2331.             bank.close();
  2332.             mouse.move(random(10, 430), random(10, 465));
  2333.             sleep(random(200, 400));
  2334.         }
  2335.         while (!game.isOnLogoutTab()) {
  2336.             mouse.move(random(game.getWidth() - 15, game.getWidth() - 5), random(5, 16));
  2337.             mouse.click(true);
  2338.             if (bank.isOpen()) {
  2339.                 bank.close();
  2340.             }
  2341.             int timesToWait = 0;
  2342.             while (!game.isOnLogoutTab() && timesToWait < 5) {
  2343.                 sleep(random(200, 400));
  2344.                 timesToWait++;
  2345.             }
  2346.         }
  2347.         int maximum = 0;
  2348.         while (game.isLoggedIn() == true && maximum < 20) {
  2349.             if (toLobby) {
  2350.                 interfaces.get(182).getComponent(2).doClick();
  2351.             } else {
  2352.                 interfaces.get(182).getComponent(6).doClick();
  2353.             }
  2354.             sleep(1000);
  2355.         }
  2356.         if (!toLobby && stopScript) {
  2357.             stopScript(false);
  2358.         }
  2359.         return true;
  2360.     }
  2361.  
  2362.     private Action getNextAction(boolean reverse) {
  2363.         Action use = null;
  2364.         boolean special = false;
  2365.         Action spUse = null;
  2366.         int spDist = 0;
  2367.         Action[] source = (reverse ? banker.actionsReverse : banker.actions);
  2368.         for (Action a : source) {
  2369.             if (a.canUse()) {
  2370.                 int thisDist = a.distance();
  2371.                 if (a.getActionType() != 0) {
  2372.                     spUse = a;
  2373.                     spDist = thisDist;
  2374.                     special = true;
  2375.                 } else {
  2376.                     if (thisDist > spDist) {
  2377.                         use = a;
  2378.                         special = false;
  2379.                     }
  2380.                 }
  2381.             }
  2382.         }
  2383.         return special ? spUse : use;
  2384.     }
  2385.  
  2386.     private boolean inArea(RSTile loc) {
  2387.         if (stayArea) {
  2388.             return loc.getX() >= area[0] && loc.getX() <= area[2] && loc.getY() >= area[1] && loc.getY() <= area[3];
  2389.         } else {
  2390.             return true;
  2391.         }
  2392.     }
  2393.  
  2394.     private boolean inCombat() {
  2395.         if (getMyPlayer().getInteracting() == null) {
  2396.             return false;
  2397.         }
  2398.         if (getMyPlayer().getInteracting().getHPPercent() > 0.00)
  2399.             return true;
  2400.         return false;
  2401.     }
  2402.  
  2403.     private RSGroundItem nearestItem(final String[] item) {
  2404.         if (item == null)
  2405.             return null;
  2406.         RSGroundItem g = groundItems.getNearest(new Filter<RSGroundItem>() {
  2407.             public boolean accept(RSGroundItem t) {
  2408.                 for (final String i : item) {
  2409.                     if (t.getItem().getName() != null && t.getItem().getName().toLowerCase().contains(i) && inArea(t.getLocation()))
  2410.                         return true;
  2411.                 }
  2412.                 return false;
  2413.             }
  2414.         });
  2415.         return g;
  2416.     }
  2417.  
  2418.     private RSNPC nearestNpc(final String[] npcss) {
  2419.         if (npcss == null)
  2420.             return null;
  2421.         RSNPC npc = npcs.getNearest(new Filter<RSNPC>() {
  2422.             public boolean accept(RSNPC t) {
  2423.                 for (int i = 0; i < npcss.length; i++) {
  2424.                     if ((multiway || !t.isInCombat()) && t.getName().toLowerCase().contains(npcss[i]) && inArea(t.getLocation()))
  2425.                         return true;
  2426.                 }
  2427.                 return false;
  2428.             }
  2429.         });
  2430.         if (npc != null)
  2431.             return npc;
  2432.         return null;
  2433.     }
  2434.  
  2435.     private RSNPC nearestNpc(final int[] npcss) {
  2436.         if (npcss == null)
  2437.             return null;
  2438.         RSNPC npc = npcs.getNearest(new Filter<RSNPC>() {
  2439.             public boolean accept(RSNPC t) {
  2440.                 for (int i = 0; i < npcss.length; i++) {
  2441.                     if ((multiway || !t.isInCombat()) && t.getID() == npcss[i] && inArea(t.getLocation()))
  2442.                         return true;
  2443.                 }
  2444.                 return false;
  2445.             }
  2446.         });
  2447.         if (npc != null)
  2448.             return npc;
  2449.         return null;
  2450.     }
  2451.  
  2452.     private RSNPC interactingNpc() {
  2453.         return npcs.getNearest(new Filter<RSNPC>() {
  2454.             public boolean accept(RSNPC n) {
  2455.                 if (n.getInteracting() == null) {
  2456.                     return false;
  2457.                 }
  2458.                 return n.getInteracting().equals(players.getMyPlayer());
  2459.             }
  2460.         });
  2461.     }
  2462.  
  2463.     private boolean onTile(final RSTile tile, final String action,
  2464.                            final double dx, final double dy, final int height) {
  2465.         Point checkScreen;
  2466.         try {
  2467.             checkScreen = calc.tileToScreen(tile, dx, dy, height);
  2468.             if (!calc.pointOnScreen(checkScreen)) {
  2469.                 if (calc.distanceTo(tile) <= 8) {
  2470.                     if (getMyPlayer().isMoving()) {
  2471.                         return false;
  2472.                     }
  2473.                     walking.walkTileMM(tile);
  2474.                     walking.sleep(1000);
  2475.                     return false;
  2476.                 }
  2477.                 return false;
  2478.             }
  2479.         } catch (final Exception e) {
  2480.         }
  2481.         try {
  2482.             boolean stop = false;
  2483.             for (int i = 0; i <= 50; i++) {
  2484.                 checkScreen = calc.tileToScreen(tile, dx, dy, height);
  2485.                 if (!calc.pointOnScreen(checkScreen)) {
  2486.                     return false;
  2487.                 }
  2488.                 mouse.move(checkScreen);
  2489.                 final Object[] menuItems = menu.getItems();
  2490.                 for (int a = 0; a < menuItems.length; a++) {
  2491.                     if (menuItems[a].toString().toLowerCase().contains(action.toLowerCase())) {
  2492.                         stop = true;
  2493.                         break;
  2494.                     }
  2495.                 }
  2496.                 if (stop) {
  2497.                     break;
  2498.                 }
  2499.             }
  2500.         } catch (final Exception e) {
  2501.         }
  2502.         try {
  2503.             return menu.doAction(action);
  2504.         } catch (final Exception e) {
  2505.         }
  2506.         return false;
  2507.     }
  2508.  
  2509.     private boolean onPoint(final Point point, final String action) {
  2510.         Point p = point;
  2511.         if (!calc.pointOnScreen(p))
  2512.             return false;
  2513.         try {
  2514.             boolean stop = false;
  2515.             for (int i = 0; i <= 50; i++) {
  2516.                 mouse.move(p);
  2517.                 final Object[] menuItems = menu.getItems();
  2518.                 for (int a = 0; a < menuItems.length; a++) {
  2519.                     if (menuItems[a].toString().toLowerCase().contains(action.toLowerCase())) {
  2520.                         stop = true;
  2521.                         break;
  2522.                     }
  2523.                 }
  2524.                 if (stop)
  2525.                     break;
  2526.             }
  2527.             return menu.doAction(action);
  2528.         } catch (final java.lang.Exception e) {
  2529.         }
  2530.         return false;
  2531.     }
  2532.  
  2533.     private RSComponent selectItem(final String[] item, final String disallow) {
  2534.         RSItem[] items = inventory.getItems();
  2535.         if (items == null)
  2536.             return null;
  2537.         for (final RSItem i : items) {
  2538.             for (final String s : item) {
  2539.                 if (i.getID() != -1 && i.getName().toLowerCase().contains(s) && !i.getName().toLowerCase().contains(disallow))
  2540.                     return i.getComponent();
  2541.             }
  2542.         }
  2543.         return null;
  2544.     }
  2545.  
  2546.     private RSComponent selectItem(final String... item) {
  2547.         RSItem[] items = inventory.getItems();
  2548.         if (items == null)
  2549.             return null;
  2550.         for (final RSItem i : items) {
  2551.             for (final String s : item) {
  2552.                 if (i.getID() != -1 && i.getName().toLowerCase().contains(s))
  2553.                     return i.getComponent();
  2554.             }
  2555.         }
  2556.         return null;
  2557.     }
  2558.  
  2559.     private RSComponent searchBank(final int... item) {
  2560.         if (!interfaces.getComponent(762).isValid())
  2561.             return null;
  2562.         for (int i = 0; i < 516; i++) {
  2563.             RSComponent c = interfaces.getComponent(762, 93).getComponent(i);
  2564.             if (c.getRelativeX() <= 0 || c.getAbsoluteY() > 320)
  2565.                 continue;
  2566.             for (final int x : item) {
  2567.                 if (c.getComponentID() == x)
  2568.                     return c;
  2569.             }
  2570.             if (c.getComponentID() == -1)
  2571.                 break;
  2572.         }
  2573.         return null;
  2574.     }
  2575.  
  2576.     private RSObject tileObjectCheck(RSTile tile, int obj) {
  2577.         RSObject[] objs = objects.getAllAt(tile);
  2578.         if (objs == null)
  2579.             return null;
  2580.         for (RSObject o : objs) {
  2581.             if (o.getID() == obj) {
  2582.                 return o;
  2583.             }
  2584.         }
  2585.         return null;
  2586.     }
  2587.  
  2588.     private void startRunning(final int energy) {
  2589.         if (nextRun < System.currentTimeMillis() && walking.getEnergy() >= energy && !walking.isRunEnabled()) {
  2590.             nextRun = System.currentTimeMillis() + 7000;
  2591.             runEnergy = random(40, 95);
  2592.             walking.setRun(true);
  2593.             sleep(random(400, 600));
  2594.         }
  2595.     }
  2596.  
  2597.     private boolean valid() {
  2598.         return game.isLoggedIn();
  2599.     }
  2600.  
  2601.     //-----------MOUSE LISTENER-----------\\
  2602.     public void mouseClicked(MouseEvent arg0) {
  2603.     }
  2604.  
  2605.     public void mouseEntered(MouseEvent arg0) {
  2606.     }
  2607.  
  2608.     public void mouseExited(MouseEvent arg0) {
  2609.     }
  2610.  
  2611.     public void mouseReleased(MouseEvent arg0) {
  2612.     }
  2613.  
  2614.     public void mousePressed(MouseEvent e) {
  2615.         Point p = e.getPoint();
  2616.  
  2617.         if (startPaint) {
  2618.             if (stage > 0 && stage < 9) {
  2619.                 if (setup.prev.contains(p)) {
  2620.                     if (stage == 6 && !doBanking)
  2621.                         stage -= 3;
  2622.                     else
  2623.                         stage--;
  2624.                 }
  2625.             }
  2626.             switch (stage) {
  2627.                 case 0:
  2628.                     if (new Rectangle(149, 361, 204, 28).contains(p))
  2629.                         stage = 1;
  2630.                     if (new Rectangle(156, 411, 188, 26).contains(p))
  2631.                         stage = 9;
  2632.                     break;
  2633.                 case 1:
  2634.                     if (guiDefine)
  2635.                         if (setup.next.contains(p)) {
  2636.                             stage++;
  2637.                             startLoc = getMyPlayer().getLocation();
  2638.                         }
  2639.                     if (new Rectangle(126, 389, 253, 28).contains(p)) {
  2640.                         if (!guiOpen) {
  2641.                             SwingUtilities.invokeLater(new Runnable() {
  2642.                                 public void run() {
  2643.                                     WhiteBearGUI gui = new WhiteBearGUI();
  2644.                                     gui.WhiteBearGUI.setVisible(true);
  2645.                                 }
  2646.                             }
  2647.                             );
  2648.                             guiOpen = true;
  2649.                         }
  2650.                     }
  2651.                     break;
  2652.                 case 2:
  2653.                     if (setup.next.contains(p))
  2654.                         stage++;
  2655.                     if (usePrayer) {
  2656.                         if (new Rectangle(291, 370, 38, 22).contains(p))
  2657.                             usePrayer = false;
  2658.                     } else {
  2659.                         if (new Rectangle(260, 370, 38, 22).contains(p))
  2660.                             usePrayer = true;
  2661.                     }
  2662.                     if (usePrayerPotion) {
  2663.                         if (new Rectangle(291, 401, 38, 22).contains(p))
  2664.                             usePrayerPotion = false;
  2665.                     } else {
  2666.                         if (new Rectangle(260, 401, 38, 22).contains(p))
  2667.                             usePrayerPotion = true;
  2668.                     }
  2669.                     if (usePrayerLogout) {
  2670.                         if (new Rectangle(291, 431, 38, 22).contains(p))
  2671.                             usePrayerLogout = false;
  2672.                     } else {
  2673.                         if (new Rectangle(260, 431, 38, 22).contains(p))
  2674.                             usePrayerLogout = true;
  2675.                     }
  2676.                     break;
  2677.                 case 3:
  2678.                     if (setup.next.contains(p)) {
  2679.                         safeSpot = getMyPlayer().getLocation();
  2680.                         if (doBanking) {
  2681.                             stage++;
  2682.                         } else {
  2683.                             stage += 3;
  2684.                         }
  2685.                     }
  2686.                     if (cabbage) {
  2687.                         if (new Rectangle(278, 427, 205, 21).contains(p))
  2688.                             cabbage = false;
  2689.                     } else {
  2690.                         if (new Rectangle(251, 428, 234, 21).contains(p))
  2691.                             cabbage = true;
  2692.                     }
  2693.                     break;
  2694.                 case 4:
  2695.                     if (pathRecord == 0) {
  2696.                         if (new Rectangle(86, 408, 59, 22).contains(p)) {
  2697.                             env.setUserInput(1 | 2);
  2698.                             banker.actionsList.clear();
  2699.                             Action a = new Action(getMyPlayer().getLocation(), game.getPlane());
  2700.                             banker.actionsList.add(a);
  2701.                             pathRecord = 1;
  2702.                         }
  2703.                     } else if (pathRecord == 1) {
  2704.                         if (new Rectangle(85, 406, 52, 22).contains(p)) {
  2705.                             env.setUserInput(2);
  2706.                             pathRecord = 2;
  2707.                             guiOpen2 = false;
  2708.                         }
  2709.                         if (new Rectangle(339, 428, 144, 20).contains(p)) {
  2710.                             if (!guiOpen2) {
  2711.                                 SwingUtilities.invokeLater(new Runnable() {
  2712.                                     public void run() {
  2713.                                         WhiteBearGUI2 gui2 = new WhiteBearGUI2();
  2714.                                         gui2.WhiteBearGUI.setVisible(true);
  2715.                                     }
  2716.                                 }
  2717.                                 );
  2718.                                 guiOpen2 = true;
  2719.                             }
  2720.                         }
  2721.                     } else {
  2722.                         if (setup.next.contains(p)) {
  2723.                             doBanking = true;
  2724.                             guiOpen2 = false;
  2725.                             stage++;
  2726.                         }
  2727.                         if (new Rectangle(85, 406, 52, 22).contains(p))
  2728.                             pathRecord = 0;
  2729.                     }
  2730.                     break;
  2731.                 case 5:
  2732.                     if (pathRecordBack == 0) {
  2733.                         if (new Rectangle(86, 408, 59, 22).contains(p)) {
  2734.                             env.setUserInput(1 | 2);
  2735.                             banker.actionsListReverse.clear();
  2736.                             Action aa = new Action(getMyPlayer().getLocation(), game.getPlane());
  2737.                             banker.actionsListReverse.add(aa);
  2738.                             pathRecordBack = 1;
  2739.                         }
  2740.                     } else if (pathRecordBack == 1) {
  2741.                         if (new Rectangle(85, 406, 52, 22).contains(p)) {
  2742.                             env.setUserInput(2);
  2743.                             pathRecordBack = 2;
  2744.                             guiOpen2 = false;
  2745.                         }
  2746.                         if (new Rectangle(339, 428, 144, 20).contains(p)) {
  2747.                             if (!guiOpen2) {
  2748.                                 SwingUtilities.invokeLater(new Runnable() {
  2749.                                     public void run() {
  2750.                                         WhiteBearGUI2 gui2 = new WhiteBearGUI2();
  2751.                                         gui2.WhiteBearGUI.setVisible(true);
  2752.                                     }
  2753.                                 }
  2754.                                 );
  2755.                                 guiOpen2 = true;
  2756.                             }
  2757.                         }
  2758.                     } else {
  2759.                         if (setup.next.contains(p)) {
  2760.                             guiOpen2 = false;
  2761.                             stage++;
  2762.                         }
  2763.                         if (new Rectangle(85, 406, 52, 22).contains(p))
  2764.                             pathRecordBack = 0;
  2765.                     }
  2766.                     break;
  2767.                 case 6:
  2768.                     if (setup.next.contains(p)) {
  2769.                         logoutLevel = skills.getCurrentLevel(logoutSkillsID[logoutSkill]);
  2770.                         stage++;
  2771.                     }
  2772.                     if (new Rectangle(183, 423, 12, 12).contains(p) && antibanAmt < 2)
  2773.                         antibanAmt++;
  2774.                     if (new Rectangle(88, 423, 12, 12).contains(p) && antibanAmt > 0)
  2775.                         antibanAmt--;
  2776.                     if (Bbreaking) {
  2777.                         if (new Rectangle(444, 423, 12, 12).contains(p) && breakAmt < 4)
  2778.                             breakAmt++;
  2779.                         if (new Rectangle(314, 423, 12, 12).contains(p) && breakAmt > 0)
  2780.                             breakAmt--;
  2781.                         if (new Rectangle(385, 376, 38, 22).contains(p))
  2782.                             Bbreaking = false;
  2783.                     } else {
  2784.                         if (new Rectangle(352, 376, 38, 22).contains(p))
  2785.                             Bbreaking = true;
  2786.                     }
  2787.                     if (chatResponder) {
  2788.                         if (new Rectangle(177, 376, 38, 22).contains(p))
  2789.                             chatResponder = false;
  2790.                     } else {
  2791.                         if (new Rectangle(144, 376, 38, 22).contains(p))
  2792.                             chatResponder = true;
  2793.                     }
  2794.                     break;
  2795.                 case 7:
  2796.                     if (new Rectangle(407, 423, 57, 19).contains(p)) {
  2797.                         stage++;
  2798.                         useLogout = false;
  2799.                     }
  2800.                     if (setup.next.contains(p)) {
  2801.                         stage++;
  2802.                         useLogout = true;
  2803.                     }
  2804.                     if (new Rectangle(426, 385, 12, 12).contains(p) && logoutLevel < 99)
  2805.                         logoutLevel++;
  2806.                     if (new Rectangle(364, 385, 12, 12).contains(p) && logoutLevel > skills.getCurrentLevel(logoutSkillsID[logoutSkill]))
  2807.                         logoutLevel--;
  2808.                     if (new Rectangle(230, 385, 12, 12).contains(p) && logoutSkill < 5) {
  2809.                         logoutSkill++;
  2810.                         logoutLevel = skills.getCurrentLevel(logoutSkillsID[logoutSkill]);
  2811.                     }
  2812.                     if (new Rectangle(118, 385, 12, 12).contains(p) && logoutSkill > 0) {
  2813.                         logoutSkill--;
  2814.                         logoutLevel = skills.getCurrentLevel(logoutSkillsID[logoutSkill]);
  2815.                     }
  2816.                     break;
  2817.                 case 8:
  2818.                     int i = 0;
  2819.                     if (new Rectangle(59, 371, 429, 15).contains(p))
  2820.                         i = 1;
  2821.                     if (new Rectangle(59, 386, 429, 15).contains(p))
  2822.                         i = 2;
  2823.                     if (new Rectangle(59, 401, 429, 15).contains(p))
  2824.                         i = 3;
  2825.                     if (new Rectangle(59, 416, 429, 15).contains(p))
  2826.                         i = 4;
  2827.                     if (new Rectangle(59, 431, 429, 15).contains(p))
  2828.                         i = 5;
  2829.                     if (new Rectangle(59, 371, 429, 75).contains(p)) {
  2830.  
  2831.                         // Saving profile
  2832.  
  2833.                         allLoots = null;
  2834.                         banker.actions = banker.actionsList.toArray(new Action[banker.actionsList.size()]);
  2835.                         banker.actionsReverse = banker.actionsListReverse.toArray(new Action[banker.actionsListReverse.size()]);
  2836.                         stage += 2;
  2837.                         if (buryBones)
  2838.                             allLoots = addElement("bones", allLoots);
  2839.                         Properties WBini = new Properties();
  2840.                         WBini.setProperty("LoadData", Integer.toString(loadData));
  2841.                         WBini.setProperty("MobNames", mobNames);
  2842.                         WBini.setProperty("EatFood", Boolean.toString(eatFood));
  2843.                         if (eatFood)
  2844.                             WBini.setProperty("FoodInt", Integer.toString(foodInt));
  2845.                         WBini.setProperty("Looting", Boolean.toString(looting));
  2846.                         if (looting)
  2847.                             WBini.setProperty("ItemNames", itemNames);
  2848.                         WBini.setProperty("BankType", Integer.toString(banker.bankType));
  2849.                         WBini.setProperty("FoodLimit", Integer.toString(banker.foodLimit));
  2850.                         WBini.setProperty("BankMode", Integer.toString(banker.bankMode));
  2851.                         WBini.setProperty("Priority", Integer.toString(priority));
  2852.                         WBini.setProperty("MinHealth", Integer.toString(minHealth));
  2853.                         WBini.setProperty("MaxDist", Integer.toString(maxDist));
  2854.                         WBini.setProperty("BreakAmt", Integer.toString(breakAmt));
  2855.                         WBini.setProperty("AntibanAmt", Integer.toString(antibanAmt));
  2856.                         WBini.setProperty("LogoutSkill", Integer.toString(logoutSkill));
  2857.                         WBini.setProperty("RandLength", Integer.toString(randLength));
  2858.                         WBini.setProperty("MidLength", Integer.toString(midLength));
  2859.                         WBini.setProperty("RandTime", Integer.toString(randTime));
  2860.                         WBini.setProperty("MidTime", Integer.toString(midTime));
  2861.                         WBini.setProperty("WithdrawFood", Boolean.toString(banker.withdrawFood));
  2862.                         WBini.setProperty("StayArea", Boolean.toString(stayArea));
  2863.                         WBini.setProperty("Ranging", Boolean.toString(ranging));
  2864.                         WBini.setProperty("Multiway", Boolean.toString(multiway));
  2865.                         WBini.setProperty("IdsInstead", Boolean.toString(idsInstead));
  2866.                         WBini.setProperty("buryBones", Boolean.toString(buryBones));
  2867.                         WBini.setProperty("Bbreaking", Boolean.toString(Bbreaking));
  2868.                         WBini.setProperty("doBanking", Boolean.toString(doBanking));
  2869.                         WBini.setProperty("ChatResponder", Boolean.toString(chatResponder));
  2870.                         WBini.setProperty("Cabbage", Boolean.toString(cabbage));
  2871.                         WBini.setProperty("UseBones", Boolean.toString(useBones));
  2872.                         WBini.setProperty("UseAlch", Boolean.toString(useAlch));
  2873.                         WBini.setProperty("UseLow", Boolean.toString(useLow));
  2874.                         WBini.setProperty("UseTabs", Boolean.toString(useTabs));
  2875.                         WBini.setProperty("UsePrayer", Boolean.toString(usePrayer));
  2876.                         WBini.setProperty("UsePrayerPotion", Boolean.toString(usePrayerPotion));
  2877.                         WBini.setProperty("UsePrayerLogout", Boolean.toString(usePrayerLogout));
  2878.                         WBini.setProperty("SafeSpotX", Integer.toString(safeSpot.getX()));
  2879.                         WBini.setProperty("SafeSpotY", Integer.toString(safeSpot.getY()));
  2880.                         WBini.setProperty("StartLocX", Integer.toString(startLoc.getX()));
  2881.                         WBini.setProperty("StartLocY", Integer.toString(startLoc.getY()));
  2882.                         if (doBanking) {
  2883.                             String t = "";
  2884.                             for (Action a : banker.actions) {
  2885.                                 if (t.length() > 0)
  2886.                                     t += "/";
  2887.                                 t += a.toString();
  2888.                             }
  2889.                             WBini.setProperty("PathToBank", t);
  2890.                             t = "";
  2891.                             for (Action a : banker.actionsReverse) {
  2892.                                 if (t.length() > 0)
  2893.                                     t += "/";
  2894.                                 t += a.toString();
  2895.                             }
  2896.                             WBini.setProperty("PathToMob", t);
  2897.                         }
  2898.                         try {
  2899.                             WBini.store(new FileWriter(new File(Configuration.Paths.getScriptCacheDirectory(),
  2900.                                     "WhiteBearAIOFighter" + i + ".ini")),
  2901.                                     "Profile Slot " + i + " of White Bear AIO Fighter (Version: " + Double.toString(properties.version()) + ")");
  2902.                         } catch (java.lang.Exception ioe) {
  2903.                             log.warning("[GUI] Error occurred when saving profile slot " + i + "!");
  2904.                         }
  2905.                     }
  2906.                     break;
  2907.                 case 9:
  2908.                     if (new Rectangle(446, 347, 46, 15).contains(p))
  2909.                         stage = 0;
  2910.                     int ii = 0;
  2911.                     if (new Rectangle(59, 371, 429, 15).contains(p) && !slots[0].contains("(Empty Slot)"))
  2912.                         ii = 1;
  2913.                     if (new Rectangle(59, 386, 429, 15).contains(p) && !slots[1].contains("(Empty Slot)"))
  2914.                         ii = 2;
  2915.                     if (new Rectangle(59, 401, 429, 15).contains(p) && !slots[2].contains("(Empty Slot)"))
  2916.                         ii = 3;
  2917.                     if (new Rectangle(59, 416, 429, 15).contains(p) && !slots[3].contains("(Empty Slot)"))
  2918.                         ii = 4;
  2919.                     if (new Rectangle(59, 431, 429, 15).contains(p) && !slots[4].contains("(Empty Slot)"))
  2920.                         ii = 5;
  2921.                     if (ii > 0) {
  2922.  
  2923.                         // Loading
  2924.  
  2925.                         Properties WBini = new Properties();
  2926.                         try {
  2927.                             WBini.load(new FileInputStream(new File(Configuration.Paths.getScriptCacheDirectory(), "WhiteBearAIOFighter" + ii + ".ini")));
  2928.                         } catch (java.lang.Exception ee) {
  2929.                             log.warning("[GUI] Error occurred when loading profile, logging out!");
  2930.                             log.info("[GUI] You should make a new profile instead.");
  2931.                             logOutR = true;
  2932.                         }
  2933.                         try {
  2934.                             int load = Integer.parseInt(WBini.getProperty("LoadData"));
  2935.                             if (load == loadData) {
  2936.                                 allLoots = null;
  2937.                                 mobNames = WBini.getProperty("MobNames");
  2938.                                 mobName = mobNames.split(",");
  2939.                                 eatFood = Boolean.parseBoolean(WBini.getProperty("EatFood"));
  2940.                                 if (eatFood) {
  2941.                                     foodInt = Integer.parseInt(WBini.getProperty("FoodInt"));
  2942.                                 }
  2943.                                 looting = Boolean.parseBoolean(WBini.getProperty("Looting"));
  2944.                                 if (looting) {
  2945.                                     itemNames = WBini.getProperty("ItemNames");
  2946.                                     String[] itemNamexz = itemNames.split(",");
  2947.                                     String[] names = new String[itemNamexz.length];
  2948.                                     for (int ic = 0; ic < itemNamexz.length; ic++) {
  2949.                                         names[ic] = itemNamexz[ic].trim();
  2950.                                     }
  2951.                                     userLoots = names;
  2952.                                 }
  2953.                                 banker.bankType = Integer.parseInt(WBini.getProperty("BankType"));
  2954.                                 banker.foodLimit = Integer.parseInt(WBini.getProperty("FoodLimit"));
  2955.                                 banker.bankMode = Integer.parseInt(WBini.getProperty("BankMode"));
  2956.                                 priority = Integer.parseInt(WBini.getProperty("Priority"));
  2957.                                 minHealth = Integer.parseInt(WBini.getProperty("MinHealth"));
  2958.                                 maxDist = Integer.parseInt(WBini.getProperty("MaxDist"));
  2959.                                 breakAmt = Integer.parseInt(WBini.getProperty("BreakAmt"));
  2960.                                 antibanAmt = Integer.parseInt(WBini.getProperty("AntibanAmt"));
  2961.                                 logoutSkill = Integer.parseInt(WBini.getProperty("LogoutSkill"));
  2962.                                 randLength = Integer.parseInt(WBini.getProperty("RandLength"));
  2963.                                 midLength = Integer.parseInt(WBini.getProperty("MidLength"));
  2964.                                 randTime = Integer.parseInt(WBini.getProperty("RandTime"));
  2965.                                 midTime = Integer.parseInt(WBini.getProperty("MidTime"));
  2966.                                 banker.withdrawFood = Boolean.parseBoolean(WBini.getProperty("WithdrawFood"));
  2967.                                 stayArea = Boolean.parseBoolean(WBini.getProperty("StayArea"));
  2968.                                 ranging = Boolean.parseBoolean(WBini.getProperty("Ranging"));
  2969.                                 buryBones = Boolean.parseBoolean(WBini.getProperty("BuryBones"));
  2970.                                 multiway = Boolean.parseBoolean(WBini.getProperty("Multiway"));
  2971.                                 idsInstead = Boolean.parseBoolean(WBini.getProperty("IdsInstead"));
  2972.                                 if (idsInstead) {
  2973.                                     int[] id = new int[mobName.length];
  2974.                                     for (int i1 = 0; i1 < mobName.length; i1++) {
  2975.                                         id[i1] = Integer.parseInt(mobName[i1]);
  2976.                                     }
  2977.                                     mobId = id;
  2978.                                 }
  2979.                                 if (buryBones)
  2980.                                     allLoots = addElement("bones", allLoots);
  2981.                                 Bbreaking = Boolean.parseBoolean(WBini.getProperty("Bbreaking"));
  2982.                                 doBanking = Boolean.parseBoolean(WBini.getProperty("doBanking"));
  2983.                                 chatResponder = Boolean.parseBoolean(WBini.getProperty("ChatResponder"));
  2984.                                 cabbage = Boolean.parseBoolean(WBini.getProperty("Cabbage"));
  2985.                                 useBones = Boolean.parseBoolean(WBini.getProperty("UseBones"));
  2986.                                 useAlch = Boolean.parseBoolean(WBini.getProperty("UseAlch"));
  2987.                                 useLow = Boolean.parseBoolean(WBini.getProperty("UseLow"));
  2988.                                 useTabs = Boolean.parseBoolean(WBini.getProperty("UseTabs"));
  2989.                                 usePrayer = Boolean.parseBoolean(WBini.getProperty("UsePrayer"));
  2990.                                 usePrayerPotion = Boolean.parseBoolean(WBini.getProperty("UsePrayerPotion"));
  2991.                                 usePrayerLogout = Boolean.parseBoolean(WBini.getProperty("UsePrayerLogout"));
  2992.                                 int sx = 0, sy = 0, px = 0, py = 0;
  2993.                                 sx = Integer.parseInt(WBini.getProperty("SafeSpotX"));
  2994.                                 sy = Integer.parseInt(WBini.getProperty("SafeSpotY"));
  2995.                                 px = Integer.parseInt(WBini.getProperty("StartLocX"));
  2996.                                 py = Integer.parseInt(WBini.getProperty("StartLocY"));
  2997.                                 safeSpot = new RSTile(sx, sy);
  2998.                                 startLoc = new RSTile(px, py);
  2999.                                 if (doBanking) {
  3000.                                     banker.actionsList.clear();
  3001.                                     String[] t = WBini.getProperty("PathToBank").split("/");
  3002.                                     for (int x = 0; x < t.length; x++) {
  3003.                                         String[] div = t[x].split(",");
  3004.                                         if (div != null) {
  3005.                                             if (div.length == 5) {
  3006.                                                 Action a = new Action(new RSTile(Integer.parseInt(div[0]), Integer.parseInt(div[1])),
  3007.                                                         Integer.parseInt(div[2]), Integer.parseInt(div[3]), Integer.parseInt(div[4]), "nil");
  3008.                                                 banker.actionsList.add(a);
  3009.                                             } else {
  3010.                                                 Action a = new Action(new RSTile(Integer.parseInt(div[0]), Integer.parseInt(div[1])),
  3011.                                                         Integer.parseInt(div[2]), Integer.parseInt(div[3]), Integer.parseInt(div[4]), div[5]);
  3012.                                                 banker.actionsList.add(a);
  3013.                                             }
  3014.                                         }
  3015.                                     }
  3016.                                     banker.actions = banker.actionsList.toArray(new Action[banker.actionsList.size()]);
  3017.                                     banker.actionsListReverse.clear();
  3018.                                     String[] t2 = WBini.getProperty("PathToMob").split("/");
  3019.                                     for (int x = 0; x < t.length; x++) {
  3020.                                         String[] div = t2[x].split(",");
  3021.                                         if (div != null) {
  3022.                                             if (div.length == 5) {
  3023.                                                 Action a = new Action(new RSTile(Integer.parseInt(div[0]), Integer.parseInt(div[1])),
  3024.                                                         Integer.parseInt(div[2]), Integer.parseInt(div[3]), Integer.parseInt(div[4]), "nil");
  3025.                                                 banker.actionsListReverse.add(a);
  3026.                                             } else {
  3027.                                                 Action a = new Action(new RSTile(Integer.parseInt(div[0]), Integer.parseInt(div[1])),
  3028.                                                         Integer.parseInt(div[2]), Integer.parseInt(div[3]), Integer.parseInt(div[4]), div[5]);
  3029.                                                 banker.actionsListReverse.add(a);
  3030.                                             }
  3031.                                         }
  3032.                                     }
  3033.                                     banker.actionsReverse = banker.actionsListReverse.toArray(new Action[banker.actionsListReverse.size()]);
  3034.                                 }
  3035.                             } else {
  3036.                                 log.warning("[GUI] This profile is not compatible with this version of the script.");
  3037.                                 log.info("[GUI] You should create a new profile instead.");
  3038.                                 stopScript();
  3039.                                 return;
  3040.                             }
  3041.                         } catch (Throwable ax) {
  3042.                             log.log(Level.SEVERE, "Error loading profile: ", ax);
  3043.                             log.warning("[GUI] Error occurred when loading profile, logging out!");
  3044.                             logOutR = true;
  3045.                         }
  3046.                         stage++;
  3047.                     }
  3048.                     break;
  3049.                 case 10:
  3050.                     if (new Rectangle(166, 404, 50, 20).contains(p)) {
  3051.                         stage++;
  3052.                         checkUpdate = true;
  3053.                     }
  3054.                     if (new Rectangle(247, 404, 50, 20).contains(p)) {
  3055.                         stage++;
  3056.                         checkUpdate = false;
  3057.                     }
  3058.                     break;
  3059.                 case 11:
  3060.                     break;
  3061.             }
  3062.         } else {
  3063.             if (game.getClientState() == 10) {
  3064.                 if (new Rectangle(481, 344, 15, 15).contains(p)) {
  3065.                     if (thePainter.showPaint)
  3066.                         thePainter.showPaint = false;
  3067.                     else
  3068.                         thePainter.showPaint = true;
  3069.                 }
  3070.                 if (thePainter.showPaint) {
  3071.                     if (new Rectangle(416, 443, 80, 15).contains(p)) {
  3072.                         if (totalMode)
  3073.                             totalMode = false;
  3074.                         else
  3075.                             totalMode = true;
  3076.                     }
  3077.                     if (!totalMode) {
  3078.                         if (new Rectangle(462, 352, 12, 12).contains(p)) {
  3079.                             if (thePainter.paintSkill < 6)
  3080.                                 thePainter.paintSkill++;
  3081.                             else
  3082.                                 thePainter.paintSkill = 0;
  3083.                         }
  3084.                         if (new Rectangle(16, 352, 12, 12).contains(p)) {
  3085.                             if (thePainter.paintSkill > 0)
  3086.                                 thePainter.paintSkill--;
  3087.                             else
  3088.                                 thePainter.paintSkill = 6;
  3089.                         }
  3090.                     }
  3091.                 }
  3092.             }
  3093.         }
  3094.     }
  3095.  
  3096.     private String[] addElement(String n, String[] oldArray) {
  3097.         if (oldArray == null) {
  3098.             return new String[]{n};
  3099.         }
  3100.         String[] newarray = new String[oldArray.length + 1];
  3101.         for (int i = 0; i < oldArray.length; i++) {
  3102.             newarray[i] = oldArray[i];
  3103.         }
  3104.         newarray[oldArray.length] = n;
  3105.         return newarray;
  3106.     }
  3107.  
  3108.     private int[] addElement(int n, int[] oldArray) {
  3109.         if (oldArray == null) {
  3110.             return new int[]{n};
  3111.         }
  3112.         int[] newarray = new int[oldArray.length + 1];
  3113.         for (int i = 0; i < oldArray.length; i++) {
  3114.             newarray[i] = oldArray[i];
  3115.         }
  3116.         newarray[oldArray.length] = n;
  3117.         return newarray;
  3118.     }
  3119.  
  3120.     //-----------CHAT RESPONDER-----------\\
  3121.     private class ChatResponder extends Thread {
  3122.         char[] quickChat = {'z', 'g', 'd', 'l', 'r', 'm', 'y'};
  3123.         int[] skillID = {0, 2, 1, 3, 4, 6, 5};
  3124.         long lastSaidHi = System.currentTimeMillis() - 110000, lastDenyBot = System.currentTimeMillis() - 110000;
  3125.         long nextModAlert = System.currentTimeMillis(), sayNo = System.currentTimeMillis();
  3126.         long[] lastSaidLevel = {System.currentTimeMillis() - 110000, System.currentTimeMillis() - 110000,
  3127.                 System.currentTimeMillis() - 110000, System.currentTimeMillis() - 110000, System.currentTimeMillis() - 110000, System.currentTimeMillis() - 110000};
  3128.         boolean run = true;
  3129.         boolean typing = false; //read by antiban (true = suppress antiban)
  3130.         boolean wait = false; //written by antiban (true = chat responder will wait)
  3131.         boolean pause = false; //true if look away from screen is active
  3132.  
  3133.         //Chat Responder Customization
  3134.         String[] skillName = {"atk", "str", "def", "hp", "ranged", "magic", "prayer"};
  3135.         String[] tradeRes = {"no thanks", "no thx", "nope", "im fine"};
  3136.         String[] greetingRes = {"hi!", "hi.", "hi", "hello", "hello!", "hello.", "hello..", "yo", "yo!", "yes?", "what", "what?", "hey!"};
  3137.         String[] botterRes = {"huh", "zzz", "...", "???", "?????", "what", "what?", "no", "nop", "nope"};
  3138.         String[][] match = {{"atk", "attac", "atttac", "attck"}, {"str", "stengt", "strengt"}, {"def", "defence", "defense"},
  3139.                 {"hitpoints", "hp", "const", "constitution"}, {"range", "rannge"}, {"magic", "mage"}, {"pray", "prray"}};
  3140.  
  3141.         public void run() {
  3142.             while (!thePainter.savedStats || getChatMessage() == null) {
  3143.                 sleepNE(200);
  3144.             }
  3145.             while (run) {
  3146.                 try {
  3147.                     if (game.getClientState() == 10 && !pause) {
  3148.                         if (useChatRes && tradeResponse) {
  3149.                             if (sayNo < System.currentTimeMillis()) {
  3150.                                 tradeResponse = false;
  3151.                                 int timeOut = random(110000, 130000);
  3152.                                 sayNo = System.currentTimeMillis() + timeOut;
  3153.                                 sleepNE(random(300, 700));
  3154.                                 String[] res = tradeRes;
  3155.                                 int rand = random(0, res.length);
  3156.                                 sendText(res[rand]);
  3157.                                 log("[Response] Said No to a Trade Request. Timeout: " + timeOut / 1000 + " sec");
  3158.                             }
  3159.                         }
  3160.                         String m = getChatMessage().toLowerCase();
  3161.                         if (m != null && !m.equals(lastMessage) && (m.contains(getMyPlayer().getName().toLowerCase() + ": <") != true)) {
  3162.                             if (useChatRes) {
  3163.                                 response(m);
  3164.                             } else {
  3165.                                 sleepNE(random(700, 850));
  3166.                             }
  3167.                             lastMessage = m;
  3168.                         } else {
  3169.                             sleepNE(random(600, 700));
  3170.                         }
  3171.                     } else {
  3172.                         sleepNE(random(300, 400));
  3173.                     }
  3174.                 } catch (java.lang.Throwable t) {
  3175.                 }
  3176.             }
  3177.         }
  3178.  
  3179.         private boolean findText(String t, String[] check) {
  3180.             String[] m = check;
  3181.             for (int i = 0; i < m.length; i++) {
  3182.                 if (t.contains(m[i])) {
  3183.                     return true;
  3184.                 }
  3185.             }
  3186.             return false;
  3187.         }
  3188.  
  3189.         private void response(String m) {
  3190.             for (int i = 0; i < 7; i++) {
  3191.                 if ((System.currentTimeMillis() - 150000) >= lastSaidLevel[i]) {
  3192.                     if (findText(m, match[i]) && findText(m, new String[]{"level", "levl", "lvel", "lvl"})) {
  3193.                         lastSaidLevel[i] = System.currentTimeMillis();
  3194.                         resCount++;
  3195.                         sleepNE(random(600, 2000));
  3196.                         final int random = random(1, 11);
  3197.                         if (random == 1) {
  3198.                             sendText(skillName[i] + " lvl " + skills.getCurrentLevel(skillID[i]));
  3199.                         } else if (random == 2) {
  3200.                             sendText("level: " + skills.getCurrentLevel(skillID[i]));
  3201.                         } else if (random == 3) {
  3202.                             sendText("" + skills.getCurrentLevel(skillID[i]));
  3203.                         } else if (random == 4) {
  3204.                             sendText("mines " + skills.getCurrentLevel(skillID[i]));
  3205.                         } else if (random == 5) {
  3206.                             sendText("lv " + skills.getCurrentLevel(skillID[i]));
  3207.                         } else if (random == 6) {
  3208.                             sendText(Integer.toString(skills.getCurrentLevel(skillID[i])));
  3209.                         } else if (random > 6) {
  3210.                             sleepNE(random(100, 200));
  3211.                             keyboard.sendKey((char) KeyEvent.VK_ENTER);
  3212.                             sleepNE(random(800, 1300));
  3213.                             keyboard.sendKey('S');
  3214.                             sleepNE(random(800, 1300));
  3215.                             keyboard.sendKey(quickChat[i]);
  3216.                             sleepNE(random(800, 1300));
  3217.                             keyboard.sendKey('2');
  3218.                         }
  3219.                         log("[Response] Answered to Level Question: '" + m + "'");
  3220.                         sleepNE(random(200, 300));
  3221.                         return;
  3222.                     }
  3223.                 }
  3224.             }
  3225.             if (findText(m, new String[]{"bottin", "botin", "botttin", "botter", "bottter", "boter", "bootin", "boottin", "booter", "bootter"})) {
  3226.                 if (m.contains("?") || m.contains(getMyPlayer().getName().toLowerCase()) || m.contains("!")) {
  3227.                     if ((System.currentTimeMillis() - 130000) >= lastDenyBot) {
  3228.                         lastDenyBot = System.currentTimeMillis();
  3229.                         resCount++;
  3230.                         sleepNE(random(600, 2000));
  3231.                         String[] bot = botterRes;
  3232.                         final int random3 = random(0, bot.length);
  3233.                         sendText(bot[random3]);
  3234.                         log("[Response] Answered to Botting Message: '" + m + "'");
  3235.                         sleepNE(random(150, 250));
  3236.                         return;
  3237.                     }
  3238.                 }
  3239.             }
  3240.             if (findText(m, new String[]{"hi ", "hello", "hi<", "hey", "hi!", "hi.", "yo!", "yo.", "yo<"})) {
  3241.                 if ((System.currentTimeMillis() - 130000) >= lastSaidHi) {
  3242.                     lastSaidHi = System.currentTimeMillis();
  3243.                     resCount++;
  3244.                     sleepNE(random(600, 1600));
  3245.                     String[] hi = greetingRes;
  3246.                     final int random2 = random(0, hi.length);
  3247.                     sendText(hi[random2]);
  3248.                     log("[Response] Answered to Greeting: '" + m + "'");
  3249.                     sleepNE(random(150, 250));
  3250.                     return;
  3251.                 }
  3252.             }
  3253.             sleepNE(random(650, 750));
  3254.         }
  3255.  
  3256.         private void sendText(final String text) {
  3257.             final char[] chs = text.toCharArray();
  3258.             typing = true;
  3259.             if (wait) {
  3260.                 for (int i = 0; i < 21; i++) {
  3261.                     sleepNE(10);
  3262.                     if (!wait) {
  3263.                         i = 21;
  3264.                     }
  3265.                 }
  3266.             }
  3267.             for (final char element : chs) {
  3268.                 keyboard.sendKey(element);
  3269.                 sleepNE(random(280, 550));
  3270.             }
  3271.             keyboard.sendKey((char) KeyEvent.VK_ENTER);
  3272.             typing = false;
  3273.         }
  3274.  
  3275.         private String getChatMessage() {
  3276.             try {
  3277.                 String text = null;
  3278.                 for (int x = 280; x >= 180; x--) {
  3279.                     if (interfaces.get(137).getComponent(x).getText() != null) {
  3280.                         if (interfaces.get(137).getComponent(x).getText().contains("<col=")) {
  3281.                             text = interfaces.get(137).getComponent(x).getText();
  3282.                             break;
  3283.                         }
  3284.                     }
  3285.                 }
  3286.                 return text;
  3287.             } catch (Exception e) {
  3288.             }
  3289.             return null;
  3290.         }
  3291.  
  3292.         private void sleepNE(int ms) {
  3293.             try {
  3294.                 Thread.sleep(ms);
  3295.             } catch (Exception e) {
  3296.             }
  3297.         }
  3298.     }
  3299.  
  3300.     //-----------------GUI----------------\\
  3301.     private class WhiteBearGUI {
  3302.         private static final long serialVersionUID = 1L;
  3303.  
  3304.         private WhiteBearGUI() {
  3305.             initComponents();
  3306.         }
  3307.  
  3308.         private void jRadioButton2ActionPerformed(ActionEvent e) {
  3309.             if (jRadioButton2.isSelected()) {
  3310.                 tbDistance.setEnabled(true);
  3311.             } else {
  3312.                 tbDistance.setEnabled(false);
  3313.             }
  3314.         }
  3315.  
  3316.         private void jRadioButton7ActionPerformed(ActionEvent e) {
  3317.             if (jRadioButton7.isSelected()) {
  3318.                 priorityCombo2.setEnabled(true);
  3319.                 jRadioButton8.setEnabled(true);
  3320.                 tbFoodAmt.setEnabled(true);
  3321.                 priorityCombo3.setEnabled(true);
  3322.             } else {
  3323.                 priorityCombo2.setEnabled(false);
  3324.                 jRadioButton8.setEnabled(false);
  3325.                 tbFoodAmt.setEnabled(false);
  3326.                 priorityCombo3.setEnabled(false);
  3327.             }
  3328.         }
  3329.  
  3330.         private void button1ActionPerformed(ActionEvent e) {
  3331.             multiway = jRadioButton.isSelected();
  3332.             idsInstead = jRadioButton1.isSelected();
  3333.             mobNames = tbMobNames.getText().toLowerCase();
  3334.             mobName = mobNames.split(",");
  3335.             if (idsInstead) {
  3336.                 int[] id = new int[mobName.length];
  3337.                 for (int i = 0; i < mobName.length; i++) {
  3338.                     try {
  3339.                         id[i] = Integer.parseInt(mobName[i].trim());
  3340.                     } catch (NumberFormatException nf) {
  3341.                         id[i] = 0;
  3342.                         log.severe("[GUI] Error when converting '" + mobName[i].trim() + "' to integer!");
  3343.                         return;
  3344.                     }
  3345.                 }
  3346.                 mobId = id;
  3347.             }
  3348.             itemNames = tbItemNames.getText().toLowerCase();
  3349.             priority = priorityCombo.getSelectedIndex();
  3350.             stayArea = jRadioButton2.isSelected();
  3351.             maxDist = Integer.parseInt(tbDistance.getText().trim());
  3352.             if (maxDist < 2)
  3353.                 maxDist = 2;
  3354.             if (maxDist > 15)
  3355.                 maxDist = 15;
  3356.  
  3357.             useAlch = jRadioButton5.isSelected();
  3358.             useLow = (alchemyCombo.getSelectedIndex() == 0);
  3359.             ranging = jRadioButton3.isSelected();
  3360.             useBones = jRadioButton6.isSelected();
  3361.             if (useBones) {
  3362.                 eatFood = true;
  3363.                 log.info("You are using Bones to Peaches, therefore Peaches will be added as a food.");
  3364.             }
  3365.             useTabs = (bonesCombo2.getSelectedIndex() == 0);
  3366.             buryBones = jRadioButton4.isSelected();
  3367.             doBanking = jRadioButton7.isSelected();
  3368.             banker.bankMode = priorityCombo2.getSelectedIndex();
  3369.             banker.foodLimit = Integer.parseInt(tbFoodAmt.getText().trim());
  3370.             if (banker.foodLimit < 3) {
  3371.                 banker.foodLimit = 3;
  3372.                 log.info("[GUI] Minimum Food Withdraw Amt is 3.");
  3373.             }
  3374.             if (banker.foodLimit > 28) {
  3375.                 banker.foodLimit = 28;
  3376.                 log.info("[GUI] Maximum Food Withdraw Amt is 28.");
  3377.             }
  3378.             banker.withdrawFood = jRadioButton8.isSelected();
  3379.  
  3380.             // Check if looting
  3381.             if (itemNames.length() <= 0)
  3382.                 looting = false;
  3383.             else {
  3384.                 String[] itemNamexz = itemNames.split(",");
  3385.                 String[] names = new String[itemNamexz.length];
  3386.                 for (int i = 0; i < itemNamexz.length; i++) {
  3387.                     names[i] = itemNamexz[i].trim();
  3388.                 }
  3389.                 userLoots = names;
  3390.             }
  3391.  
  3392.             // Check if eating
  3393.             if (tbFoodName.getText().length() > 0) {
  3394.                 foodInt = Integer.parseInt(tbFoodName.getText().trim());
  3395.                 eatFood = true;
  3396.             } else {
  3397.                 eatFood = false;
  3398.             }
  3399.             minHealth = Integer.parseInt(tbEatHealth.getText());
  3400.             banker.bankType = priorityCombo3.getSelectedIndex();
  3401.             guiOpen = false;
  3402.             guiDefine = true;
  3403.             WhiteBearGUI.dispose();
  3404.         }
  3405.  
  3406.         private void initComponents() {
  3407.             WhiteBearGUI = new JFrame();
  3408.             panel1 = new JPanel();
  3409.             tabbedPane1 = new JTabbedPane();
  3410.             panel6 = new JPanel();
  3411.             tbMobNames = new JFormattedTextField();
  3412.             label17 = new JLabel();
  3413.             jRadioButton = new JCheckBox();
  3414.             jRadioButton1 = new JCheckBox();
  3415.             jRadioButton2 = new JCheckBox();
  3416.             label23 = new JLabel();
  3417.             tbDistance = new JFormattedTextField();
  3418.             label7 = new JLabel();
  3419.             priorityCombo = new JComboBox();
  3420.             panel2 = new JPanel();
  3421.             jRadioButton5 = new JCheckBox();
  3422.             alchemyCombo = new JComboBox();
  3423.             label6 = new JLabel();
  3424.             label18 = new JLabel();
  3425.             tbItemNames = new JFormattedTextField();
  3426.             jRadioButton3 = new JCheckBox();
  3427.             jRadioButton4 = new JCheckBox();
  3428.             jRadioButton6 = new JCheckBox();
  3429.             bonesCombo2 = new JComboBox();
  3430.             panel7 = new JPanel();
  3431.             label20 = new JLabel();
  3432.             tbFoodName = new JFormattedTextField();
  3433.             label21 = new JLabel();
  3434.             tbEatHealth = new JFormattedTextField();
  3435.             jRadioButton7 = new JCheckBox();
  3436.             label8 = new JLabel();
  3437.             priorityCombo2 = new JComboBox();
  3438.             jRadioButton8 = new JCheckBox();
  3439.             tbFoodAmt = new JFormattedTextField();
  3440.             label9 = new JLabel();
  3441.             label10 = new JLabel();
  3442.             priorityCombo3 = new JComboBox();
  3443.             button1 = new JButton();
  3444.             label1 = new JLabel();
  3445.             label2 = new JLabel();
  3446.  
  3447.             //======== WhiteBearGUI ========
  3448.             {
  3449.                 WhiteBearGUI.setAlwaysOnTop(true);
  3450.                 WhiteBearGUI.setBackground(Color.black);
  3451.                 WhiteBearGUI.setResizable(false);
  3452.                 WhiteBearGUI.setMinimumSize(new Dimension(405, 265));
  3453.                 WhiteBearGUI.setTitle("White Bear AIO Fighter");
  3454.                 WhiteBearGUI.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
  3455.                 WhiteBearGUI.setFont(new Font("Century Gothic", Font.PLAIN, 12));
  3456.                 Container WhiteBearGUIContentPane = WhiteBearGUI.getContentPane();
  3457.                 WhiteBearGUIContentPane.setLayout(null);
  3458.  
  3459.                 //======== panel1 ========
  3460.                 {
  3461.                     panel1.setBackground(Color.black);
  3462.                     panel1.setForeground(Color.green);
  3463.                     panel1.setMinimumSize(new Dimension(100, 200));
  3464.                     panel1.setLayout(null);
  3465.  
  3466.                     //======== tabbedPane1 ========
  3467.                     {
  3468.                         tabbedPane1.setFont(new Font("Century Gothic", Font.PLAIN, 12));
  3469.                         tabbedPane1.setForeground(new Color(0, 153, 0));
  3470.  
  3471.                         //======== panel6 ========
  3472.                         {
  3473.                             panel6.setBackground(Color.black);
  3474.                             panel6.setLayout(null);
  3475.  
  3476.                             //---- tbMobNames ----
  3477.                             tbMobNames.setFont(new Font("Century Gothic", Font.PLAIN, 14));
  3478.                             tbMobNames.setForeground(new Color(255, 255, 204));
  3479.                             tbMobNames.setBackground(Color.gray);
  3480.                             tbMobNames.setText("green dragon,blue dragon");
  3481.                             panel6.add(tbMobNames);
  3482.                             tbMobNames.setBounds(102, 8, 275, 25);
  3483.  
  3484.                             //---- label17 ----
  3485.                             label17.setText("Mob Names:");
  3486.                             label17.setBackground(new Color(51, 51, 51));
  3487.                             label17.setForeground(new Color(255, 255, 102));
  3488.                             label17.setFont(new Font("Century Gothic", Font.BOLD, 14));
  3489.                             panel6.add(label17);
  3490.                             label17.setBounds(7, 8, 100, 20);
  3491.  
  3492.                             //---- jRadioButton ----
  3493.                             jRadioButton.setText("Multiway Combat");
  3494.                             jRadioButton.setBackground(Color.black);
  3495.                             jRadioButton.setForeground(Color.yellow);
  3496.                             jRadioButton.setFont(new Font("Century Gothic", Font.BOLD, 13));
  3497.                             panel6.add(jRadioButton);
  3498.                             jRadioButton.setBounds(99, 37, 140, 21);
  3499.  
  3500.                             //---- jRadioButton1 ----
  3501.                             jRadioButton1.setText("ID instead of Name");
  3502.                             jRadioButton1.setBackground(Color.black);
  3503.                             jRadioButton1.setForeground(Color.yellow);
  3504.                             jRadioButton1.setFont(new Font("Century Gothic", Font.BOLD, 13));
  3505.                             panel6.add(jRadioButton1);
  3506.                             jRadioButton1.setBounds(240, 37, 150, 21);
  3507.  
  3508.                             //---- jRadioButton2 ----
  3509.                             jRadioButton2.setText("Stay in Area");
  3510.                             jRadioButton2.setBackground(Color.black);
  3511.                             jRadioButton2.setForeground(Color.yellow);
  3512.                             jRadioButton2.setFont(new Font("Century Gothic", Font.BOLD, 13));
  3513.                             jRadioButton2.setSelected(true);
  3514.                             jRadioButton2.addActionListener(new ActionListener() {
  3515.                                 public void actionPerformed(ActionEvent e) {
  3516.                                     jRadioButton2ActionPerformed(e);
  3517.                                 }
  3518.                             });
  3519.                             panel6.add(jRadioButton2);
  3520.                             jRadioButton2.setBounds(8, 68, 112, 21);
  3521.  
  3522.                             //---- label23 ----
  3523.                             label23.setText("Max Distance:");
  3524.                             label23.setBackground(new Color(51, 51, 51));
  3525.                             label23.setForeground(new Color(255, 255, 102));
  3526.                             label23.setFont(new Font("Century Gothic", Font.BOLD, 14));
  3527.                             panel6.add(label23);
  3528.                             label23.setBounds(129, 68, 106, 20);
  3529.  
  3530.                             //---- tbDistance ----
  3531.                             tbDistance.setFont(new Font("Century Gothic", Font.PLAIN, 14));
  3532.                             tbDistance.setForeground(new Color(255, 255, 204));
  3533.                             tbDistance.setBackground(Color.gray);
  3534.                             tbDistance.setText("4");
  3535.                             panel6.add(tbDistance);
  3536.                             tbDistance.setBounds(237, 67, 53, 25);
  3537.  
  3538.                             //---- label7 ----
  3539.                             label7.setText("Priority:");
  3540.                             label7.setBackground(new Color(51, 51, 51));
  3541.                             label7.setForeground(new Color(255, 255, 102));
  3542.                             label7.setFont(new Font("Century Gothic", Font.BOLD, 14));
  3543.                             panel6.add(label7);
  3544.                             label7.setBounds(36, 103, 60, 20);
  3545.  
  3546.                             //---- priorityCombo ----
  3547.                             priorityCombo.setBackground(Color.black);
  3548.                             priorityCombo.setForeground(new Color(51, 51, 51));
  3549.                             priorityCombo.setBorder(null);
  3550.                             priorityCombo.setFont(new Font("Century Gothic", Font.BOLD, 12));
  3551.                             priorityCombo.setModel(new DefaultComboBoxModel(new String[]{
  3552.                                     "Normal",
  3553.                                     "Monsters",
  3554.                                     "Items"
  3555.                             }));
  3556.                             priorityCombo.setSelectedIndex(0);
  3557.                             panel6.add(priorityCombo);
  3558.                             priorityCombo.setBounds(102, 101, 115, 25);
  3559.  
  3560.                             { // compute preferred size
  3561.                                 Dimension preferredSize = new Dimension();
  3562.                                 for (int i = 0; i < panel6.getComponentCount(); i++) {
  3563.                                     Rectangle bounds = panel6.getComponent(i).getBounds();
  3564.                                     preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
  3565.                                     preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
  3566.                                 }
  3567.                                 Insets insets = panel6.getInsets();
  3568.                                 preferredSize.width += insets.right;
  3569.                                 preferredSize.height += insets.bottom;
  3570.                                 panel6.setMinimumSize(preferredSize);
  3571.                                 panel6.setPreferredSize(preferredSize);
  3572.                             }
  3573.                         }
  3574.                         tabbedPane1.addTab("Fighting", panel6);
  3575.  
  3576.  
  3577.                         //======== panel2 ========
  3578.                         {
  3579.                             panel2.setBackground(Color.black);
  3580.                             panel2.setLayout(null);
  3581.  
  3582.                             //---- jRadioButton5 ----
  3583.                             jRadioButton5.setText("Use");
  3584.                             jRadioButton5.setBackground(Color.black);
  3585.                             jRadioButton5.setForeground(Color.yellow);
  3586.                             jRadioButton5.setFont(new Font("Century Gothic", Font.BOLD, 13));
  3587.                             panel2.add(jRadioButton5);
  3588.                             jRadioButton5.setBounds(9, 48, 51, 21);
  3589.  
  3590.                             //---- alchemyCombo ----
  3591.                             alchemyCombo.setBackground(Color.black);
  3592.                             alchemyCombo.setForeground(new Color(51, 51, 51));
  3593.                             alchemyCombo.setBorder(null);
  3594.                             alchemyCombo.setFont(new Font("Century Gothic", Font.BOLD, 12));
  3595.                             alchemyCombo.setModel(new DefaultComboBoxModel(new String[]{
  3596.                                     "Low",
  3597.                                     "High"
  3598.                             }));
  3599.                             alchemyCombo.setSelectedIndex(0);
  3600.                             panel2.add(alchemyCombo);
  3601.                             alchemyCombo.setBounds(62, 46, 60, 25);
  3602.  
  3603.                             //---- label6 ----
  3604.                             label6.setText("Alchemy");
  3605.                             label6.setBackground(new Color(51, 51, 51));
  3606.                             label6.setForeground(Color.yellow);
  3607.                             label6.setFont(new Font("Century Gothic", Font.BOLD, 13));
  3608.                             panel2.add(label6);
  3609.                             label6.setBounds(133, 48, 70, 20);
  3610.  
  3611.                             //---- label18 ----
  3612.                             label18.setText("Item Names:");
  3613.                             label18.setBackground(new Color(51, 51, 51));
  3614.                             label18.setForeground(new Color(255, 255, 102));
  3615.                             label18.setFont(new Font("Century Gothic", Font.BOLD, 14));
  3616.                             panel2.add(label18);
  3617.                             label18.setBounds(8, 9, 72, 20);
  3618.  
  3619.                             //---- tbItemNames ----
  3620.                             tbItemNames.setFont(new Font("Century Gothic", Font.PLAIN, 14));
  3621.                             tbItemNames.setForeground(new Color(255, 255, 204));
  3622.                             tbItemNames.setBackground(Color.gray);
  3623.                             tbItemNames.setText("green dragon,blue dragon");
  3624.                             panel2.add(tbItemNames);
  3625.                             tbItemNames.setBounds(90, 8, 288, 25);
  3626.  
  3627.                             //---- jRadioButton3 ----
  3628.                             jRadioButton3.setText("Collect Arrows");
  3629.                             jRadioButton3.setBackground(Color.black);
  3630.                             jRadioButton3.setForeground(Color.yellow);
  3631.                             jRadioButton3.setFont(new Font("Century Gothic", Font.BOLD, 13));
  3632.                             panel2.add(jRadioButton3);
  3633.                             jRadioButton3.setBounds(256, 48, 120, 21);
  3634.  
  3635.                             //---- jRadioButton4 ----
  3636.                             jRadioButton4.setText("Bury Bones");
  3637.                             jRadioButton4.setBackground(Color.black);
  3638.                             jRadioButton4.setForeground(Color.yellow);
  3639.                             jRadioButton4.setFont(new Font("Century Gothic", Font.BOLD, 13));
  3640.                             panel2.add(jRadioButton4);
  3641.                             jRadioButton4.setBounds(256, 85, 108, 21);
  3642.  
  3643.                             //---- jRadioButton6 ----
  3644.                             jRadioButton6.setText("Use Bones to Peaches");
  3645.                             jRadioButton6.setBackground(Color.black);
  3646.                             jRadioButton6.setForeground(Color.yellow);
  3647.                             jRadioButton6.setFont(new Font("Century Gothic", Font.BOLD, 13));
  3648.                             panel2.add(jRadioButton6);
  3649.                             jRadioButton6.setBounds(9, 85, 165, 21);
  3650.  
  3651.                             //---- bonesCombo2 ----
  3652.                             bonesCombo2.setBackground(Color.black);
  3653.                             bonesCombo2.setForeground(new Color(51, 51, 51));
  3654.                             bonesCombo2.setBorder(null);
  3655.                             bonesCombo2.setFont(new Font("Century Gothic", Font.BOLD, 12));
  3656.                             bonesCombo2.setModel(new DefaultComboBoxModel(new String[]{
  3657.                                     "Tab",
  3658.                                     "Spell"
  3659.                             }));
  3660.                             bonesCombo2.setSelectedIndex(0);
  3661.                             panel2.add(bonesCombo2);
  3662.                             bonesCombo2.setBounds(174, 85, 60, 25);
  3663.  
  3664.                             { // compute preferred size
  3665.                                 Dimension preferredSize = new Dimension();
  3666.                                 for (int i = 0; i < panel2.getComponentCount(); i++) {
  3667.                                     Rectangle bounds = panel2.getComponent(i).getBounds();
  3668.                                     preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
  3669.                                     preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
  3670.                                 }
  3671.                                 Insets insets = panel2.getInsets();
  3672.                                 preferredSize.width += insets.right;
  3673.                                 preferredSize.height += insets.bottom;
  3674.                                 panel2.setMinimumSize(preferredSize);
  3675.                                 panel2.setPreferredSize(preferredSize);
  3676.                             }
  3677.                         }
  3678.                         tabbedPane1.addTab("Looting", panel2);
  3679.  
  3680.  
  3681.                         //======== panel7 ========
  3682.                         {
  3683.                             panel7.setBackground(Color.black);
  3684.                             panel7.setLayout(null);
  3685.  
  3686.                             //---- label20 ----
  3687.                             label20.setText("Food ID:");
  3688.                             label20.setBackground(new Color(51, 51, 51));
  3689.                             label20.setForeground(new Color(255, 255, 102));
  3690.                             label20.setFont(new Font("Century Gothic", Font.BOLD, 14));
  3691.                             panel7.add(label20);
  3692.                             label20.setBounds(9, 11, 67, 20);
  3693.  
  3694.                             //---- tbFoodName ----
  3695.                             tbFoodName.setFont(new Font("Century Gothic", Font.PLAIN, 14));
  3696.                             tbFoodName.setForeground(new Color(255, 255, 204));
  3697.                             tbFoodName.setBackground(Color.gray);
  3698.                             tbFoodName.setText("190");
  3699.                             panel7.add(tbFoodName);
  3700.                             tbFoodName.setBounds(81, 9, 54, 25);
  3701.  
  3702.                             //---- label21 ----
  3703.                             label21.setText("Eat when health is below");
  3704.                             label21.setBackground(new Color(51, 51, 51));
  3705.                             label21.setForeground(new Color(255, 255, 102));
  3706.                             label21.setFont(new Font("Century Gothic", Font.BOLD, 14));
  3707.                             panel7.add(label21);
  3708.                             label21.setBounds(146, 11, 173, 20);
  3709.  
  3710.                             //---- tbEatHealth ----
  3711.                             tbEatHealth.setFont(new Font("Century Gothic", Font.PLAIN, 14));
  3712.                             tbEatHealth.setForeground(new Color(255, 255, 204));
  3713.                             tbEatHealth.setBackground(Color.gray);
  3714.                             tbEatHealth.setText("100");
  3715.                             panel7.add(tbEatHealth);
  3716.                             tbEatHealth.setBounds(319, 9, 60, 25);
  3717.  
  3718.                             //---- jRadioButton7 ----
  3719.                             jRadioButton7.setText("Enable Banking");
  3720.                             jRadioButton7.setBackground(Color.black);
  3721.                             jRadioButton7.setForeground(Color.yellow);
  3722.                             jRadioButton7.setFont(new Font("Century Gothic", Font.BOLD, 13));
  3723.                             jRadioButton7.setSelected(true);
  3724.                             jRadioButton7.addActionListener(new ActionListener() {
  3725.                                 public void actionPerformed(ActionEvent e) {
  3726.                                     jRadioButton7ActionPerformed(e);
  3727.                                 }
  3728.                             });
  3729.                             panel7.add(jRadioButton7);
  3730.                             jRadioButton7.setBounds(10, 44, 130, 21);
  3731.  
  3732.                             //---- label8 ----
  3733.                             label8.setText("Bank Mode:");
  3734.                             label8.setBackground(new Color(51, 51, 51));
  3735.                             label8.setForeground(new Color(255, 255, 102));
  3736.                             label8.setFont(new Font("Century Gothic", Font.BOLD, 14));
  3737.                             panel7.add(label8);
  3738.                             label8.setBounds(24, 76, 90, 20);
  3739.  
  3740.                             //---- priorityCombo2 ----
  3741.                             priorityCombo2.setBackground(Color.black);
  3742.                             priorityCombo2.setForeground(new Color(51, 51, 51));
  3743.                             priorityCombo2.setBorder(null);
  3744.                             priorityCombo2.setFont(new Font("Century Gothic", Font.BOLD, 12));
  3745.                             priorityCombo2.setModel(new DefaultComboBoxModel(new String[]{
  3746.                                     "Banker",
  3747.                                     "Bank Booth",
  3748.                                     "Bank Chest"
  3749.                             }));
  3750.                             priorityCombo2.setSelectedIndex(0);
  3751.                             panel7.add(priorityCombo2);
  3752.                             priorityCombo2.setBounds(124, 74, 124, 25);
  3753.  
  3754.                             //---- jRadioButton8 ----
  3755.                             jRadioButton8.setText("Withdraw at most");
  3756.                             jRadioButton8.setBackground(Color.black);
  3757.                             jRadioButton8.setForeground(Color.yellow);
  3758.                             jRadioButton8.setFont(new Font("Century Gothic", Font.BOLD, 13));
  3759.                             panel7.add(jRadioButton8);
  3760.                             jRadioButton8.setBounds(24, 112, 140, 21);
  3761.  
  3762.                             //---- tbFoodAmt ----
  3763.                             tbFoodAmt.setFont(new Font("Century Gothic", Font.PLAIN, 14));
  3764.                             tbFoodAmt.setForeground(new Color(255, 255, 204));
  3765.                             tbFoodAmt.setBackground(Color.gray);
  3766.                             tbFoodAmt.setText("28");
  3767.                             panel7.add(tbFoodAmt);
  3768.                             tbFoodAmt.setBounds(165, 110, 40, 25);
  3769.  
  3770.                             //---- label9 ----
  3771.                             label9.setText("food");
  3772.                             label9.setBackground(new Color(51, 51, 51));
  3773.                             label9.setForeground(Color.yellow);
  3774.                             label9.setFont(new Font("Century Gothic", Font.BOLD, 13));
  3775.                             panel7.add(label9);
  3776.                             label9.setBounds(213, 112, 48, 20);
  3777.  
  3778.                             //---- label10 ----
  3779.                             label10.setText("Bank when:");
  3780.                             label10.setBackground(new Color(51, 51, 51));
  3781.                             label10.setForeground(new Color(255, 255, 102));
  3782.                             label10.setFont(new Font("Century Gothic", Font.BOLD, 14));
  3783.                             panel7.add(label10);
  3784.                             label10.setBounds(154, 44, 80, 20);
  3785.  
  3786.                             //---- priorityCombo3 ----
  3787.                             priorityCombo3.setBackground(Color.black);
  3788.                             priorityCombo3.setForeground(new Color(51, 51, 51));
  3789.                             priorityCombo3.setBorder(null);
  3790.                             priorityCombo3.setFont(new Font("Century Gothic", Font.BOLD, 12));
  3791.                             priorityCombo3.setModel(new DefaultComboBoxModel(new String[]{
  3792.                                     "Out of food",
  3793.                                     "Inventory Full"
  3794.                             }));
  3795.                             priorityCombo3.setSelectedIndex(0);
  3796.                             panel7.add(priorityCombo3);
  3797.                             priorityCombo3.setBounds(241, 43, 135, 25);
  3798.  
  3799.                             { // compute preferred size
  3800.                                 Dimension preferredSize = new Dimension();
  3801.                                 for (int i = 0; i < panel7.getComponentCount(); i++) {
  3802.                                     Rectangle bounds = panel7.getComponent(i).getBounds();
  3803.                                     preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
  3804.                                     preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
  3805.                                 }
  3806.                                 Insets insets = panel7.getInsets();
  3807.                                 preferredSize.width += insets.right;
  3808.                                 preferredSize.height += insets.bottom;
  3809.                                 panel7.setMinimumSize(preferredSize);
  3810.                                 panel7.setPreferredSize(preferredSize);
  3811.                             }
  3812.                         }
  3813.                         tabbedPane1.addTab("Others", panel7);
  3814.  
  3815.                     }
  3816.                     panel1.add(tabbedPane1);
  3817.                     tabbedPane1.setBounds(10, 47, 393, 178);
  3818.  
  3819.                     //---- button1 ----
  3820.                     button1.setText("Done Configuring");
  3821.                     button1.setBackground(Color.black);
  3822.                     button1.setFont(new Font("Century Gothic", Font.BOLD, 16));
  3823.                     button1.setForeground(new Color(0, 102, 51));
  3824.                     button1.addActionListener(new ActionListener() {
  3825.                         public void actionPerformed(ActionEvent e) {
  3826.                             button1ActionPerformed(e);
  3827.                         }
  3828.                     });
  3829.                     panel1.add(button1);
  3830.                     button1.setBounds(96, 233, 205, 35);
  3831.  
  3832.                     //---- label1 ----
  3833.                     label1.setText("White Bear AIO Fighter");
  3834.                     label1.setBackground(new Color(51, 51, 51));
  3835.                     label1.setForeground(new Color(153, 255, 153));
  3836.                     label1.setFont(new Font("Century Gothic", Font.BOLD, 22));
  3837.                     panel1.add(label1);
  3838.                     label1.setBounds(50, 6, 250, 40);
  3839.  
  3840.                     //---- label2 ----
  3841.                     label2.setText("Version: " + properties.version());
  3842.                     label2.setBackground(new Color(51, 51, 51));
  3843.                     label2.setForeground(new Color(204, 255, 0));
  3844.                     label2.setFont(new Font("Century Gothic", Font.PLAIN, 12));
  3845.                     panel1.add(label2);
  3846.                     label2.setBounds(300, 21, 83, 21);
  3847.  
  3848.                     { // compute preferred size
  3849.                         Dimension preferredSize = new Dimension();
  3850.                         for (int i = 0; i < panel1.getComponentCount(); i++) {
  3851.                             Rectangle bounds = panel1.getComponent(i).getBounds();
  3852.                             preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
  3853.                             preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
  3854.                         }
  3855.                         Insets insets = panel1.getInsets();
  3856.                         preferredSize.width += insets.right;
  3857.                         preferredSize.height += insets.bottom;
  3858.                         panel1.setMinimumSize(preferredSize);
  3859.                         panel1.setPreferredSize(preferredSize);
  3860.                     }
  3861.                 }
  3862.                 WhiteBearGUIContentPane.add(panel1);
  3863.                 panel1.setBounds(0, 0, 420, 295);
  3864.  
  3865.                 WhiteBearGUIContentPane.setPreferredSize(new Dimension(420, 305));
  3866.                 WhiteBearGUI.setSize(420, 305);
  3867.                 WhiteBearGUI.setLocationRelativeTo(WhiteBearGUI.getOwner());
  3868.             }
  3869.         }
  3870.  
  3871.         private JFrame WhiteBearGUI;
  3872.         private JPanel panel1;
  3873.         private JTabbedPane tabbedPane1;
  3874.         private JPanel panel6;
  3875.         private JFormattedTextField tbMobNames;
  3876.         private JLabel label17;
  3877.         private JCheckBox jRadioButton;
  3878.         private JCheckBox jRadioButton1;
  3879.         private JCheckBox jRadioButton2;
  3880.         private JLabel label23;
  3881.         private JFormattedTextField tbDistance;
  3882.         private JLabel label7;
  3883.         private JComboBox priorityCombo;
  3884.         private JPanel panel2;
  3885.         private JCheckBox jRadioButton5;
  3886.         private JComboBox alchemyCombo;
  3887.         private JLabel label6;
  3888.         private JLabel label18;
  3889.         private JFormattedTextField tbItemNames;
  3890.         private JCheckBox jRadioButton3;
  3891.         private JCheckBox jRadioButton4;
  3892.         private JCheckBox jRadioButton6;
  3893.         private JComboBox bonesCombo2;
  3894.         private JPanel panel7;
  3895.         private JLabel label20;
  3896.         private JFormattedTextField tbFoodName;
  3897.         private JLabel label21;
  3898.         private JFormattedTextField tbEatHealth;
  3899.         private JCheckBox jRadioButton7;
  3900.         private JLabel label8;
  3901.         private JComboBox priorityCombo2;
  3902.         private JCheckBox jRadioButton8;
  3903.         private JFormattedTextField tbFoodAmt;
  3904.         private JLabel label9;
  3905.         private JLabel label10;
  3906.         private JComboBox priorityCombo3;
  3907.         private JButton button1;
  3908.         private JLabel label1;
  3909.         private JLabel label2;
  3910.     }
  3911.  
  3912.     private class WhiteBearGUI2 {
  3913.         private static final long serialVersionUID = 1L;
  3914.  
  3915.         private WhiteBearGUI2() {
  3916.             initComponents();
  3917.         }
  3918.  
  3919.         private void button1ActionPerformed(ActionEvent e) {
  3920.             int x = Integer.parseInt(tbLocX.getText());
  3921.             int y = Integer.parseInt(tbLocY.getText());
  3922.             int obj = Integer.parseInt(tbObject.getText());
  3923.             int type = jComboBox.getSelectedIndex() + 1;
  3924.             String action = tbObject1.getText();
  3925.             if (calc.distanceTo(new RSTile(x, y)) > 1.1) {
  3926.                 log.severe("[Action] Your character must be standing right beside the object!");
  3927.                 return;
  3928.             } else {
  3929.                 Action a = new Action(new RSTile(x, y), type, game.getPlane(), obj, action);
  3930.                 if (stage == 4) {
  3931.                     if (pathRecord == 1) {
  3932.                         banker.actionsList.add(a);
  3933.                         log.info("[Action] Successfully added Action: " + a.toString());
  3934.                     } else {
  3935.                         log.severe("[Action] You have stopped recording path to bank!");
  3936.                     }
  3937.                 } else if (stage == 5) {
  3938.                     if (pathRecordBack == 1) {
  3939.                         banker.actionsListReverse.add(a);
  3940.                         log.info("[Action] Successfully added Action: " + a.toString());
  3941.                     } else {
  3942.                         log.severe("[Action] You have stopped recording path to monsters!");
  3943.                     }
  3944.                 } else {
  3945.                     log.severe("[Action] You are not on Stage 4 or 5 of setup!");
  3946.                 }
  3947.                 guiOpen2 = false;
  3948.                 WhiteBearGUI.dispose();
  3949.             }
  3950.         }
  3951.  
  3952.         private void jComboBoxItemStateChanged(ItemEvent e) {
  3953.             if (jComboBox.getSelectedIndex() == 2) {
  3954.                 label20.setText("Item ID:");
  3955.             } else {
  3956.                 label20.setText("Object ID:");
  3957.             }
  3958.         }
  3959.  
  3960.         private void initComponents() {
  3961.             label7 = new JLabel();
  3962.             label7.setFont(new Font("Century Gothic", Font.BOLD, 14));
  3963.             label7.setForeground(Color.green);
  3964.             label7.setText("O");
  3965.             label7.setLocation(new Point(253, 103));
  3966.             label7.setSize(new Dimension(14, 19));
  3967.             label7.setBackground(new Color(81, 81, 81));
  3968.             label7.addMouseListener(new java.awt.event.MouseAdapter() {
  3969.                 public void mousePressed(java.awt.event.MouseEvent e) {
  3970.                     RSTile loc = getMyPlayer().getLocation();
  3971.                     tbLocX.setText(Integer.toString(loc.getX()));
  3972.                     tbLocY.setText(Integer.toString(loc.getY()));
  3973.                 }
  3974.             });
  3975.             label6 = new JLabel();
  3976.             label6.setFont(new Font("Century Gothic", Font.BOLD, 14));
  3977.             label6.setForeground(Color.green);
  3978.             label6.setText("v");
  3979.             label6.setSize(new Dimension(10, 19));
  3980.             label6.setLocation(new Point(255, 122));
  3981.             label6.setBackground(new Color(81, 81, 81));
  3982.             label6.addMouseListener(new java.awt.event.MouseAdapter() {
  3983.                 public void mousePressed(java.awt.event.MouseEvent e) {
  3984.                     RSTile loc = getMyPlayer().getLocation();
  3985.                     tbLocX.setText(Integer.toString(loc.getX()));
  3986.                     tbLocY.setText(Integer.toString(loc.getY() - 1));
  3987.                 }
  3988.             });
  3989.             label5 = new JLabel();
  3990.             label5.setFont(new Font("Century Gothic", Font.BOLD, 14));
  3991.             label5.setForeground(Color.green);
  3992.             label5.setText("^");
  3993.             label5.setSize(new Dimension(10, 19));
  3994.             label5.setLocation(new Point(255, 85));
  3995.             label5.setBackground(new Color(81, 81, 81));
  3996.             label5.addMouseListener(new java.awt.event.MouseAdapter() {
  3997.                 public void mousePressed(java.awt.event.MouseEvent e) {
  3998.                     RSTile loc = getMyPlayer().getLocation();
  3999.                     tbLocX.setText(Integer.toString(loc.getX()));
  4000.                     tbLocY.setText(Integer.toString(loc.getY() + 1));
  4001.                 }
  4002.             });
  4003.             label4 = new JLabel();
  4004.             label4.setFont(new Font("Century Gothic", Font.BOLD, 14));
  4005.             label4.setForeground(Color.green);
  4006.             label4.setText(">");
  4007.             label4.setSize(new Dimension(10, 19));
  4008.             label4.setLocation(new Point(268, 103));
  4009.             label4.setBackground(new Color(81, 81, 81));
  4010.             label4.addMouseListener(new java.awt.event.MouseAdapter() {
  4011.                 public void mousePressed(java.awt.event.MouseEvent e) {
  4012.                     RSTile loc = getMyPlayer().getLocation();
  4013.                     tbLocX.setText(Integer.toString(loc.getX() + 1));
  4014.                     tbLocY.setText(Integer.toString(loc.getY()));
  4015.                 }
  4016.             });
  4017.             label3 = new JLabel();
  4018.             label3.setBounds(new Rectangle(239, 102, 11, 19));
  4019.             label3.setFont(new Font("Century Gothic", Font.BOLD, 14));
  4020.             label3.setForeground(Color.green);
  4021.             label3.setText("<");
  4022.             label3.setBackground(new Color(81, 81, 81));
  4023.             label3.addMouseListener(new java.awt.event.MouseAdapter() {
  4024.                 public void mousePressed(java.awt.event.MouseEvent e) {
  4025.                     RSTile loc = getMyPlayer().getLocation();
  4026.                     tbLocX.setText(Integer.toString(loc.getX() - 1));
  4027.                     tbLocY.setText(Integer.toString(loc.getY()));
  4028.                 }
  4029.             });
  4030.             label22 = new JLabel();
  4031.             label22.setBounds(new Rectangle(14, 175, 100, 19));
  4032.             label22.setFont(new Font("Century Gothic", Font.BOLD, 14));
  4033.             label22.setForeground(new Color(255, 255, 102));
  4034.             label22.setText("Action Name:");
  4035.             label22.setBackground(new Color(51, 51, 51));
  4036.             WhiteBearGUI = new JFrame();
  4037.             panel1 = new JPanel();
  4038.             button1 = new JButton();
  4039.             label1 = new JLabel();
  4040.             tbObject = new JFormattedTextField();
  4041.             label20 = new JLabel();
  4042.             label18 = new JLabel();
  4043.             tbLocX = new JFormattedTextField();
  4044.             label17 = new JLabel();
  4045.             label21 = new JLabel();
  4046.             tbLocY = new JFormattedTextField();
  4047.  
  4048.             //======== WhiteBearGUI ========
  4049.             {
  4050.                 WhiteBearGUI.setAlwaysOnTop(true);
  4051.                 WhiteBearGUI.setBackground(Color.black);
  4052.                 WhiteBearGUI.setPreferredSize(new Dimension(312, 293));
  4053.                 WhiteBearGUI.setResizable(false);
  4054.                 WhiteBearGUI.setMinimumSize(new Dimension(312, 265));
  4055.                 WhiteBearGUI.setTitle("White Bear AIO Fighter");
  4056.                 WhiteBearGUI.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
  4057.                 WhiteBearGUI.setFont(new Font("Century Gothic", Font.PLAIN, 12));
  4058.                 Container WhiteBearGUIContentPane = WhiteBearGUI.getContentPane();
  4059.                 WhiteBearGUIContentPane.setLayout(null);
  4060.  
  4061.                 //======== panel1 ========
  4062.                 {
  4063.                     panel1.setBackground(Color.black);
  4064.                     panel1.setForeground(Color.green);
  4065.                     panel1.setMinimumSize(new Dimension(100, 200));
  4066.                     panel1.setLayout(null);
  4067.  
  4068.                     //---- button1 ----
  4069.                     button1.setText("Add Action");
  4070.                     button1.setBounds(new Rectangle(59, 207, 205, 35));
  4071.                     button1.setBackground(Color.black);
  4072.                     button1.setFont(new Font("Century Gothic", Font.BOLD, 16));
  4073.                     button1.setForeground(new Color(0, 102, 51));
  4074.                     button1.addActionListener(new ActionListener() {
  4075.                         public void actionPerformed(ActionEvent e) {
  4076.                             button1ActionPerformed(e);
  4077.                         }
  4078.                     });
  4079.                     panel1.add(button1);
  4080.                     button1.setBounds(59, 202, 205, 35);
  4081.  
  4082.                     //---- label1 ----
  4083.                     label1.setText("White Bear AIO Fighter");
  4084.                     label1.setLocation(new Point(35, 7));
  4085.                     label1.setSize(new Dimension(250, 40));
  4086.                     label1.setBackground(new Color(51, 51, 51));
  4087.                     label1.setForeground(new Color(153, 255, 153));
  4088.                     label1.setFont(new Font("Century Gothic", Font.BOLD, 22));
  4089.                     panel1.add(label1);
  4090.  
  4091.                     //---- tbFoodName ----
  4092.                     tbObject.setFont(new Font("Century Gothic", Font.PLAIN, 14));
  4093.                     tbObject.setForeground(new Color(255, 255, 204));
  4094.                     tbObject.setBackground(Color.gray);
  4095.                     tbObject.setText("0");
  4096.                     panel1.add(tbObject);
  4097.                     tbObject.setBounds(108, 134, 64, 25);
  4098.  
  4099.                     //---- label20 ----
  4100.                     label20.setText("Object ID:");
  4101.                     label20.setBackground(new Color(51, 51, 51));
  4102.                     label20.setForeground(new Color(255, 255, 102));
  4103.                     label20.setFont(new Font("Century Gothic", Font.BOLD, 14));
  4104.                     panel1.add(label20);
  4105.                     label20.setBounds(13, 136, 79, 20);
  4106.  
  4107.                     //---- label18 ----
  4108.                     label18.setText("Location:  x:");
  4109.                     label18.setBackground(new Color(51, 51, 51));
  4110.                     label18.setForeground(new Color(255, 255, 102));
  4111.                     label18.setFont(new Font("Century Gothic", Font.BOLD, 14));
  4112.                     panel1.add(label18);
  4113.                     label18.setBounds(13, 100, 91, 20);
  4114.  
  4115.                     //---- tbLocX ----
  4116.                     tbLocX.setFont(new Font("Century Gothic", Font.PLAIN, 14));
  4117.                     tbLocX.setForeground(new Color(255, 255, 204));
  4118.                     tbLocX.setBackground(Color.gray);
  4119.                     tbLocX.setText("0");
  4120.                     panel1.add(tbLocX);
  4121.                     tbLocX.setBounds(103, 97, 49, 25);
  4122.  
  4123.                     //---- label17 ----
  4124.                     label17.setText("Action Type:");
  4125.                     label17.setBackground(new Color(51, 51, 51));
  4126.                     label17.setForeground(new Color(255, 255, 102));
  4127.                     label17.setFont(new Font("Century Gothic", Font.BOLD, 14));
  4128.                     panel1.add(label17);
  4129.                     label17.setBounds(14, 60, 100, 20);
  4130.  
  4131.                     //---- label21 ----
  4132.                     label21.setText("y:");
  4133.                     label21.setBackground(new Color(51, 51, 51));
  4134.                     label21.setForeground(new Color(255, 255, 102));
  4135.                     label21.setFont(new Font("Century Gothic", Font.BOLD, 14));
  4136.                     panel1.add(label21);
  4137.                     label21.setBounds(158, 100, 22, 20);
  4138.  
  4139.                     //---- tbLocY ----
  4140.                     tbLocY.setFont(new Font("Century Gothic", Font.PLAIN, 14));
  4141.                     tbLocY.setForeground(new Color(255, 255, 204));
  4142.                     tbLocY.setBackground(Color.gray);
  4143.                     tbLocY.setText("0");
  4144.                     panel1.add(tbLocY);
  4145.                     tbLocY.setBounds(179, 97, 51, 25);
  4146.  
  4147.                     //---- jComboBox ----
  4148.                     jComboBox = new JComboBox();
  4149.                     jComboBox.setBounds(new Rectangle(126, 58, 134, 25));
  4150.                     jComboBox.setMaximumRowCount(3);
  4151.                     jComboBox.setModel(new DefaultComboBoxModel(new String[]{
  4152.                             "Ladder/ Rope",
  4153.                             "Doors",
  4154.                             "Teleport Tab"
  4155.                     }));
  4156.                     jComboBox.setFont(new Font("Century Gothic", Font.PLAIN, 12));
  4157.                     jComboBox.addItemListener(new ItemListener() {
  4158.                         public void itemStateChanged(ItemEvent e) {
  4159.                             jComboBoxItemStateChanged(e);
  4160.                         }
  4161.                     });
  4162.  
  4163.                     { // compute preferred size
  4164.                         Dimension preferredSize = new Dimension();
  4165.                         for (int i = 0; i < panel1.getComponentCount(); i++) {
  4166.                             Rectangle bounds = panel1.getComponent(i).getBounds();
  4167.                             preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
  4168.                             preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
  4169.                         }
  4170.                         Insets insets = panel1.getInsets();
  4171.                         preferredSize.width += insets.right;
  4172.                         preferredSize.height += insets.bottom;
  4173.                         panel1.setMinimumSize(preferredSize);
  4174.                         panel1.setPreferredSize(preferredSize);
  4175.                     }
  4176.                 }
  4177.                 WhiteBearGUIContentPane.add(panel1);
  4178.                 panel1.setBounds(0, 0, 308, 242);
  4179.  
  4180.                 panel1.setBounds(new Rectangle(0, 0, 321, 251));
  4181.                 panel1.add(jComboBox, null);
  4182.                 panel1.add(label22, null);
  4183.                 panel1.add(getTbObject1(), null);
  4184.                 panel1.add(label3, null);
  4185.                 panel1.add(label4, null);
  4186.                 panel1.add(label5, null);
  4187.                 panel1.add(label6, null);
  4188.                 panel1.add(label7, null);
  4189.                 WhiteBearGUIContentPane.setPreferredSize(new Dimension(405, 265));
  4190.                 WhiteBearGUIContentPane.setSize(new Dimension(302, 237));
  4191.                 WhiteBearGUIContentPane.setSize(new Dimension(308, 237));
  4192.                 WhiteBearGUI.setSize(319, 265);
  4193.                 WhiteBearGUI.setLocationRelativeTo(WhiteBearGUI.getOwner());
  4194.             }
  4195.         }
  4196.  
  4197.         private JFrame WhiteBearGUI;
  4198.         private JPanel panel1;
  4199.         private JButton button1;
  4200.         private JLabel label1;
  4201.         private JFormattedTextField tbObject;
  4202.         private JLabel label20;
  4203.         private JLabel label18;
  4204.         private JFormattedTextField tbLocX;
  4205.         private JLabel label17;
  4206.         private JLabel label21;
  4207.         private JFormattedTextField tbLocY;
  4208.         private JComboBox jComboBox = null;
  4209.         private JLabel label22 = null;
  4210.         private JFormattedTextField tbObject1 = null;
  4211.         private JLabel label3 = null;
  4212.         private JLabel label4 = null;
  4213.         private JLabel label5 = null;
  4214.         private JLabel label6 = null;
  4215.         private JLabel label7 = null;
  4216.  
  4217.         private JFormattedTextField getTbObject1() {
  4218.             if (tbObject1 == null) {
  4219.                 tbObject1 = new JFormattedTextField();
  4220.                 tbObject1.setBounds(new Rectangle(122, 172, 140, 25));
  4221.                 tbObject1.setFont(new Font("Century Gothic", Font.PLAIN, 14));
  4222.                 tbObject1.setForeground(new Color(255, 255, 204));
  4223.                 tbObject1.setText("Climb-up Ladder");
  4224.                 tbObject1.setBackground(Color.gray);
  4225.             }
  4226.             return tbObject1;
  4227.         }
  4228.     }
  4229. }
Add Comment
Please, Sign In to add comment