Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @author White Bear
- * @copyright (C)2010-2011 White Bear
- * No one except White Bear has the right to modify this script!
- */
- import java.util.ArrayList;
- import java.util.Properties;
- import java.util.logging.Level;
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- import java.awt.geom.Rectangle2D;
- import java.io.BufferedReader;
- import java.io.File;
- import java.io.FileInputStream;
- import java.io.FileWriter;
- import java.io.InputStreamReader;
- import java.net.URL;
- import java.net.URLConnection;
- import java.text.NumberFormat;
- import java.text.DecimalFormat;
- import org.rsbot.event.events.MessageEvent;
- import org.rsbot.event.listeners.MessageListener;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.methods.*;
- import org.rsbot.script.util.Filter;
- import org.rsbot.script.wrappers.*;
- import org.rsbot.Configuration;
- @ScriptManifest(authors = {"WhiteBear"}, keywords = "All in One Fighter", name = "White Bear AIO Fighter", version = 0.993, description =
- "Fixed June 7, 2011", website = "http://whitebearrs.orgfree.com")
- public class WhiteBearAIOFighter extends Script implements PaintListener, MessageListener, MouseListener {
- //------------VARIABLES--------------\\
- final ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
- WhiteBearPaint thePainter = new WhiteBearPaint();
- StartupPaint setup = new StartupPaint();
- ChatResponder chatRes;
- Antiban antiban = new Antiban();
- Banker banker = new Banker();
- private static final int loadData = 6;
- private int runEnergy = random(50, 88), lvlAmt = 0, minMS = 4, maxMS = 6;
- private int exitStage = 0, camTurned = 0, resCount = 0;
- private int midTime = 90, randTime = 120, midLength = 10, randLength = 20, gainedEXP = 0;
- private static final int[] bones = {526, 532, 530, 528, 3183, 2859, 534, 3125, 4834, 14793, 4812, 3123, 4832, 6729, 536};
- private long stopTime = -1, nextBreak = System.currentTimeMillis(), nextLength = 60000;
- private long nextRun = System.currentTimeMillis();
- private boolean unactivated = true, foundType = false, breakLogout = false, tradeResponse = false, useChatRes = true;
- private boolean useBreaking = false, randomBreaking = false, currentlyBreaking = false, logOutR = false;
- private String totalTime = "00:00:00", status = "Loading...", lastMessage = null;
- private int stage = 0, maxDist = 5, minHealth = 100, logoutLevel = -1, breakAmt = 2, logoutSkill = 0, pathRecord = 0;
- private int pathRecordBack = 0, antibanAmt = 1, foodInt = 9999, arrowInt = 9999, priority = 0;
- private int[] logoutSkillsID = {0, 2, 1, 3, 4, 6}, area = {0, 0, 0, 0}, changedSkills = {}, mobId;
- private boolean guiDefine = false, stayArea = true, ranging = false, buryBones = false, Bbreaking = false, useLogout = false, eatFood = true;
- private boolean startPaint = true, doBanking = true, chatResponder = true, cabbage = false, checkUpdate = false, guiOpen = false;
- private boolean useBones = false, useAlch = false, useTabs = false, useLow = true, usePrayer = false, usePrayerPotion = false, usePrayerLogout = true;
- private boolean looting = true, rangeEquip = false, multiway = false, idsInstead = false, guiOpen2 = false, onlyLoot = false, totalMode = false;
- private long underAttack = System.currentTimeMillis() - 100000;
- private String mobNames = "", itemNames = "", arrowName = "";
- private String[] mobName, allLoots, breakAmts = {"Very Common", "Common", "Average", "Rare", "Very Rare"}, userLoots; // user specified loots
- private static String[] logoutSkills = {"Attack", "Strength", "Defence", "Constitution", "Ranged", "Magic"}, antibanAmts = {"Low", "Average", "High"};
- private static String[] step = {"GUI Settings", "Prayer Settings", "Safe Spot", "Banking", "Returning", "Antiban", "Logout", "Save Profile"};
- private String[] slots = {"(Empty Slot)", "(Empty Slot)", "(Empty Slot)", "(Empty Slot)", "(Empty Slot)"};
- private RSTile safeSpot, startLoc;
- private enum State {Antiban, InBattle, Fight, Loot, Eat, Alch, Full, Bury, Peaches, Bank, Range, OnPrayer, OffPrayer, PrayerPotion, DropVial, NoPot}
- //------------MAIN LOOP--------------\\
- public int loop() {
- try {
- mouse.setSpeed(random(minMS, maxMS));
- if (game.getClientState() != 10) {
- interfaces.getComponent(976, 6).doClick();
- env.enableRandom("Login");
- return random(50, 100);
- }
- env.disableRandom("Login");
- if (startPaint && stage == 11) {
- if (unactivated)
- activate();
- else
- startPaint = false;
- }
- if (startPaint)
- return 400;
- if (logOutR) {
- doLogOut(false, true);
- return 1000;
- }
- if (useLogout) {
- if (skills.getCurrentLevel(logoutSkillsID[logoutSkill]) >= logoutLevel) {
- log("Logging out because we have reached the target level.");
- logOutR = true;
- return 100;
- }
- }
- if (stopTime > 0 && System.currentTimeMillis() > stopTime) {
- log("Stop Time Reached. Logging off in 5 seconds.");
- sleep(random(4950, 5600));
- doLogOut(false, true);
- }
- if (antiban.breakingCheck() && useBreaking) {
- long endTime = System.currentTimeMillis() + nextLength;
- currentlyBreaking = true;
- if (breakLogout) {
- doLogOut(true, false);
- }
- log("Taking a break for " + thePainter.formatTime((int) nextLength));
- while (System.currentTimeMillis() < endTime && currentlyBreaking == true) {
- sleep(1000);
- }
- currentlyBreaking = false;
- antiban.breakingNew();
- return 10;
- }
- if (!thePainter.savedStats) {
- camera.setPitch(true);
- thePainter.saveStats();
- return 100;
- }
- // interface checks
- interfaces.getComponent(741, 9).doClick();
- interfaces.getComponent(620, 18).doClick();
- interfaces.getComponent(109, 13).doClick();
- interfaces.getComponent(335, 19).doClick();
- try {
- RSPlayer modC = antiban.getNearbyMod();
- if (modC != null) {
- if (System.currentTimeMillis() < chatRes.nextModAlert) {
- chatRes.nextModAlert += 150000;
- log.warning("[MOD] There is a Moderator nearby! Name: " + modC.getName());
- }
- }
- } catch (Exception e) {
- }
- startRunning(runEnergy);
- return doAction();
- } catch (java.lang.Throwable t) {
- return 100;
- }
- }
- private int doAction() {
- State s;
- if (priority == 1) {
- s = getStateMob();
- } else if (priority == 2 && (looting || buryBones || ranging)) {
- s = getStateItem();
- } else {
- s = getState();
- }
- switch (s) {
- case InBattle:
- RSNPC mobbie = interactingNpc();
- if (mobbie != null) {
- mouse.move(mobbie.getModel().getPoint());
- onPoint(mobbie.getModel().getPoint(), "Attack");
- sleep(random(500, 700));
- int mm = 0;
- while (valid() && mm < 21 && getMyPlayer().isMoving()) {
- mm++;
- sleep(50);
- }
- } else {
- sleep(random(800, 1100));
- }
- return random(300, 500);
- case Fight:
- RSNPC mob = idsInstead ? nearestNpc(mobId) : nearestNpc(mobName);
- if (mob != null) {
- int m = 0;
- if (!calc.pointOnScreen(calc.tileToScreen(mob.getLocation(), 0.5, 0.5, 0))) {
- walking.walkTileMM(mob.getLocation());
- sleep(random(500, 700));
- while (valid() && m < 21 && getMyPlayer().isMoving()) {
- m++;
- sleep(50);
- if (calc.pointOnScreen(calc.tileToScreen(mob.getLocation(), 0.5, 0.5, 0)))
- return 10;
- }
- } else {
- mouse.move(mob.getModel().getPoint());
- onPoint(mob.getModel().getPoint(), "Attack");
- sleep(random(500, 700));
- while (valid() && m < 21 && getMyPlayer().isMoving()) {
- m++;
- sleep(50);
- }
- }
- } else
- return 10;
- return random(300, 500);
- case Loot:
- return loot();
- case Eat:
- RSItem food = inventory.getItem(new int[]{foodInt, 6883});
- if (eatFood && food != null) {
- int hp = Integer.parseInt(interfaces.getComponent(748, 8).getText());
- if (food.doAction("Eat")) {
- int m = 0;
- while (valid() && m < 31) {
- m++;
- sleep(50);
- if (Integer.parseInt(interfaces.getComponent(748, 8).getText()) > hp + 2)
- break;
- }
- RSCharacter intx = getMyPlayer().getInteracting();
- if (intx != null) {
- mouse.move(intx.getModel().getPoint());
- if (onPoint(intx.getModel().getPoint(), "Attack")) {
- sleep(random(300, 500));
- }
- }
- RSNPC int_ = interactingNpc();
- if (int_ != null) {
- mouse.move(int_.getModel().getPoint());
- if (onPoint(int_.getModel().getPoint(), "Attack")) {
- sleep(random(300, 500));
- }
- }
- } else {
- sleep(1000);
- }
- } else {
- if (eatFood && doBanking && banker.withdrawFood) {
- if (banker.bankType == 0) {
- onlyLoot = true;
- } else {
- banker.bankingReason = 0;
- banker.banking = true;
- camera.setPitch(true);
- }
- return 100;
- }
- if (cabbage) {
- if (calc.distanceTo(new RSTile(3054, 3289)) > 8) {
- // An extra check, just in case
- RSItem foodTest = inventory.getItem(new int[]{foodInt, 6883});
- if (eatFood && foodTest != null) {
- return 100;
- }
- if (!equipment.getItem(Equipment.RING).doAction("Cabbage-port")) {
- sleep(random(400, 600));
- if (!equipment.getItem(Equipment.RING).doAction("Cabbage-port")) {
- sleep(random(400, 600));
- if (!equipment.getItem(Equipment.RING).doAction("Cabbage-port")) {
- sleep(random(400, 600));
- if (!equipment.getItem(Equipment.RING).doAction("Cabbage-port")) {
- log.warning("Unable to teleport to cabbage patch!");
- log.warning("Logging out because we have run out of food!");
- logOutR = true;
- }
- }
- }
- }
- sleep(random(700, 800));
- int f = 0;
- while (valid() && calc.distanceTo(new RSTile(3054, 3289)) > 8 && f < 61) {
- sleep(50);
- f++;
- }
- log.warning("Logging out because we have run out of food!");
- logOutR = true;
- } else {
- log.warning("Logging out because we have run out of food!");
- logOutR = true;
- }
- } else {
- if (calc.distanceTo(safeSpot) > 2) {
- walking.walkTileMM(walking.getClosestTileOnMap(safeSpot));
- sleep(random(700, 800));
- int f = 0;
- while (valid() && getMyPlayer().isMoving() && calc.distanceTo(walking.getDestination()) > 0 && f < 51) {
- sleep(50);
- f++;
- }
- if (calc.distanceTo(safeSpot) < 2) {
- log.warning("Logging out because we have run out of food!");
- logOutR = true;
- }
- } else {
- log.warning("Logging out because we have run out of food!");
- logOutR = true;
- }
- }
- }
- return random(300, 500);
- case Alch:
- magic.castSpell(useLow ? Magic.SPELL_LOW_LEVEL_ALCHEMY : Magic.SPELL_HIGH_LEVEL_ALCHEMY);
- int m2 = 0;
- while (valid() && m2 < 21) {
- m2++;
- sleep(50);
- if (game.getCurrentTab() == Game.TAB_INVENTORY)
- break;
- }
- RSComponent item = selectItem(userLoots);
- if (item != null)
- item.doAction("Cast");
- sleep(500);
- int maxA = 0;
- while (valid() && game.getCurrentTab() != 7 && maxA <= 23) {
- maxA += 1;
- sleep(random(99, 102));
- }
- RSNPC mob1 = idsInstead ? nearestNpc(mobId) : nearestNpc(mobName);
- if (mob1 == null)
- magic.castSpell(useLow ? Magic.SPELL_LOW_LEVEL_ALCHEMY : Magic.SPELL_HIGH_LEVEL_ALCHEMY);
- return random(100, 200);
- case Full:
- if (doBanking) {
- if (eatFood) {
- game.openTab(Game.TAB_INVENTORY);
- int amt = countLoots();
- if (amt > 4) {
- banker.banking = true;
- banker.bankingReason = 1;
- camera.setPitch(true);
- log.info("Going to Bank, reason: Inventory Full");
- }
- } else {
- banker.banking = true;
- banker.bankingReason = 1;
- camera.setPitch(true);
- log.info("Going to Bank, reason: Inventory Full");
- }
- } else {
- log.warning("Inventory is full! Logging out!");
- logOutR = true;
- return random(300, 500);
- }
- case Bury:
- int count = 0, rand = random(3, 6);
- for (int i = 0; i < 28; i++) {
- int c = interfaces.getComponent(149, 0).getComponent(i).getComponentID();
- for (int x : bones) {
- if (c == x)
- if (interfaces.getComponent(149, 0).getComponent(i).doAction("Bury")) {
- count++;
- sleep(random(300, 500));
- }
- }
- RSNPC mob2 = idsInstead ? nearestNpc(mobId) : nearestNpc(mobName);
- if (mob2 != null && count >= rand)
- return random(100, 200);
- if (!valid())
- break;
- }
- return random(300, 500);
- case Peaches:
- if (useTabs) {
- RSItem i = inventory.getItem(8015);
- if (i != null) {
- i.doAction("Break");
- sleep(random(500, 700));
- int m = 0;
- while (valid() && m < 21 && getMyPlayer().getAnimation() != -1) {
- m++;
- sleep(50);
- }
- } else {
- log.warning("Could not find Bones to Peaches Tabs!");
- useBones = false;
- return 100;
- }
- } else {
- magic.castSpell(Magic.SPELL_BONES_TO_PEACHES);
- if (!magic.castSpell(Magic.SPELL_BONES_TO_PEACHES))
- magic.castSpell(Magic.SPELL_BONES_TO_PEACHES);
- sleep(random(300, 500));
- }
- return random(300, 500);
- case Bank:
- int foodCount = inventory.getCount(new int[]{foodInt, 6883});
- if (((banker.bankType == 0) ? foodCount >= 3 : !inventory.isFull()) && inArea(getMyPlayer().getLocation())) {
- banker.banking = false;
- return random(300, 500);
- }
- if ((banker.bankType == 0) ? foodCount < 3 : inventory.isFull()) {
- if (banker.actions[banker.actions.length - 1].distance() > 3) {
- status = "Walking to Bank";
- Action a = getNextAction(false);
- if (a != null) {
- a.doAction();
- }
- } else {
- status = "Banking";
- banker.doBank();
- }
- } else {
- status = "Walking Back";
- Action a = getNextAction(true);
- if (a != null) {
- a.doAction();
- }
- }
- return random(300, 500);
- case Range:
- if (ranging) {
- RSComponent arrow = selectItem(new String[]{arrowName});
- if (arrow != null) {
- if (arrow.doAction("Wield")) {
- rangeEquip = false;
- sleep(random(500, 800));
- return random(50, 100);
- }
- } else {
- log.warning("Out of arrows, logging out!");
- logOutR = true;
- }
- } else {
- log.warning("Out of arrows, logging out!");
- logOutR = true;
- }
- return random(300, 500);
- case OnPrayer:
- if (interfaces.getComponent(749, 2).getBackgroundColor() == 1209) {
- interfaces.getComponent(749, 1).doAction("Turn quick prayers on");
- for (int i = 0; i < 21; i++) {
- if (interfaces.getComponent(749, 2).getBackgroundColor() != 1209)
- break;
- sleep(50);
- }
- }
- return random(300, 500);
- case OffPrayer:
- if (interfaces.getComponent(749, 2).getBackgroundColor() != 1209) {
- interfaces.getComponent(749, 1).doAction("Turn prayers off");
- for (int i = 0; i < 21; i++) {
- if (interfaces.getComponent(749, 2).getBackgroundColor() == 1209)
- break;
- sleep(50);
- }
- }
- return random(300, 500);
- case PrayerPotion:
- RSItem pp = inventory.getItem(new int[]{2434, 139, 141, 143, 11465, 11467});
- if (pp != null) {
- int prayer = Integer.parseInt(interfaces.getComponent(749, 4).getText().trim());
- pp.doAction("Drink");
- for (int i = 0; i < 26; i++) {
- sleep(50);
- if (Integer.parseInt(interfaces.getComponent(749, 4).getText().trim()) != prayer) {
- break;
- }
- }
- }
- return random(300, 500);
- case NoPot:
- log.warning("No more prayer potions! Logging out!");
- logOutR = true;
- return random(300, 500);
- case DropVial:
- RSItem v = inventory.getItem(229);
- if (v != null) {
- v.doAction("Drop");
- sleep(random(400, 600));
- }
- return random(300, 500);
- case Antiban:
- if (!antiban.lookAway())
- antiban.main(true);
- return random(48, 55);
- }
- return 100;
- }
- private State getState() {
- if (onlyLoot) {
- status = "Looting";
- return State.Loot;
- }
- if (banker.banking)
- return State.Bank;
- if (rangeEquip) {
- status = "Equip Arrows";
- return State.Range;
- }
- if (underAttack + 1000 > System.currentTimeMillis()) {
- status = "Under Attack!";
- return State.InBattle;
- }
- if (inCombat()) {
- if (eatFood && Integer.parseInt(interfaces.getComponent(748, 8).getText()) < minHealth) {
- RSItem food = inventory.getItem(new int[]{foodInt, 6883});
- if (food == null && useBones) {
- status = "Bones to Peaches";
- return State.Peaches;
- }
- status = "Eating";
- return State.Eat;
- } else {
- status = "Antiban";
- return State.Antiban;
- }
- } else {
- if (eatFood && Integer.parseInt(interfaces.getComponent(748, 8).getText()) < minHealth) {
- RSItem food = inventory.getItem(new int[]{foodInt, 6883});
- if (food == null && useBones) {
- status = "Bones to Peaches";
- return State.Peaches;
- }
- status = "Eating";
- return State.Eat;
- }
- RSNPC mob = idsInstead ? nearestNpc(mobId) : nearestNpc(mobName);
- if (mob != null) {
- if (calc.distanceTo(mob.getLocation()) < 3) {
- int prayer = Integer.parseInt(interfaces.getComponent(749, 4).getText().trim());
- double percent = (double) prayer / (double) skills.getRealLevel(Skills.PRAYER);
- if (usePrayer) {
- if (usePrayerPotion && percent <= 0.33) {
- if (inventory.getItem(new int[]{2434, 139, 141, 143, 11465, 11467}) != null) {
- status = "Prayer Potion";
- return State.PrayerPotion;
- } else if (usePrayerLogout) {
- status = "No more Prayer Potion";
- return State.NoPot;
- }
- }
- if (interfaces.getComponent(749, 4).getBackgroundColor() == 1209 && prayer > 0) {
- status = "Activating Prayer";
- return State.OnPrayer;
- }
- }
- status = "Fighting";
- return State.Fight;
- } else {
- if (looting || buryBones || ranging) {
- RSGroundItem item = nearestItem(allLoots);
- if (item != null && calc.distanceTo(item.getLocation()) < 5) {
- if (!inventory.isFull()) {
- status = "Looting";
- return State.Loot;
- } else {
- if (usePrayer && usePrayerPotion && inventory.getItem(229) != null) {
- status = "Dropping Vials";
- return State.DropVial;
- }
- RSComponent bone = selectItem(new String[]{"bone"}, "peach");
- if (buryBones && bone != null) {
- status = "Burying Bones";
- return State.Bury;
- }
- int foodCount = inventory.getCount(new int[]{foodInt, 6883});
- if (doBanking) {
- if (inventory.isFull() && foodCount < 3) {
- if (interfaces.getComponent(749, 4).getBackgroundColor() != 1209 && Integer.parseInt(interfaces.getComponent(749, 4).getText().trim()) > 0) {
- status = "Deactivating Prayer";
- return State.OffPrayer;
- }
- if (banker.bankType == 1)
- return State.Full;
- }
- } else {
- if (useAlch) {
- status = "Doing Alchemy";
- return State.Alch;
- } else if (inventory.isFull() && foodCount < 3) {
- status = "Inventory Full!";
- return State.Full;
- }
- }
- }
- } else {
- int prayer = Integer.parseInt(interfaces.getComponent(749, 4).getText().trim());
- double percent = (double) prayer / (double) skills.getRealLevel(Skills.PRAYER);
- if (usePrayer) {
- if (usePrayerPotion && percent <= 0.33) {
- if (inventory.getItem(new int[]{2434, 139, 141, 143, 11465, 11467}) != null) {
- status = "Prayer Potion";
- return State.PrayerPotion;
- } else if (usePrayerLogout) {
- status = "No more Prayer Potion";
- return State.NoPot;
- }
- }
- if (interfaces.getComponent(749, 4).getBackgroundColor() == 1209 && prayer > 0) {
- status = "Activating Prayer";
- return State.OnPrayer;
- }
- }
- status = "Fighting";
- return State.Fight;
- }
- } else {
- status = "Fighting";
- return State.Fight;
- }
- }
- } else {
- if (looting || buryBones || ranging) {
- RSGroundItem item = nearestItem(allLoots);
- if (item != null && !inventory.isFull()) {
- status = "Looting";
- return State.Loot;
- } else {
- if (usePrayer && usePrayerPotion && inventory.getItem(229) != null) {
- status = "Dropping Vials";
- return State.DropVial;
- }
- RSComponent bone = selectItem(new String[]{"bone"}, "peach");
- if (buryBones && bone != null) {
- status = "Burying Bones";
- return State.Bury;
- }
- int foodCount = inventory.getCount(new int[]{foodInt, 6883});
- if (doBanking) {
- if (inventory.isFull() && foodCount < 3) {
- if (usePrayer && interfaces.getComponent(749, 4).getBackgroundColor() != 1209 && Integer.parseInt(interfaces.getComponent(749, 4).getText().trim()) > 0) {
- status = "Deactivating Prayer";
- return State.OffPrayer;
- }
- if (banker.bankType == 1)
- return State.Full;
- }
- } else {
- if (useAlch) {
- status = "Doing Alchemy";
- return State.Alch;
- } else if (inventory.isFull() && foodCount < 3) {
- status = "Inventory Full!";
- return State.Full;
- }
- }
- }
- }
- }
- }
- status = "Waiting";
- return State.Antiban;
- }
- private State getStateMob() {
- if (onlyLoot) {
- status = "Looting";
- return State.Loot;
- }
- if (banker.banking)
- return State.Bank;
- if (rangeEquip) {
- status = "Equip Arrows";
- return State.Range;
- }
- if (underAttack + 1000 > System.currentTimeMillis()) {
- status = "Under Attack!";
- return State.InBattle;
- }
- if (inCombat()) {
- if (eatFood && Integer.parseInt(interfaces.getComponent(748, 8).getText()) < minHealth) {
- RSItem food = inventory.getItem(new int[]{foodInt, 6883});
- if (food == null && useBones) {
- status = "Bones to Peaches";
- return State.Peaches;
- }
- status = "Eating";
- return State.Eat;
- } else {
- status = "Antiban";
- return State.Antiban;
- }
- } else {
- if (eatFood && Integer.parseInt(interfaces.getComponent(748, 8).getText()) < minHealth) {
- RSItem food = inventory.getItem(new int[]{foodInt, 6883});
- if (food == null && useBones) {
- status = "Bones to Peaches";
- return State.Peaches;
- }
- status = "Eating";
- return State.Eat;
- }
- RSNPC mob = idsInstead ? nearestNpc(mobId) : nearestNpc(mobName);
- if (mob != null) {
- int prayer = Integer.parseInt(interfaces.getComponent(749, 4).getText().trim());
- double percent = (double) prayer / (double) skills.getRealLevel(Skills.PRAYER);
- if (usePrayer) {
- if (usePrayerPotion && percent <= 0.33) {
- if (inventory.getItem(new int[]{2434, 139, 141, 143, 11465, 11467}) != null) {
- status = "Prayer Potion";
- return State.PrayerPotion;
- } else if (usePrayerLogout) {
- status = "No more Prayer Potion";
- return State.NoPot;
- }
- }
- if (interfaces.getComponent(749, 4).getBackgroundColor() == 1209 && prayer > 0) {
- status = "Activating Prayer";
- return State.OnPrayer;
- }
- }
- status = "Fighting";
- return State.Fight;
- } else {
- if (looting || buryBones || ranging) {
- RSGroundItem item = nearestItem(allLoots);
- if (item != null && !inventory.isFull()) {
- status = "Looting";
- return State.Loot;
- } else {
- if (usePrayer && usePrayerPotion && inventory.getItem(229) != null) {
- status = "Dropping Vials";
- return State.DropVial;
- }
- RSComponent bone = selectItem(new String[]{"bone"}, "peach");
- if (buryBones && bone != null) {
- status = "Burying Bones";
- return State.Bury;
- }
- int foodCount = inventory.getCount(new int[]{foodInt, 6883});
- if (doBanking) {
- if (inventory.isFull() && foodCount < 3) {
- if (usePrayer && interfaces.getComponent(749, 4).getBackgroundColor() != 1209 && Integer.parseInt(interfaces.getComponent(749, 4).getText().trim()) > 0) {
- status = "Deactivating Prayer";
- return State.OffPrayer;
- }
- if (banker.bankType == 1)
- return State.Full;
- }
- } else {
- if (useAlch) {
- status = "Doing Alchemy";
- return State.Alch;
- } else if (inventory.isFull() && foodCount < 3) {
- status = "Inventory Full!";
- return State.Full;
- }
- }
- }
- }
- }
- }
- status = "Waiting";
- return State.Antiban;
- }
- private State getStateItem() {
- if (onlyLoot) {
- status = "Looting";
- return State.Loot;
- }
- if (banker.banking)
- return State.Bank;
- if (rangeEquip) {
- status = "Equip Arrows";
- return State.Range;
- }
- if (underAttack + 1000 > System.currentTimeMillis()) {
- status = "Under Attack!";
- return State.InBattle;
- }
- if (inCombat()) {
- if (eatFood && Integer.parseInt(interfaces.getComponent(748, 8).getText()) < minHealth) {
- RSItem food = inventory.getItem(new int[]{foodInt, 6883});
- if (food == null && useBones) {
- status = "Bones to Peaches";
- return State.Peaches;
- }
- status = "Eating";
- return State.Eat;
- } else {
- status = "Antiban";
- return State.Antiban;
- }
- } else {
- if (looting || buryBones || ranging) {
- RSGroundItem item = nearestItem(allLoots);
- if (item != null) {
- if (!inventory.isFull()) {
- status = "Looting";
- return State.Loot;
- } else {
- if (usePrayer && usePrayerPotion && inventory.getItem(229) != null) {
- status = "Dropping Vials";
- return State.DropVial;
- }
- RSComponent bone = selectItem(new String[]{"bone"}, "peach");
- if (buryBones && bone != null) {
- status = "Burying Bones";
- return State.Bury;
- }
- int foodCount = inventory.getCount(new int[]{foodInt, 6883});
- if (doBanking) {
- if (inventory.isFull() && foodCount < 3) {
- if (interfaces.getComponent(749, 4).getBackgroundColor() != 1209 && Integer.parseInt(interfaces.getComponent(749, 4).getText().trim()) > 0) {
- status = "Deactivating Prayer";
- return State.OffPrayer;
- }
- if (banker.bankType == 1)
- return State.Full;
- }
- } else {
- if (useAlch) {
- status = "Doing Alchemy";
- return State.Alch;
- } else if (inventory.isFull() && foodCount < 3) {
- status = "Inventory Full!";
- return State.Full;
- }
- }
- }
- }
- }
- RSNPC mob = idsInstead ? nearestNpc(mobId) : nearestNpc(mobName);
- if (mob != null) {
- if (calc.distanceTo(mob.getLocation()) < 3) {
- int prayer = Integer.parseInt(interfaces.getComponent(749, 4).getText().trim());
- double percent = (double) prayer / (double) skills.getRealLevel(Skills.PRAYER);
- if (usePrayer) {
- if (usePrayerPotion && percent <= 0.33) {
- if (inventory.getItem(new int[]{2434, 139, 141, 143, 11465, 11467}) != null) {
- status = "Prayer Potion";
- return State.PrayerPotion;
- } else if (usePrayerLogout) {
- status = "No more Prayer Potion";
- return State.NoPot;
- }
- }
- if (interfaces.getComponent(749, 4).getBackgroundColor() == 1209 && prayer > 0) {
- status = "Activating Prayer";
- return State.OnPrayer;
- }
- }
- status = "Fighting";
- return State.Fight;
- }
- }
- }
- status = "Waiting";
- return State.Antiban;
- }
- //--------------CLASSES---------------\\
- public class Action {
- private RSTile tile;
- private int actionType;
- private int floor;
- private int object;
- private String action;
- public Action(final RSTile tile, final int floor) {
- this.tile = tile;
- this.floor = floor;
- this.actionType = 0;
- this.object = -1;
- this.action = "nil";
- }
- public Action(final RSTile tile, final int actionType, final int floor, final int object, final String action) {
- this.tile = tile;
- this.actionType = actionType;
- this.floor = floor;
- this.object = object;
- if (action.isEmpty())
- this.action = "nil";
- else
- this.action = action;
- }
- public int distance() {
- return calc.distanceTo(tile);
- }
- public String getAction() {
- return action;
- }
- public RSTile getTile() {
- return tile;
- }
- public int getActionType() {
- return actionType;
- }
- public int getFloor() {
- return floor;
- }
- public int getObject() {
- return object;
- }
- public boolean canUse() {
- if (actionType == 2) {
- if (tileObjectCheck(tile, object) != null) {
- return (calc.distanceTo(tile) < 13);
- } else {
- return false;
- }
- } else {
- if (floor != game.getPlane())
- return false;
- return (calc.distanceTo(tile) < 13);
- }
- }
- public String toString() {
- return tile.getX() + "," + tile.getY() + "," + actionType + "," + floor + "," + object + "," + action;
- }
- public void doAction() {
- if (actionType == 0) { // tiles
- walking.walkTileMM(tile);
- sleep(random(550, 700));
- for (int i = 0; i < 18; i++) {
- antiban.main(false);
- sleep(50);
- if (walking.getDestination() == null)
- break;
- if (calc.distanceTo(walking.getDestination()) < 3)
- break;
- }
- } else if (actionType == 3) { // teleports
- RSItem i = inventory.getItem(object);
- if (i != null) {
- i.doAction(action);
- sleep(random(600, 700));
- int max = 0;
- while (max < 21 && getMyPlayer().getAnimation() != -1) {
- max++;
- sleep(50);
- }
- } else {
- log.warning("Could not find item needed for teleporting!");
- logOutR = true;
- }
- } else { // ladders/ropes/doors
- RSObject o = tileObjectCheck(tile, object);
- if (o == null) {
- if (actionType == 1) {
- log.warning("Could not find object " + object + " on RSTile " + tile.toString() + "! Stopping script.");
- logOutR = true;
- } else {
- return;
- }
- } else {
- Point p = o.getModel().getPoint();
- if (p.getX() > -1 && p.getY() > -1) {
- mouse.move(p);
- onPoint(p, action);
- sleep(random(550, 700));
- for (int i = 0; i < 18; i++) {
- antiban.main(false);
- sleep(50);
- if (walking.getDestination() == null)
- break;
- if (calc.distanceTo(walking.getDestination()) < 3)
- break;
- }
- } else {
- walking.walkTileMM(tile);
- sleep(random(550, 700));
- for (int i = 0; i < 18; i++) {
- antiban.main(false);
- sleep(50);
- if (walking.getDestination() == null)
- break;
- if (calc.distanceTo(walking.getDestination()) < 3)
- break;
- }
- }
- }
- }
- }
- }
- public class Banker {
- public boolean withdrawFood = true, banking = false;
- public int bankingReason = -1, bankMode = 0, foodLimit = 28, bankType = 0;
- public ArrayList<Action> actionsList = new ArrayList<Action>();
- public ArrayList<Action> actionsListReverse = new ArrayList<Action>();
- public Action[] actions = null;
- public Action[] actionsReverse = null;
- private void doBank() {
- int failCount = 0;
- try {
- if (!bank.isOpen()) {
- RSTile loc = npcs.getNearest(Bank.NPC_BANKERS).getLocation();
- String msg = "Bank Banker";
- if (banker.bankMode == 1) {
- loc = objects.getNearest(Bank.OBJECT_BANKS).getLocation();
- msg = "Use-quickly";
- } else if (banker.bankMode == 2) {
- loc = objects.getNearest(Bank.OBJECT_BANKS).getLocation();
- msg = "Bank";
- }
- if (loc == null || calc.distanceTo(loc) > 6) {
- log.warning("Could not find bank! Logging out!");
- logOutR = true;
- return;
- }
- if (onTile(loc, msg, 0.5, 0.5, 0)) {
- walking.sleep(700);
- while (valid() && !bank.isOpen() && failCount < 11) {
- sleep(random(95, 105));
- if (getMyPlayer().isMoving())
- failCount = 0;
- failCount++;
- }
- } else {
- if (onTile(loc, "Use", 0.5, 0.5, 0)) {
- walking.sleep(700);
- while (valid() && !bank.isOpen() && failCount < 11) {
- sleep(random(95, 105));
- if (getMyPlayer().isMoving())
- failCount = 0;
- failCount++;
- }
- } else
- sleep(random(200, 250));
- }
- }
- if (bank.isOpen()) {
- int[] disallowed = {8015, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 4694, 4695, 4696, 4697, 4698, 4699};
- if (eatFood)
- disallowed = addElement(foodInt, disallowed);
- if (ranging)
- disallowed = addElement(arrowInt, disallowed);
- if (usePrayer && usePrayerPotion) {
- disallowed = addElement(2434, disallowed);
- disallowed = addElement(139, disallowed);
- disallowed = addElement(141, disallowed);
- disallowed = addElement(143, disallowed);
- disallowed = addElement(11465, disallowed);
- disallowed = addElement(11467, disallowed);
- }
- if (inventory.getCountExcept(disallowed) > 0) {
- int inv = inventory.getCount();
- bank.depositAllExcept(disallowed);
- bank.depositAllExcept(disallowed);
- for (int i = 0; i < 23; i++) {
- sleep(50);
- if (inventory.getCount(foodInt) != inv)
- break;
- }
- return;
- }
- int prayerPotCount = inventory.getCount(new int[]{2434, 139, 141, 143, 11465, 11467});
- int foodIntCount = inventory.getCount(foodInt);
- if (usePrayer && usePrayerPotion && prayerPotCount < 2) {
- RSComponent p = searchBank(new int[]{2434, 139, 141, 143, 11465, 11467});
- if (p != null) {
- if (p.doAction("Withdraw-5")) {
- sleep(random(700, 1000));
- }
- } else {
- usePrayer = false;
- }
- }
- if (eatFood && banker.withdrawFood && foodIntCount < 4) {
- int amt = bank.getCount(foodInt);
- if (amt == 0) {
- log.warning("Cannot withdraw food from bank, logging out!");
- logOutR = true;
- return;
- } else if (amt < 4) {
- log.warning("Insufficient food in bank, logging out!");
- logOutR = true;
- return;
- } else {
- if (bank.withdraw(foodInt, banker.foodLimit)) {
- sleep(random(700, 1000));
- }
- }
- }
- sleep(random(50, 100));
- }
- } catch (final Exception e) {
- }
- }
- }
- //--------------ON START--------------\\
- public boolean onStart() {
- chatRes = new ChatResponder();
- chatRes.start();
- env.disableRandom("Login");
- for (int i = 0; i < 5; i++) {
- Properties WBini = new Properties();
- try {
- WBini.load(new FileInputStream(new File(Configuration.Paths.getScriptCacheDirectory(), "WhiteBearAIOFighter" + (i + 1) + ".ini")));
- slots[i] = "Mobs: " + WBini.getProperty("MobNames") + " Items: " + WBini.getProperty("ItemNames");
- } catch (java.lang.Exception ee) {
- slots[i] = "(Empty Slot)";
- }
- }
- if (!game.isLoggedIn()) {
- log.warning("You must start the script logged in!");
- }
- return true;
- }
- //--------------ON FINISH-------------\\
- public void onFinish() {
- totalMode = true;
- chatRes.run = false;
- if (game.isLoggedIn() && exitStage < 2 && thePainter.runTime >= 3600000) {
- env.saveScreenshot(false);
- }
- log.info("In just " + totalTime + ", you gained a total of " + gainedEXP + " experience.");
- }
- //--------------ON REPAINT------------\\
- public void onRepaint(final Graphics g) {
- if (startPaint) {
- RSTile loc = getMyPlayer().getLocation();
- if (stage == 4 && pathRecord == 1) {
- if (banker.actionsList.size() < 0) {
- Action aa = new Action(loc, game.getPlane());
- banker.actionsList.add(aa);
- } else {
- RSTile prevLoc = banker.actionsList.get(banker.actionsList.size() - 1).getTile();
- if (loc.getX() != prevLoc.getX() || loc.getY() != prevLoc.getY()) {
- Action aa = new Action(loc, game.getPlane());
- banker.actionsList.add(aa);
- }
- }
- } else if (stage == 5 && pathRecordBack == 1) {
- if (banker.actionsListReverse.size() < 0) {
- Action aa = new Action(loc, game.getPlane());
- banker.actionsListReverse.add(aa);
- } else {
- RSTile prevLoc = banker.actionsListReverse.get(banker.actionsListReverse.size() - 1).getTile();
- if (loc.getX() != prevLoc.getX() || loc.getY() != prevLoc.getY()) {
- Action aa = new Action(loc, game.getPlane());
- banker.actionsListReverse.add(aa);
- }
- }
- }
- }
- try {
- if (game.isLoggedIn()) {
- final Rectangle nameBlock = new Rectangle(interfaces.get(137).getComponent(54).getAbsoluteX(), interfaces.get(137).getComponent(54).getAbsoluteY() + 2, 89, 13);
- g.setColor(new Color(211, 192, 155, 253));
- try {
- g.fillRect(nameBlock.x, nameBlock.y, nameBlock.width, nameBlock.height);
- } catch (Exception e) {
- }
- }
- g.setFont(new Font("sansserif", Font.PLAIN, 12));
- ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
- ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
- if (currentlyBreaking) {
- g.setColor(new Color(0, 0, 0));
- g.setColor(Color.BLACK);
- g.setFont(new Font("sansserif", Font.BOLD, 14));
- g.drawString("Currently taking a break!", 10, 30);
- }
- // Paints the Mouse Location
- Point mousey = mouse.getLocation();
- int x = (int) mousey.getX();
- int y = (int) mousey.getY();
- if (System.currentTimeMillis() - mouse.getPressTime() < 900)
- g.setColor(new Color(255, 0, 0, 170));
- else
- g.setColor(new Color(255, 0, 0, 75));
- g.drawLine(x, 0, x, game.getHeight());
- g.drawLine(0, y, game.getWidth(), y);
- g.fillRect(x - 1, y - 1, 3, 3);
- if (startPaint) {
- setup.paint(g);
- } else {
- if (thePainter.savedStats == true && game.getClientState() == 10) {
- thePainter.doPaint(g);
- }
- }
- } catch (java.lang.Exception e) {
- }
- }
- private class WhiteBearPaint {
- private final Color color1 = new Color(205, 187, 154);
- private final Color color2 = new Color(191, 184, 145);
- private final Color color3 = new Color(153, 153, 153);
- private final Color color4 = new Color(204, 204, 204);
- private final Color color5 = new Color(0, 102, 0);
- private final Color color6 = new Color(0, 0, 0);
- private final Color color7 = new Color(51, 153, 0);
- private final Color color8 = new Color(153, 102, 0, 160);
- private final Color color9 = new Color(153, 102, 0);
- private final Font font1 = new Font("Arial", 1, 12);
- private final Font font2 = new Font("Arial", 1, 15);
- private final Font font3 = new Font("Arial", 1, 11);
- String[] skillName = {"Attack", "Strength", "Defence", "Constitution", "Ranged", "Magic", "Prayer"};
- int[] skillID = {0, 2, 1, 3, 4, 6, 5};
- int paintSkill = 0;
- int[] start_exp = {-1, -1, -1, -1, -1, -1, -1};
- int[] start_level = {-1, -1, -1, -1, -1, -1, -1};
- int[] gained_exp = {0, 0, 0, 0, 0, 0, 0};
- int[] gained_level = {0, 0, 0, 0, 0, 0, 0};
- boolean savedStats = false, showPaint = true;
- final NumberFormat nf = NumberFormat.getInstance();
- long timeStart = System.currentTimeMillis();
- long runTime = System.currentTimeMillis() - timeStart;
- private void doPaint(final Graphics g) {
- getStats();
- NumberFormat formatter = new DecimalFormat("#,###,###");
- runTime = System.currentTimeMillis() - timeStart;
- totalTime = formatTime((int) runTime);
- if (showPaint) {
- g.setColor(color1);
- g.fillRect(8, 346, 487, 111);
- g.setColor(color2);
- g.drawRect(8, 346, 487, 111);
- if (totalMode) {
- g.setColor(color5);
- g.fillRect(416, 443, 80, 15);
- g.setColor(color6);
- g.drawRect(416, 443, 80, 15);
- g.setColor(color9);
- g.setFont(font1);
- g.drawString("Total Mode", 426, 456);
- g.setFont(new Font("Arial", 1, 17));
- g.setColor(new Color(0, 140, 0));
- g.drawString("White Bear AIO Fighter", 119, 366);
- g.setFont(new Font("Arial", 1, 14));
- g.drawString("Version: " + properties.version(), 374, 366);
- g.setFont(font1);
- g.setColor(color5);
- final int totalXp = gained_exp[0] + gained_exp[1] + gained_exp[2] + gained_exp[3] + gained_exp[4] + gained_exp[5] + gained_exp[6];
- final int xpHour = ((int) ((3600000.0 / (double) runTime) * totalXp));
- final int totalLvl = gained_level[0] + gained_level[1] + gained_level[2] + gained_level[3] + gained_level[4] + gained_level[5] + gained_level[6];
- drawString(g, formatter.format((long) totalXp) + " (" + formatter.format((long) xpHour) + "/hr)", 2, false);
- drawString(g, status, 1, false);
- drawString(g, "A: " + skills.getCurrentLevel(skillID[0]) + ", S: " + skills.getCurrentLevel(skillID[1])
- + ", D: " + skills.getCurrentLevel(skillID[2]) + ", C: " + skills.getCurrentLevel(skillID[3])
- + ", R: " + skills.getCurrentLevel(skillID[4]) + ", M: " + skills.getCurrentLevel(skillID[5])
- + ", P: " + skills.getCurrentLevel(skillID[6]), 3, false);
- drawString(g, totalLvl + " levels", 2, true);
- drawString(g, totalTime, 1, true);
- g.setColor(color6);
- g.drawLine(226, 377, 226, 422);
- g.setColor(color9);
- g.drawString("XP Gained:", 246, 415);
- g.drawString("Status:", 246, 390);
- g.drawString("Current Levels:", 18, 440);
- g.drawString("Levels Gained:", 18, 415);
- g.drawString("Time Running:", 18, 390);
- } else {
- g.setColor(color5);
- g.fillRect(416, 443, 80, 15);
- g.setColor(color6);
- g.drawRect(416, 443, 80, 15);
- g.setColor(color9);
- g.setFont(font1);
- g.drawString("Normal Mode", 420, 456);
- g.setColor(color3);
- g.fillRect(32, 359, 427, 10);
- g.setColor(color4);
- g.fillRect(32, 349, 427, 10);
- g.setColor(color7);
- g.fillRect(462, 352, 12, 12);
- g.setColor(color6);
- g.drawRect(462, 352, 12, 12);
- g.setColor(color7);
- g.fillRect(16, 352, 12, 12);
- g.setColor(color6);
- g.drawRect(16, 352, 12, 12);
- g.drawRect(31, 349, 428, 19);
- final int percent = skills.getPercentToNextLevel(skillID[paintSkill]);
- g.setColor(color8);
- g.fillRect(35, 352, (int) (((double) 421 / 100.0) * (double) percent), 14);
- g.setFont(font1);
- g.setColor(color5);
- final int xpHour = ((int) ((3600000.0 / (double) runTime) * gained_exp[paintSkill]));
- final int TTL = (int) (((double) skills.getExpToNextLevel(skillID[paintSkill]) / (double) xpHour) * 3600000);
- drawString(g, formatter.format((long) skills.getExpToNextLevel(skillID[paintSkill])), 3, false);
- drawString(g, formatter.format((long) gained_exp[paintSkill]) + " (" + formatter.format((long) xpHour) + "/hr)", 2, false);
- drawString(g, status, 1, false);
- drawString(g, formatTime(TTL), 3, true);
- drawString(g, skills.getCurrentLevel(skillID[paintSkill]) + " (" + gained_level[paintSkill] + " gained)", 2, true);
- drawString(g, totalTime, 1, true);
- g.setColor(color6);
- g.drawLine(226, 377, 226, 448);
- g.setColor(color9);
- g.drawString("XP to Level:", 246, 440);
- g.drawString("XP Gained:", 246, 415);
- g.drawString("Status:", 246, 390);
- g.drawString("Time to Level:", 18, 440);
- g.drawString("Current Level:", 18, 415);
- g.drawString("Time Running:", 18, 390);
- g.setFont(font2);
- g.drawString(">", 465, 363);
- g.drawString("<", 19, 364);
- g.setFont(font3);
- g.setColor(color6);
- g.drawString(skills.getPercentToNextLevel(skillID[paintSkill]) + "%", 429, 363);
- g.drawString(skillName[paintSkill], 38, 363);
- }
- g.setColor(color5);
- g.fillRect(483, 344, 13, 15);
- g.setColor(color6);
- g.drawRect(483, 344, 13, 15);
- g.setFont(new Font("Arial", 1, 14));
- g.setColor(color9);
- g.drawString("X", 486, 357);
- } else {
- g.setColor(color5);
- g.fillRect(483, 344, 13, 15);
- g.setColor(color6);
- g.drawRect(483, 344, 13, 15);
- g.setFont(new Font("Arial", 1, 14));
- g.setColor(color9);
- g.drawString("0", 486, 357);
- }
- }
- public void saveStats() {
- if (skills.getCurrentLevel(Skills.ATTACK) > 0 && game.isLoggedIn()) {
- nf.setMinimumIntegerDigits(2);
- for (int i = 0; i < 7; i++) {
- start_exp[i] = skills.getCurrentExp(skillID[i]);
- start_level[i] = skills.getCurrentLevel(skillID[i]);
- }
- savedStats = true;
- }
- }
- public void getStats() {
- if (savedStats) {
- for (int i = 0; i < 7; i++) {
- gained_exp[i] = skills.getCurrentExp(skillID[i]) - start_exp[i];
- gained_level[i] = skills.getCurrentLevel(skillID[i]) - start_level[i];
- if (gained_exp[i] > 0) {
- if (changedSkills.length == 0)
- changedSkills = new int[]{i};
- else {
- boolean canAdd = true;
- for (int e = 0; e < changedSkills.length; e++) {
- if (changedSkills[e] == i) {
- canAdd = false;
- break;
- }
- }
- if (canAdd)
- addElement(i, changedSkills);
- }
- }
- }
- int exp = 0;
- for (int i = 0; i < 7; i++) {
- exp = exp + gained_exp[i];
- }
- gainedEXP = exp;
- }
- }
- public void drawString(final Graphics g, final String val, final int index, final boolean leftSide) {
- final FontMetrics font = g.getFontMetrics();
- final Rectangle2D bounds = font.getStringBounds(val, g);
- final int width = (int) bounds.getWidth();
- if (leftSide)
- g.drawString(val, (210 - width), (365 + index * 25));
- else
- g.drawString(val, (466 - width), (365 + index * 25));
- }
- public String formatTime(final long milliseconds) {
- final long t_seconds = milliseconds / 1000;
- final long t_minutes = t_seconds / 60;
- final long t_hours = t_minutes / 60;
- final long seconds = t_seconds % 60;
- final long minutes = t_minutes % 60;
- final long hours = t_hours;
- return (nf.format(hours) + ":" + nf.format(minutes) + ":" + nf.format(seconds));
- }
- }
- private class StartupPaint {
- private final Font font1 = new Font("Arial", 1, 16);
- private final Font font2 = new Font("Arial", 1, 12);
- private final Font font3 = new Font("Arial", 1, 14);
- private final Font font4 = new Font("Arial", 1, 15);
- private final Font font5 = new Font("Arial", 1, 13);
- Rectangle main = new Rectangle(8, 346, 487, 111);
- Rectangle prev = new Rectangle(383, 347, 59, 15);
- Rectangle next = new Rectangle(446, 347, 46, 15);
- private void paintStage2(final Graphics g) {
- g.setColor(new Color(51, 153, 0));
- g.fillRect(next.x, next.y, next.width, next.height);
- g.setColor(new Color(0, 0, 0));
- g.drawRect(next.x, next.y, next.width, next.height);
- g.setColor(new Color(153, 102, 0));
- g.setFont(font2);
- g.drawString("next", 457, 359);
- g.setFont(new Font("Arial", 1, 15));
- g.setColor(new Color(153, 102, 0));
- g.drawString("Logout when no potion", 77, 447);
- g.drawString("Use Prayer Potions", 102, 417);
- g.drawString("Use Quick Prayers", 107, 386);
- if (usePrayer) {
- g.setColor(new Color(153, 153, 153));
- g.fillRoundRect(291, 370, 38, 22, 5, 5);//"OFF"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(291, 370, 38, 22, 5, 5);
- g.setColor(new Color(0, 153, 204));
- g.fillRoundRect(260, 370, 40, 22, 5, 5);
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(260, 370, 40, 22, 5, 5);
- g.setFont(new Font("Arial", 1, 14));
- g.setColor(new Color(255, 255, 255));
- g.drawString("ON", 271, 387);
- } else {
- g.setColor(new Color(153, 153, 153));
- g.fillRoundRect(260, 370, 38, 22, 5, 5);//"ON"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(260, 370, 38, 22, 5, 5);
- g.setColor(new Color(204, 204, 204));
- g.fillRoundRect(289, 370, 40, 22, 5, 5);
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(289, 370, 40, 22, 5, 5);
- g.setFont(new Font("Arial", 1, 14));
- g.setColor(new Color(0, 0, 0));
- g.drawString("OFF", 295, 387);
- }
- if (usePrayerPotion) {
- g.setColor(new Color(153, 153, 153));
- g.fillRoundRect(291, 401, 38, 22, 5, 5);//"OFF"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(291, 401, 38, 22, 5, 5);
- g.setColor(new Color(0, 153, 204));
- g.fillRoundRect(260, 401, 40, 22, 5, 5);
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(260, 401, 40, 22, 5, 5);
- g.setFont(new Font("Arial", 1, 14));
- g.setColor(new Color(255, 255, 255));
- g.drawString("ON", 271, 418);
- } else {
- g.setColor(new Color(153, 153, 153));
- g.fillRoundRect(260, 401, 38, 22, 5, 5);//"ON"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(260, 401, 38, 22, 5, 5);
- g.setColor(new Color(204, 204, 204));
- g.fillRoundRect(289, 401, 40, 22, 5, 5);
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(289, 401, 40, 22, 5, 5);
- g.setFont(new Font("Arial", 1, 14));
- g.setColor(new Color(0, 0, 0));
- g.drawString("OFF", 295, 418);
- }
- if (usePrayerLogout) {
- g.setColor(new Color(153, 153, 153));
- g.fillRoundRect(291, 431, 38, 22, 5, 5);//"OFF"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(291, 431, 38, 22, 5, 5);
- g.setColor(new Color(0, 153, 204));
- g.fillRoundRect(260, 431, 40, 22, 5, 5);
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(260, 431, 40, 22, 5, 5);
- g.setFont(new Font("Arial", 1, 14));
- g.setColor(new Color(255, 255, 255));
- g.drawString("ON", 271, 448);
- } else {
- g.setColor(new Color(153, 153, 153));
- g.fillRoundRect(260, 431, 38, 22, 5, 5);//"ON"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(260, 431, 38, 22, 5, 5);
- g.setColor(new Color(204, 204, 204));
- g.fillRoundRect(289, 431, 40, 22, 5, 5);
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(289, 431, 40, 22, 5, 5);
- g.setFont(new Font("Arial", 1, 14));
- g.setColor(new Color(0, 0, 0));
- g.drawString("OFF", 295, 448);
- }
- }
- public void paint(final Graphics g) {
- ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
- g.setColor(new Color(205, 187, 154));
- g.fillRect(main.x, main.y, main.width, main.height);
- g.setColor(new Color(191, 184, 145));
- g.drawRect(main.x, main.y, main.width, main.height);
- if (stage > 0 && stage < 9) {
- g.setFont(font2);
- g.setColor(new Color(51, 153, 0));
- g.fillRect(prev.x, prev.y, prev.width, prev.height);
- g.setColor(new Color(0, 0, 0));
- g.drawRect(prev.x, prev.y, prev.width, prev.height);
- g.setColor(new Color(153, 102, 0));
- g.drawString("Step " + stage + "/8: " + step[stage - 1], 11, 360);
- g.drawString("previous", 389, 359);
- }
- switch (stage) {
- case 0:
- g.setColor(new Color(51, 153, 0));
- g.fillRoundRect(156, 411, 188, 26, 8, 8);
- g.fillRoundRect(149, 361, 204, 28, 8, 8);
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(156, 411, 188, 26, 8, 8);
- g.drawRoundRect(149, 361, 204, 28, 8, 8);
- g.setFont(font1);
- g.setColor(new Color(117, 78, 0));
- g.drawString("Load Profile", 205, 430);
- g.drawString("Create New Profile", 182, 381);
- break;
- case 1:
- g.setColor(new Color(102, 153, 0));
- g.fillRoundRect(126, 389, 253, 28, 8, 8);
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(126, 389, 253, 28, 8, 8);
- if (guiDefine) {
- g.setColor(new Color(51, 153, 0));
- g.fillRect(next.x, next.y, next.width, next.height);
- g.setColor(new Color(0, 0, 0));
- g.drawRect(next.x, next.y, next.width, next.height);
- g.setColor(new Color(153, 102, 0));
- g.setFont(font2);
- g.drawString("next", 457, 359);
- g.setFont(font1);
- g.drawString("Edit GUI Settings", 190, 409);
- } else {
- g.setFont(font1);
- g.drawString("Click here to open GUI", 169, 409);
- }
- break;
- case 2:
- paintStage2(g);
- break;
- case 3:
- g.setColor(new Color(51, 153, 0));
- g.fillRect(next.x, next.y, next.width, next.height);
- g.setColor(new Color(0, 0, 0));
- g.drawRect(next.x, next.y, next.width, next.height);
- g.setColor(new Color(153, 102, 0));
- g.setFont(font2);
- g.drawString("next", 457, 359);
- if (cabbage) {
- g.setColor(new Color(102, 153, 0));
- g.fillRoundRect(278, 427, 205, 21, 5, 5);//"use safe spot"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(278, 427, 205, 21, 5, 5);
- g.setFont(font3);
- g.setColor(new Color(153, 102, 0));
- g.drawString("Use Safe Spot instead", 308, 443);
- g.setFont(font5);
- g.drawString("Please ensure that an Explorer's Ring 3 or 4 is equipped.", 17, 413);
- g.setFont(font4);
- g.drawString("Using Cabbage Teleport instead of Safe Spot", 46, 388);
- } else {
- g.setColor(new Color(102, 153, 0));
- g.fillRoundRect(251, 428, 234, 21, 5, 5);//"use cabbage teleport"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(251, 428, 234, 21, 5, 5);
- g.setFont(font3);
- g.setColor(new Color(153, 102, 0));
- g.drawString("Use Cabbage Teleport Instead", 263, 444);
- g.setFont(font5);
- g.drawString("safe spot before being logged out.", 17, 431);
- g.drawString("When out of food and your lifepoint is low, you will be moved to the", 17, 413);
- g.setFont(font4);
- g.drawString("Walk to Safe Spot, then click next.", 46, 388);
- }
- break;
- case 4:
- if (pathRecord == 0) {
- g.setColor(new Color(51, 153, 0));
- g.fillRoundRect(86, 408, 59, 22, 5, 5);//"start"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(86, 408, 59, 22, 5, 5);
- g.setFont(font4);
- g.setColor(new Color(153, 102, 0));
- g.drawString("Start", 100, 425);
- g.drawString("When ready, click Start and walk to bank.", 46, 388);
- } else if (pathRecord == 1) {
- g.setColor(new Color(204, 0, 0));
- g.fillRoundRect(85, 406, 52, 22, 5, 5);//"stop"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(85, 406, 52, 22, 5, 5);
- g.setFont(font4);
- g.setColor(new Color(153, 102, 0));
- g.drawString("Stop", 95, 422);
- g.drawString("Click stop when you have reached the bank.", 46, 388);
- g.setColor(new Color(102, 153, 0));
- g.fillRoundRect(339, 428, 144, 20, 5, 5);
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(339, 428, 144, 20, 5, 5);//add special action
- g.setFont(new Font("Arial", 1, 14));
- g.setColor(new Color(153, 102, 0));
- g.drawString("Add Special Action", 347, 443);
- } else {
- g.setColor(new Color(51, 153, 0));
- g.fillRect(next.x, next.y, next.width, next.height);
- g.setColor(new Color(0, 0, 0));
- g.drawRect(next.x, next.y, next.width, next.height);
- g.setColor(new Color(153, 102, 0));
- g.setFont(font2);
- g.drawString("next", 457, 359);
- g.setColor(new Color(204, 0, 0));
- g.fillRoundRect(85, 406, 52, 22, 5, 5);//"clear"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(85, 406, 52, 22, 5, 5);
- g.setFont(font4);
- g.setColor(new Color(153, 102, 0));
- g.drawString("Clear", 92, 422);
- g.drawString("To set a new path, click Clear.", 46, 388);
- }
- break;
- case 5:
- if (pathRecordBack == 0) {
- g.setColor(new Color(204, 0, 0));
- g.setColor(new Color(51, 153, 0));
- g.fillRoundRect(86, 408, 59, 22, 5, 5);//"start"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(86, 408, 59, 22, 5, 5);
- g.setFont(font4);
- g.setColor(new Color(153, 102, 0));
- g.drawString("Start", 100, 425);
- g.drawString("When ready, click Start and walk to the monsters.", 46, 388);
- } else if (pathRecordBack == 1) {
- g.setColor(new Color(204, 0, 0));
- g.fillRoundRect(85, 406, 52, 22, 5, 5);//"stop"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(85, 406, 52, 22, 5, 5);
- g.setFont(font4);
- g.setColor(new Color(153, 102, 0));
- g.drawString("Stop", 95, 422);
- g.drawString("Click stop when you have reached the monsters.", 46, 388);
- g.setColor(new Color(102, 153, 0));
- g.fillRoundRect(339, 428, 144, 20, 5, 5);
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(339, 428, 144, 20, 5, 5);//add special action
- g.setFont(new Font("Arial", 1, 14));
- g.setColor(new Color(153, 102, 0));
- g.drawString("Add Special Action", 347, 443);
- } else {
- g.setColor(new Color(51, 153, 0));
- g.fillRect(next.x, next.y, next.width, next.height);
- g.setColor(new Color(0, 0, 0));
- g.drawRect(next.x, next.y, next.width, next.height);
- g.setColor(new Color(153, 102, 0));
- g.setFont(font2);
- g.drawString("next", 457, 359);
- g.setColor(new Color(204, 0, 0));
- g.fillRoundRect(85, 406, 52, 22, 5, 5);//"clear"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(85, 406, 52, 22, 5, 5);
- g.setFont(font4);
- g.setColor(new Color(153, 102, 0));
- g.drawString("Clear", 92, 422);
- g.drawString("To set a new path, click Clear.", 46, 388);
- }
- break;
- case 6:
- g.setColor(new Color(51, 153, 0));
- g.fillRect(next.x, next.y, next.width, next.height);
- g.setColor(new Color(0, 0, 0));
- g.drawRect(next.x, next.y, next.width, next.height);
- g.setColor(new Color(153, 102, 0));
- g.setFont(font2);
- g.drawString("next", 457, 359);
- g.setColor(new Color(51, 153, 0));
- if (Bbreaking)
- g.fillRect(444, 423, 12, 12);//breaking >
- g.fillRect(183, 423, 12, 12);//antiban >
- g.setColor(new Color(204, 0, 0));
- if (Bbreaking)
- g.fillRect(314, 423, 12, 12);//breaking <
- g.fillRect(88, 423, 12, 12);//antiban <
- g.setColor(new Color(0, 0, 0));
- if (Bbreaking) {
- g.drawRect(444, 423, 12, 12);
- g.drawRect(314, 423, 12, 12);
- }
- g.drawRect(183, 423, 12, 12);
- g.drawRect(88, 423, 12, 12);
- g.setColor(new Color(204, 204, 204));
- if (Bbreaking)
- g.fillRoundRect(331, 419, 108, 19, 5, 5);
- g.fillRoundRect(105, 419, 73, 19, 5, 5);
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(105, 419, 73, 19, 5, 5);
- if (Bbreaking)
- g.drawRoundRect(331, 419, 108, 19, 5, 5);
- g.setFont(font4);
- g.setColor(new Color(153, 102, 0));
- if (Bbreaking) {
- g.drawString(">", 447, 434);
- g.drawString("<", 317, 434);
- }
- g.drawString(">", 186, 434);
- g.drawString("<", 91, 434);
- g.drawString("Use Breaking", 249, 394);
- if (Bbreaking)
- g.drawString("Breaking", 241, 435);
- g.drawString("Antiban", 28, 435);
- g.drawString("Chat Responder", 23, 393);
- g.setFont(new Font("Arial", 1, 13));
- if (Bbreaking)
- g.drawString(breakAmts[breakAmt], 339, 433);
- g.drawString(antibanAmts[antibanAmt], 114, 434);
- if (chatResponder) {
- g.setColor(new Color(153, 153, 153));
- g.fillRoundRect(177, 376, 38, 22, 5, 5);//"OFF"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(177, 376, 38, 22, 5, 5);
- g.setColor(new Color(0, 153, 204));
- g.fillRoundRect(144, 376, 40, 22, 5, 5);
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(144, 376, 40, 22, 5, 5);
- g.setFont(font3);
- g.setColor(new Color(255, 255, 255));
- g.drawString("ON", 154, 393);
- } else {
- g.setColor(new Color(153, 153, 153));
- g.fillRoundRect(144, 376, 38, 22, 5, 5);//"ON"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(144, 376, 38, 22, 5, 5);
- g.setColor(new Color(204, 204, 204));
- g.fillRoundRect(174, 376, 40, 22, 5, 5);
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(174, 376, 40, 22, 5, 5);
- g.setFont(font3);
- g.setColor(new Color(0, 0, 0));
- g.drawString("OFF", 180, 393);
- }
- if (Bbreaking) {
- g.setColor(new Color(153, 153, 153));
- g.fillRoundRect(385, 376, 38, 22, 5, 5);//"OFF"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(385, 376, 38, 22, 5, 5);
- g.setColor(new Color(0, 153, 204));
- g.fillRoundRect(352, 376, 40, 22, 5, 5);
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(352, 376, 40, 22, 5, 5);
- g.setFont(font3);
- g.setColor(new Color(255, 255, 255));
- g.drawString("ON", 362, 393);
- } else {
- g.setColor(new Color(153, 153, 153));
- g.fillRoundRect(352, 376, 38, 22, 5, 5);//"ON"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(352, 376, 38, 22, 5, 5);
- g.setColor(new Color(204, 204, 204));
- g.fillRoundRect(382, 376, 40, 22, 5, 5);
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(382, 376, 40, 22, 5, 5);
- g.setFont(font3);
- g.setColor(new Color(0, 0, 0));
- g.drawString("OFF", 388, 393);
- }
- break;
- case 7:
- g.setColor(new Color(51, 153, 0));
- g.fillRect(next.x, next.y, next.width, next.height);
- g.setColor(new Color(0, 0, 0));
- g.drawRect(next.x, next.y, next.width, next.height);
- g.setColor(new Color(153, 102, 0));
- g.setFont(font2);
- g.drawString("next", 457, 359);
- g.setColor(new Color(204, 0, 0));
- g.fillRoundRect(407, 423, 57, 19, 5, 5);//"skip"
- g.fillRect(364, 385, 12, 12);//level -
- g.fillRect(118, 385, 12, 12);//skill <
- g.setColor(new Color(51, 153, 0));
- g.fillRect(426, 385, 12, 12);//level +
- g.fillRect(230, 385, 12, 12);//skill >
- g.setColor(new Color(204, 204, 204));
- g.fillRoundRect(382, 381, 38, 19, 5, 5);
- g.fillRoundRect(136, 381, 88, 19, 5, 5);
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(407, 423, 57, 19, 5, 5);
- g.drawRect(426, 385, 12, 12);
- g.drawRect(364, 385, 12, 12);
- g.drawRect(230, 385, 12, 12);
- g.drawRect(118, 385, 12, 12);
- g.drawRoundRect(382, 381, 38, 19, 5, 5);
- g.drawRoundRect(136, 381, 88, 19, 5, 5);
- g.setFont(new Font("Arial", 1, 14));
- g.setColor(new Color(153, 102, 0));
- g.drawString(Integer.toString(logoutLevel), 393, 396);
- g.setFont(new Font("Arial", 1, 13));
- g.drawString(logoutSkills[logoutSkill], 142, 396);
- g.setFont(new Font("Arial", 1, 15));
- g.drawString("+", 429, 398);
- g.drawString("-", 368, 395);
- g.drawString(">", 233, 397);
- g.drawString("<", 121, 396);
- g.drawString("Skip", 420, 438);
- g.drawString("is above Level", 252, 397);
- g.drawString("Logout when", 18, 397);
- break;
- case 8:
- break;
- case 9:
- g.setColor(new Color(102, 153, 0));
- g.fillRect(446, 347, 46, 15);//"back"
- g.setColor(new Color(0, 0, 0));
- g.drawRect(446, 347, 46, 15);
- g.setFont(new Font("Arial", 1, 12));
- g.setColor(new Color(153, 102, 0));
- g.drawString("back", 456, 359);
- g.drawString("Load Profile:", 11, 360);
- break;
- case 10:
- g.setColor(new Color(204, 0, 0));
- g.fillRoundRect(247, 404, 50, 20, 5, 5);//"no"
- g.setColor(new Color(51, 153, 0));
- g.fillRoundRect(166, 404, 50, 20, 5, 5);//"yes"
- g.setColor(new Color(0, 0, 0));
- g.drawRoundRect(247, 404, 50, 20, 5, 5);
- g.drawRoundRect(166, 404, 50, 20, 5, 5);
- g.setFont(new Font("Arial", 1, 15));
- g.setColor(new Color(153, 102, 0));
- g.drawString("No", 263, 420);
- g.drawString("Yes", 177, 420);
- g.drawString("Do you wish to Check for Updates?", 120, 386);
- break;
- case 11:
- g.setFont(new Font("Arial", 1, 15));
- g.setColor(new Color(153, 102, 0));
- g.drawString("Loading, please wait...", 58, 393);
- break;
- }
- if (stage == 8 || stage == 9) {
- g.setColor(new Color(153, 153, 153));
- g.fillRect(59, 431, 429, 15);//slot 5
- g.fillRect(59, 401, 429, 15);//slot 3
- g.fillRect(59, 371, 429, 15);//slot 1
- g.setColor(new Color(204, 204, 204));
- g.fillRect(59, 416, 429, 15);//slot 4
- g.fillRect(59, 386, 429, 15);//slot 2
- g.setColor(new Color(0, 0, 0));
- g.drawRect(59, 431, 429, 15);
- g.drawRect(59, 416, 429, 15);
- g.drawRect(59, 401, 429, 15);
- g.drawRect(59, 386, 429, 15);
- g.drawRect(59, 371, 429, 15);
- g.setFont(font5);
- g.setColor(new Color(153, 102, 0));
- g.drawString("Slot 5", 17, 444);
- g.drawString("Slot 4", 17, 429);
- g.drawString("Slot 3", 17, 414);
- g.drawString("Slot 2", 17, 399);
- g.drawString("Slot 1", 17, 384);
- g.setFont(font2);
- g.drawString(slots[4], 63, 444);
- g.drawString(slots[3], 63, 429);
- g.drawString(slots[2], 63, 414);
- g.drawString(slots[1], 63, 399);
- g.drawString(slots[0], 63, 384);
- }
- }
- }
- //--------------SERVER MSG------------\\
- public void messageReceived(MessageEvent arg0) {
- try {
- String serverString = arg0.getMessage();
- if (arg0.getID() > 0 && arg0.getID() < 10)
- return;
- if (serverString.contains("You've just advanced")) {
- if (lvlAmt == 0) {
- log("[Alert] You have just leveled, thanks to White Bear AIO Fighter!");
- } else {
- log("[Alert] Another level by White Bear AIO Fighter!");
- }
- lvlAmt += 1;
- }
- if (serverString.contains("Prayer button next to the minimap to")) {
- if (usePrayer) {
- log.severe("Could not use prayer! Use prayer disabled!");
- usePrayer = false;
- }
- }
- if (serverString.contains("Nature Runes to cast this spell")) {
- if (useAlch) {
- log.severe("Out of runes! Alchemy disabled!");
- useAlch = false;
- }
- if (useBones && !useTabs) {
- log.severe("Out of runes! Bones to Peaches disabled!");
- useBones = false;
- }
- }
- if (serverString.contains("no ammo left")) {
- rangeEquip = true;
- }
- if (serverString.contains("already under attack")) {
- underAttack = System.currentTimeMillis();
- }
- if (serverString.contains("runes to cast this spell")) {
- log.severe("Out of runes! Logging out!");
- logOutR = true;
- }
- if (serverString.contains("Oh dear")) {
- log.severe("[Alert] You were killed! Aborting script!");
- logOutR = true;
- }
- if (serverString.contains("System update in")) {
- log.warning("There will be a system update soon, so we logged out");
- logOutR = true;
- }
- if (serverString.contains("wishes to trade with you")) {
- tradeResponse = true;
- }
- } catch (java.lang.Throwable t) {
- }
- }
- //---------------ANTIBAN--------------\\
- private class Antiban {
- int cam = 27;
- int[] skillInterfaces = {1, 4, 22, 2, 46, 87, 70};
- boolean checkFriend = false, checkExperience = true, screenLookaway = false;
- //Antiban timeouts and next times
- long timeOutB1 = 600000, timeOutB2 = 800000;
- long timeFriend = System.currentTimeMillis(), timeExp = System.currentTimeMillis();
- long timeLook = System.currentTimeMillis();
- long timeOutFriend = 20000, timeOutExp = 20000;
- private void main(boolean extras) {
- mouse.setSpeed(random(minMS + 1, maxMS + 1));
- if (!chatRes.typing) {
- if (nextRun < System.currentTimeMillis() && walking.getEnergy() >= random(79, 90)) {
- nextRun = System.currentTimeMillis() + 7000;
- walking.setRun(true);
- sleep(100);
- }
- int random = random(1, 21);
- if (random == 1) {
- if (random(1, 3) == 1) {
- chatRes.wait = true;
- mouse.move(random(5, game.getWidth()), random(5, game.getHeight()));
- chatRes.wait = false;
- }
- }
- if (random == 2) {
- int randCamera = random(1, cam);
- if (randCamera <= 4) {
- camTurned += 1;
- chatRes.wait = true;
- turnCamera();
- chatRes.wait = false;
- }
- }
- if (extras) {
- if (checkExperience && random == 6 && changedSkills.length > 0) {
- if (System.currentTimeMillis() > timeExp && random(1, 46) == 1) {
- if (game.getCurrentTab() != 1) {
- int r = changedSkills[random(0, changedSkills.length)];
- chatRes.wait = true;
- game.openTab(1);
- Point stats = new Point(interfaces.get(320).getComponent(skillInterfaces[r]).getAbsoluteX() + 20, interfaces.get(320).getComponent(skillInterfaces[r]).getAbsoluteY() + 10);
- mouse.move(stats, 5, 5);
- sleepCR(random(28, 31));
- timeExp = System.currentTimeMillis() + (long) random(timeOutExp - 1500, timeOutExp + 1500);
- chatRes.wait = false;
- }
- }
- }
- if (random == 7) {
- if (random(0, 2) == 0) {
- if (checkFriend && System.currentTimeMillis() > timeFriend && random(1, 19) == 1) {
- chatRes.wait = true;
- game.openTab(9);
- sleepCR(random(18, 25));
- timeFriend = System.currentTimeMillis() + (long) random(timeOutFriend - 1500, timeOutFriend + 1500);
- chatRes.wait = false;
- }
- }
- }
- if (random == 8) {
- final int chance2 = random(1, 20);
- if (chance2 == 1) {
- RSPlayer player = players.getNearest(Players.ALL_FILTER);
- if (player != null && calc.distanceTo(player) != 0) {
- chatRes.wait = true;
- mouse.move(player.getScreenLocation(), 5, 5);
- sleepCR(random(6, 9));
- mouse.click(false);
- sleepCR(random(15, 17));
- mouse.move(random(10, 450), random(10, 495));
- chatRes.wait = false;
- }
- }
- }
- }
- }
- mouse.setSpeed(random(minMS, maxMS));
- }
- private void turnCamera() {
- final char[] LR = new char[]{KeyEvent.VK_LEFT,
- KeyEvent.VK_RIGHT};
- final char[] UD = new char[]{KeyEvent.VK_DOWN,
- KeyEvent.VK_UP};
- final char[] LRUD = new char[]{KeyEvent.VK_LEFT,
- KeyEvent.VK_RIGHT, KeyEvent.VK_UP,
- KeyEvent.VK_DOWN};
- final int randomLR = random(0, 2);
- final int randomUD = random(0, 2);
- int randomAll = random(0, 4);
- if (!banker.banking)
- randomAll = random(0, 2);
- if (random(0, 3) == 0) {
- keyboard.pressKey(LR[randomLR]);
- sleepCR(random(2, 9));
- if (!banker.banking)
- keyboard.pressKey(UD[randomUD]);
- sleepCR(random(6, 10));
- if (!banker.banking)
- keyboard.releaseKey(UD[randomUD]);
- sleepCR(random(2, 7));
- keyboard.releaseKey(LR[randomLR]);
- } else {
- keyboard.pressKey(LRUD[randomAll]);
- if (randomAll > 1) {
- sleepCR(random(6, 11));
- } else {
- sleepCR(random(9, 12));
- }
- keyboard.releaseKey(LRUD[randomAll]);
- }
- }
- private boolean lookAway() {
- if (!chatRes.typing && screenLookaway && timeLook < System.currentTimeMillis() && inCombat() && random(0, 111) == 0) {
- chatRes.pause = true;
- status = "Looking Away";
- if (random(0, 75) <= 50) {
- mouse.setSpeed(random(3, 5));
- mouse.move(random(40, game.getWidth() - 50), game.getHeight());
- mouse.setSpeed(random(minMS, maxMS));
- }
- int r1 = random(0, 101);
- if (!foundType)
- r1 = 1;
- int to = 0;
- try {
- if (getMyPlayer().getInteracting().getHPPercent() > 6) {
- int m = 0;
- while (valid() && inCombat() && m < 601) {
- m++;
- sleep(50);
- if (getMyPlayer().getInteracting().getHPPercent() < 6) {
- break;
- }
- }
- if (r1 > 57) {
- to = random(500, 3500);
- sleep(to);
- }
- timeLook = (long) (System.currentTimeMillis() + random(timeOutB1, timeOutB2));
- }
- } catch (Throwable e) {
- }
- chatRes.pause = false;
- return true;
- }
- return false;
- }
- private RSPlayer getNearbyMod() {
- RSPlayer[] modCheck = players.getAll();
- int Dist = 18;
- RSPlayer closest = null;
- int element = 0;
- int size = modCheck.length;
- while (element < size) {
- if (modCheck[element] != null) {
- try {
- if (modCheck[element].getName().startsWith("Mod")) {
- int distance = calc.distanceTo(modCheck[element]);
- if (distance < Dist) {
- Dist = distance;
- closest = modCheck[element];
- }
- }
- } catch (Exception ignored) {
- }
- }
- element += 1;
- }
- return closest;
- }
- private void breakingNew() {
- if (randomBreaking) {
- long varTime = random(7200000, 18000000);
- nextBreak = System.currentTimeMillis() + varTime;
- long varLength = random(120000, 600000);
- nextLength = varLength;
- } else {
- int diff = randTime * 1000 * 60;
- long varTime = random((midTime * 1000 * 60) - diff, (midTime * 1000 * 60) + diff);
- nextBreak = System.currentTimeMillis() + varTime;
- int diff2 = randLength * 1000 * 60;
- long varLength = random((midLength * 1000 * 60) - diff2, (midLength * 1000 * 60) + diff2);
- nextLength = varLength;
- }
- }
- private boolean breakingCheck() {
- if (nextBreak <= System.currentTimeMillis()) {
- return true;
- }
- return false;
- }
- private boolean sleepCR(int amtOfHalfSecs) {
- for (int x = 0; x < (amtOfHalfSecs + 1); x++) {
- sleep(random(48, 53));
- if (chatRes.typing) {
- return false;
- }
- }
- return true;
- }
- }
- //--------------METHODS---------------\\
- private int loot() {
- RSGroundItem item = nearestItem(allLoots);
- if (allLoots == null && onlyLoot) {
- onlyLoot = false;
- banker.bankingReason = 0;
- banker.banking = true;
- camera.setPitch(true);
- log.info("Going to Bank, reason: Out of Food");
- }
- if (item != null) {
- int m = 0;
- if (!calc.pointOnScreen(calc.tileToScreen(item.getLocation(), 0.5, 0.5, 0))) {
- // Item not within sight; walk towards it
- walking.walkTileMM(item.getLocation());
- sleep(random(500, 700));
- while (valid() && m < 21 && getMyPlayer().isMoving()) {
- m++;
- sleep(50);
- if (calc.pointOnScreen(calc.tileToScreen(item.getLocation(), 0.5, 0.5, 0)))
- return 10;
- }
- } else {
- // Takes the item
- int count = inventory.getCount();
- mouse.move(calc.tileToScreen(item.getLocation(), 0.5, 0.5, 0));
- sleep(10);
- onTile(item.getLocation(), "Take " + item.getItem().getName(), 0.5, 0.5, 0);
- sleep(random(500, 700));
- while (valid() && m < 21) {
- m++;
- sleep(50);
- if (inventory.getCount() != count)
- break;
- }
- }
- } else {
- if (onlyLoot) {
- onlyLoot = false;
- banker.bankingReason = 0;
- banker.banking = true;
- camera.setPitch(true);
- log.info("Going to Bank, reason: Out of Food");
- }
- return 10;
- }
- return random(300, 500);
- }
- private void activate() {
- if (!game.isFixed()) {
- log.warning("Your screen size is not Fixed!");
- log.warning("This script will encounter problems if you don't change it to fixed!");
- }
- area[0] = startLoc.getX() - maxDist;
- area[1] = startLoc.getY() - maxDist;
- area[2] = startLoc.getX() + maxDist;
- area[3] = startLoc.getY() + maxDist;
- if (usePrayerPotion) {
- RSItem[] items = inventory.getItems(new int[]{2434, 139, 141, 143, 11465, 11467});
- if (items == null || items.length < 1) {
- log.warning("Could not find Prayer Potions. Allowed IDs: 2434,139,141,143,11465,11467");
- log.warning("We will not be using Prayer Potions.");
- usePrayerPotion = false;
- }
- }
- if (looting) {
- for (String s : userLoots) {
- allLoots = addElement(s, allLoots);
- }
- }
- if (ranging) {
- game.openTab(Game.TAB_EQUIPMENT);
- sleep(random(300, 500));
- allLoots = addElement(equipment.getItem(Equipment.AMMO).getName(), allLoots);
- arrowName = equipment.getItem(Equipment.AMMO).getName();
- }
- switch (antibanAmt) {
- case 0:
- antiban.cam = 200;
- antiban.checkExperience = false;
- antiban.checkFriend = false;
- antiban.screenLookaway = false;
- break;
- case 1:
- antiban.cam = 25;
- antiban.checkExperience = true;
- antiban.checkFriend = false;
- antiban.screenLookaway = false;
- break;
- case 2:
- antiban.cam = 25;
- antiban.checkExperience = true;
- antiban.checkFriend = true;
- antiban.screenLookaway = true;
- break;
- }
- switch (breakAmt) {
- case 0:
- randLength = 7;
- midLength = 12;
- randTime = 30;
- midTime = 60;
- break;
- case 1:
- randLength = 7;
- midLength = 17;
- randTime = 30;
- midTime = 90;
- break;
- case 2:
- randLength = 10;
- midLength = 25;
- randTime = 30;
- midTime = 150;
- break;
- case 3:
- randLength = 7;
- midLength = 32;
- randTime = 30;
- midTime = 210;
- break;
- case 4:
- randLength = 10;
- midLength = 40;
- randTime = 30;
- midTime = 270;
- break;
- }
- if (checkUpdate) {
- URLConnection url = null;
- BufferedReader in = null;
- try {
- url = new URL("http://whitebearrs.orgfree.com/content/updater.php?script=fighter&type=all").openConnection();
- in = new BufferedReader(new InputStreamReader(url.getInputStream()));
- String ver = in.readLine();
- String link = in.readLine();
- String update = in.readLine();
- if (Double.parseDouble(ver) > properties.version()) {
- log.warning("Latest version: " + ver + "! Please update the script!");
- log.info("In this update: " + update);
- log.info("Download from: " + link);
- } else if (Double.parseDouble(ver) < properties.version()) {
- log.info("You are using a beta version of this script!");
- } else {
- log.info("You are using the latest version of this script!");
- }
- if (in != null)
- in.close();
- } catch (java.lang.Exception e) {
- log.warning("An error occurred while checking for update!");
- }
- }
- antiban.breakingNew();
- thePainter.timeStart = System.currentTimeMillis();
- unactivated = false;
- }
- private int countLoots() {
- int count = 0;
- int[] not = {8015, 526, 532, 530, 528, 3183, 2859, 534, 3125, 4834, 14793, 4812, 3123, 4832, 6729, 536, foodInt, arrowInt};
- for (int i = 0; i < 28; i++) {
- int c = interfaces.getComponent(149, 0).getComponent(i).getComponentID();
- boolean canAdd = true;
- for (int x = 0; x < not.length; x++) {
- if (c == not[x]) {
- canAdd = false;
- break;
- }
- }
- if (canAdd)
- count++;
- }
- return count;
- }
- private boolean doLogOut(boolean toLobby, boolean stopScript) {
- status = "Logging out";
- while (bank.isOpen()) {
- bank.close();
- mouse.move(random(10, 430), random(10, 465));
- sleep(random(200, 400));
- }
- while (!game.isOnLogoutTab()) {
- mouse.move(random(game.getWidth() - 15, game.getWidth() - 5), random(5, 16));
- mouse.click(true);
- if (bank.isOpen()) {
- bank.close();
- }
- int timesToWait = 0;
- while (!game.isOnLogoutTab() && timesToWait < 5) {
- sleep(random(200, 400));
- timesToWait++;
- }
- }
- int maximum = 0;
- while (game.isLoggedIn() == true && maximum < 20) {
- if (toLobby) {
- interfaces.get(182).getComponent(2).doClick();
- } else {
- interfaces.get(182).getComponent(6).doClick();
- }
- sleep(1000);
- }
- if (!toLobby && stopScript) {
- stopScript(false);
- }
- return true;
- }
- private Action getNextAction(boolean reverse) {
- Action use = null;
- boolean special = false;
- Action spUse = null;
- int spDist = 0;
- Action[] source = (reverse ? banker.actionsReverse : banker.actions);
- for (Action a : source) {
- if (a.canUse()) {
- int thisDist = a.distance();
- if (a.getActionType() != 0) {
- spUse = a;
- spDist = thisDist;
- special = true;
- } else {
- if (thisDist > spDist) {
- use = a;
- special = false;
- }
- }
- }
- }
- return special ? spUse : use;
- }
- private boolean inArea(RSTile loc) {
- if (stayArea) {
- return loc.getX() >= area[0] && loc.getX() <= area[2] && loc.getY() >= area[1] && loc.getY() <= area[3];
- } else {
- return true;
- }
- }
- private boolean inCombat() {
- if (getMyPlayer().getInteracting() == null) {
- return false;
- }
- if (getMyPlayer().getInteracting().getHPPercent() > 0.00)
- return true;
- return false;
- }
- private RSGroundItem nearestItem(final String[] item) {
- if (item == null)
- return null;
- RSGroundItem g = groundItems.getNearest(new Filter<RSGroundItem>() {
- public boolean accept(RSGroundItem t) {
- for (final String i : item) {
- if (t.getItem().getName() != null && t.getItem().getName().toLowerCase().contains(i) && inArea(t.getLocation()))
- return true;
- }
- return false;
- }
- });
- return g;
- }
- private RSNPC nearestNpc(final String[] npcss) {
- if (npcss == null)
- return null;
- RSNPC npc = npcs.getNearest(new Filter<RSNPC>() {
- public boolean accept(RSNPC t) {
- for (int i = 0; i < npcss.length; i++) {
- if ((multiway || !t.isInCombat()) && t.getName().toLowerCase().contains(npcss[i]) && inArea(t.getLocation()))
- return true;
- }
- return false;
- }
- });
- if (npc != null)
- return npc;
- return null;
- }
- private RSNPC nearestNpc(final int[] npcss) {
- if (npcss == null)
- return null;
- RSNPC npc = npcs.getNearest(new Filter<RSNPC>() {
- public boolean accept(RSNPC t) {
- for (int i = 0; i < npcss.length; i++) {
- if ((multiway || !t.isInCombat()) && t.getID() == npcss[i] && inArea(t.getLocation()))
- return true;
- }
- return false;
- }
- });
- if (npc != null)
- return npc;
- return null;
- }
- private RSNPC interactingNpc() {
- return npcs.getNearest(new Filter<RSNPC>() {
- public boolean accept(RSNPC n) {
- if (n.getInteracting() == null) {
- return false;
- }
- return n.getInteracting().equals(players.getMyPlayer());
- }
- });
- }
- private boolean onTile(final RSTile tile, final String action,
- final double dx, final double dy, final int height) {
- Point checkScreen;
- try {
- checkScreen = calc.tileToScreen(tile, dx, dy, height);
- if (!calc.pointOnScreen(checkScreen)) {
- if (calc.distanceTo(tile) <= 8) {
- if (getMyPlayer().isMoving()) {
- return false;
- }
- walking.walkTileMM(tile);
- walking.sleep(1000);
- return false;
- }
- return false;
- }
- } catch (final Exception e) {
- }
- try {
- boolean stop = false;
- for (int i = 0; i <= 50; i++) {
- checkScreen = calc.tileToScreen(tile, dx, dy, height);
- if (!calc.pointOnScreen(checkScreen)) {
- return false;
- }
- mouse.move(checkScreen);
- final Object[] menuItems = menu.getItems();
- for (int a = 0; a < menuItems.length; a++) {
- if (menuItems[a].toString().toLowerCase().contains(action.toLowerCase())) {
- stop = true;
- break;
- }
- }
- if (stop) {
- break;
- }
- }
- } catch (final Exception e) {
- }
- try {
- return menu.doAction(action);
- } catch (final Exception e) {
- }
- return false;
- }
- private boolean onPoint(final Point point, final String action) {
- Point p = point;
- if (!calc.pointOnScreen(p))
- return false;
- try {
- boolean stop = false;
- for (int i = 0; i <= 50; i++) {
- mouse.move(p);
- final Object[] menuItems = menu.getItems();
- for (int a = 0; a < menuItems.length; a++) {
- if (menuItems[a].toString().toLowerCase().contains(action.toLowerCase())) {
- stop = true;
- break;
- }
- }
- if (stop)
- break;
- }
- return menu.doAction(action);
- } catch (final java.lang.Exception e) {
- }
- return false;
- }
- private RSComponent selectItem(final String[] item, final String disallow) {
- RSItem[] items = inventory.getItems();
- if (items == null)
- return null;
- for (final RSItem i : items) {
- for (final String s : item) {
- if (i.getID() != -1 && i.getName().toLowerCase().contains(s) && !i.getName().toLowerCase().contains(disallow))
- return i.getComponent();
- }
- }
- return null;
- }
- private RSComponent selectItem(final String... item) {
- RSItem[] items = inventory.getItems();
- if (items == null)
- return null;
- for (final RSItem i : items) {
- for (final String s : item) {
- if (i.getID() != -1 && i.getName().toLowerCase().contains(s))
- return i.getComponent();
- }
- }
- return null;
- }
- private RSComponent searchBank(final int... item) {
- if (!interfaces.getComponent(762).isValid())
- return null;
- for (int i = 0; i < 516; i++) {
- RSComponent c = interfaces.getComponent(762, 93).getComponent(i);
- if (c.getRelativeX() <= 0 || c.getAbsoluteY() > 320)
- continue;
- for (final int x : item) {
- if (c.getComponentID() == x)
- return c;
- }
- if (c.getComponentID() == -1)
- break;
- }
- return null;
- }
- private RSObject tileObjectCheck(RSTile tile, int obj) {
- RSObject[] objs = objects.getAllAt(tile);
- if (objs == null)
- return null;
- for (RSObject o : objs) {
- if (o.getID() == obj) {
- return o;
- }
- }
- return null;
- }
- private void startRunning(final int energy) {
- if (nextRun < System.currentTimeMillis() && walking.getEnergy() >= energy && !walking.isRunEnabled()) {
- nextRun = System.currentTimeMillis() + 7000;
- runEnergy = random(40, 95);
- walking.setRun(true);
- sleep(random(400, 600));
- }
- }
- private boolean valid() {
- return game.isLoggedIn();
- }
- //-----------MOUSE LISTENER-----------\\
- public void mouseClicked(MouseEvent arg0) {
- }
- public void mouseEntered(MouseEvent arg0) {
- }
- public void mouseExited(MouseEvent arg0) {
- }
- public void mouseReleased(MouseEvent arg0) {
- }
- public void mousePressed(MouseEvent e) {
- Point p = e.getPoint();
- if (startPaint) {
- if (stage > 0 && stage < 9) {
- if (setup.prev.contains(p)) {
- if (stage == 6 && !doBanking)
- stage -= 3;
- else
- stage--;
- }
- }
- switch (stage) {
- case 0:
- if (new Rectangle(149, 361, 204, 28).contains(p))
- stage = 1;
- if (new Rectangle(156, 411, 188, 26).contains(p))
- stage = 9;
- break;
- case 1:
- if (guiDefine)
- if (setup.next.contains(p)) {
- stage++;
- startLoc = getMyPlayer().getLocation();
- }
- if (new Rectangle(126, 389, 253, 28).contains(p)) {
- if (!guiOpen) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- WhiteBearGUI gui = new WhiteBearGUI();
- gui.WhiteBearGUI.setVisible(true);
- }
- }
- );
- guiOpen = true;
- }
- }
- break;
- case 2:
- if (setup.next.contains(p))
- stage++;
- if (usePrayer) {
- if (new Rectangle(291, 370, 38, 22).contains(p))
- usePrayer = false;
- } else {
- if (new Rectangle(260, 370, 38, 22).contains(p))
- usePrayer = true;
- }
- if (usePrayerPotion) {
- if (new Rectangle(291, 401, 38, 22).contains(p))
- usePrayerPotion = false;
- } else {
- if (new Rectangle(260, 401, 38, 22).contains(p))
- usePrayerPotion = true;
- }
- if (usePrayerLogout) {
- if (new Rectangle(291, 431, 38, 22).contains(p))
- usePrayerLogout = false;
- } else {
- if (new Rectangle(260, 431, 38, 22).contains(p))
- usePrayerLogout = true;
- }
- break;
- case 3:
- if (setup.next.contains(p)) {
- safeSpot = getMyPlayer().getLocation();
- if (doBanking) {
- stage++;
- } else {
- stage += 3;
- }
- }
- if (cabbage) {
- if (new Rectangle(278, 427, 205, 21).contains(p))
- cabbage = false;
- } else {
- if (new Rectangle(251, 428, 234, 21).contains(p))
- cabbage = true;
- }
- break;
- case 4:
- if (pathRecord == 0) {
- if (new Rectangle(86, 408, 59, 22).contains(p)) {
- env.setUserInput(1 | 2);
- banker.actionsList.clear();
- Action a = new Action(getMyPlayer().getLocation(), game.getPlane());
- banker.actionsList.add(a);
- pathRecord = 1;
- }
- } else if (pathRecord == 1) {
- if (new Rectangle(85, 406, 52, 22).contains(p)) {
- env.setUserInput(2);
- pathRecord = 2;
- guiOpen2 = false;
- }
- if (new Rectangle(339, 428, 144, 20).contains(p)) {
- if (!guiOpen2) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- WhiteBearGUI2 gui2 = new WhiteBearGUI2();
- gui2.WhiteBearGUI.setVisible(true);
- }
- }
- );
- guiOpen2 = true;
- }
- }
- } else {
- if (setup.next.contains(p)) {
- doBanking = true;
- guiOpen2 = false;
- stage++;
- }
- if (new Rectangle(85, 406, 52, 22).contains(p))
- pathRecord = 0;
- }
- break;
- case 5:
- if (pathRecordBack == 0) {
- if (new Rectangle(86, 408, 59, 22).contains(p)) {
- env.setUserInput(1 | 2);
- banker.actionsListReverse.clear();
- Action aa = new Action(getMyPlayer().getLocation(), game.getPlane());
- banker.actionsListReverse.add(aa);
- pathRecordBack = 1;
- }
- } else if (pathRecordBack == 1) {
- if (new Rectangle(85, 406, 52, 22).contains(p)) {
- env.setUserInput(2);
- pathRecordBack = 2;
- guiOpen2 = false;
- }
- if (new Rectangle(339, 428, 144, 20).contains(p)) {
- if (!guiOpen2) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- WhiteBearGUI2 gui2 = new WhiteBearGUI2();
- gui2.WhiteBearGUI.setVisible(true);
- }
- }
- );
- guiOpen2 = true;
- }
- }
- } else {
- if (setup.next.contains(p)) {
- guiOpen2 = false;
- stage++;
- }
- if (new Rectangle(85, 406, 52, 22).contains(p))
- pathRecordBack = 0;
- }
- break;
- case 6:
- if (setup.next.contains(p)) {
- logoutLevel = skills.getCurrentLevel(logoutSkillsID[logoutSkill]);
- stage++;
- }
- if (new Rectangle(183, 423, 12, 12).contains(p) && antibanAmt < 2)
- antibanAmt++;
- if (new Rectangle(88, 423, 12, 12).contains(p) && antibanAmt > 0)
- antibanAmt--;
- if (Bbreaking) {
- if (new Rectangle(444, 423, 12, 12).contains(p) && breakAmt < 4)
- breakAmt++;
- if (new Rectangle(314, 423, 12, 12).contains(p) && breakAmt > 0)
- breakAmt--;
- if (new Rectangle(385, 376, 38, 22).contains(p))
- Bbreaking = false;
- } else {
- if (new Rectangle(352, 376, 38, 22).contains(p))
- Bbreaking = true;
- }
- if (chatResponder) {
- if (new Rectangle(177, 376, 38, 22).contains(p))
- chatResponder = false;
- } else {
- if (new Rectangle(144, 376, 38, 22).contains(p))
- chatResponder = true;
- }
- break;
- case 7:
- if (new Rectangle(407, 423, 57, 19).contains(p)) {
- stage++;
- useLogout = false;
- }
- if (setup.next.contains(p)) {
- stage++;
- useLogout = true;
- }
- if (new Rectangle(426, 385, 12, 12).contains(p) && logoutLevel < 99)
- logoutLevel++;
- if (new Rectangle(364, 385, 12, 12).contains(p) && logoutLevel > skills.getCurrentLevel(logoutSkillsID[logoutSkill]))
- logoutLevel--;
- if (new Rectangle(230, 385, 12, 12).contains(p) && logoutSkill < 5) {
- logoutSkill++;
- logoutLevel = skills.getCurrentLevel(logoutSkillsID[logoutSkill]);
- }
- if (new Rectangle(118, 385, 12, 12).contains(p) && logoutSkill > 0) {
- logoutSkill--;
- logoutLevel = skills.getCurrentLevel(logoutSkillsID[logoutSkill]);
- }
- break;
- case 8:
- int i = 0;
- if (new Rectangle(59, 371, 429, 15).contains(p))
- i = 1;
- if (new Rectangle(59, 386, 429, 15).contains(p))
- i = 2;
- if (new Rectangle(59, 401, 429, 15).contains(p))
- i = 3;
- if (new Rectangle(59, 416, 429, 15).contains(p))
- i = 4;
- if (new Rectangle(59, 431, 429, 15).contains(p))
- i = 5;
- if (new Rectangle(59, 371, 429, 75).contains(p)) {
- // Saving profile
- allLoots = null;
- banker.actions = banker.actionsList.toArray(new Action[banker.actionsList.size()]);
- banker.actionsReverse = banker.actionsListReverse.toArray(new Action[banker.actionsListReverse.size()]);
- stage += 2;
- if (buryBones)
- allLoots = addElement("bones", allLoots);
- Properties WBini = new Properties();
- WBini.setProperty("LoadData", Integer.toString(loadData));
- WBini.setProperty("MobNames", mobNames);
- WBini.setProperty("EatFood", Boolean.toString(eatFood));
- if (eatFood)
- WBini.setProperty("FoodInt", Integer.toString(foodInt));
- WBini.setProperty("Looting", Boolean.toString(looting));
- if (looting)
- WBini.setProperty("ItemNames", itemNames);
- WBini.setProperty("BankType", Integer.toString(banker.bankType));
- WBini.setProperty("FoodLimit", Integer.toString(banker.foodLimit));
- WBini.setProperty("BankMode", Integer.toString(banker.bankMode));
- WBini.setProperty("Priority", Integer.toString(priority));
- WBini.setProperty("MinHealth", Integer.toString(minHealth));
- WBini.setProperty("MaxDist", Integer.toString(maxDist));
- WBini.setProperty("BreakAmt", Integer.toString(breakAmt));
- WBini.setProperty("AntibanAmt", Integer.toString(antibanAmt));
- WBini.setProperty("LogoutSkill", Integer.toString(logoutSkill));
- WBini.setProperty("RandLength", Integer.toString(randLength));
- WBini.setProperty("MidLength", Integer.toString(midLength));
- WBini.setProperty("RandTime", Integer.toString(randTime));
- WBini.setProperty("MidTime", Integer.toString(midTime));
- WBini.setProperty("WithdrawFood", Boolean.toString(banker.withdrawFood));
- WBini.setProperty("StayArea", Boolean.toString(stayArea));
- WBini.setProperty("Ranging", Boolean.toString(ranging));
- WBini.setProperty("Multiway", Boolean.toString(multiway));
- WBini.setProperty("IdsInstead", Boolean.toString(idsInstead));
- WBini.setProperty("buryBones", Boolean.toString(buryBones));
- WBini.setProperty("Bbreaking", Boolean.toString(Bbreaking));
- WBini.setProperty("doBanking", Boolean.toString(doBanking));
- WBini.setProperty("ChatResponder", Boolean.toString(chatResponder));
- WBini.setProperty("Cabbage", Boolean.toString(cabbage));
- WBini.setProperty("UseBones", Boolean.toString(useBones));
- WBini.setProperty("UseAlch", Boolean.toString(useAlch));
- WBini.setProperty("UseLow", Boolean.toString(useLow));
- WBini.setProperty("UseTabs", Boolean.toString(useTabs));
- WBini.setProperty("UsePrayer", Boolean.toString(usePrayer));
- WBini.setProperty("UsePrayerPotion", Boolean.toString(usePrayerPotion));
- WBini.setProperty("UsePrayerLogout", Boolean.toString(usePrayerLogout));
- WBini.setProperty("SafeSpotX", Integer.toString(safeSpot.getX()));
- WBini.setProperty("SafeSpotY", Integer.toString(safeSpot.getY()));
- WBini.setProperty("StartLocX", Integer.toString(startLoc.getX()));
- WBini.setProperty("StartLocY", Integer.toString(startLoc.getY()));
- if (doBanking) {
- String t = "";
- for (Action a : banker.actions) {
- if (t.length() > 0)
- t += "/";
- t += a.toString();
- }
- WBini.setProperty("PathToBank", t);
- t = "";
- for (Action a : banker.actionsReverse) {
- if (t.length() > 0)
- t += "/";
- t += a.toString();
- }
- WBini.setProperty("PathToMob", t);
- }
- try {
- WBini.store(new FileWriter(new File(Configuration.Paths.getScriptCacheDirectory(),
- "WhiteBearAIOFighter" + i + ".ini")),
- "Profile Slot " + i + " of White Bear AIO Fighter (Version: " + Double.toString(properties.version()) + ")");
- } catch (java.lang.Exception ioe) {
- log.warning("[GUI] Error occurred when saving profile slot " + i + "!");
- }
- }
- break;
- case 9:
- if (new Rectangle(446, 347, 46, 15).contains(p))
- stage = 0;
- int ii = 0;
- if (new Rectangle(59, 371, 429, 15).contains(p) && !slots[0].contains("(Empty Slot)"))
- ii = 1;
- if (new Rectangle(59, 386, 429, 15).contains(p) && !slots[1].contains("(Empty Slot)"))
- ii = 2;
- if (new Rectangle(59, 401, 429, 15).contains(p) && !slots[2].contains("(Empty Slot)"))
- ii = 3;
- if (new Rectangle(59, 416, 429, 15).contains(p) && !slots[3].contains("(Empty Slot)"))
- ii = 4;
- if (new Rectangle(59, 431, 429, 15).contains(p) && !slots[4].contains("(Empty Slot)"))
- ii = 5;
- if (ii > 0) {
- // Loading
- Properties WBini = new Properties();
- try {
- WBini.load(new FileInputStream(new File(Configuration.Paths.getScriptCacheDirectory(), "WhiteBearAIOFighter" + ii + ".ini")));
- } catch (java.lang.Exception ee) {
- log.warning("[GUI] Error occurred when loading profile, logging out!");
- log.info("[GUI] You should make a new profile instead.");
- logOutR = true;
- }
- try {
- int load = Integer.parseInt(WBini.getProperty("LoadData"));
- if (load == loadData) {
- allLoots = null;
- mobNames = WBini.getProperty("MobNames");
- mobName = mobNames.split(",");
- eatFood = Boolean.parseBoolean(WBini.getProperty("EatFood"));
- if (eatFood) {
- foodInt = Integer.parseInt(WBini.getProperty("FoodInt"));
- }
- looting = Boolean.parseBoolean(WBini.getProperty("Looting"));
- if (looting) {
- itemNames = WBini.getProperty("ItemNames");
- String[] itemNamexz = itemNames.split(",");
- String[] names = new String[itemNamexz.length];
- for (int ic = 0; ic < itemNamexz.length; ic++) {
- names[ic] = itemNamexz[ic].trim();
- }
- userLoots = names;
- }
- banker.bankType = Integer.parseInt(WBini.getProperty("BankType"));
- banker.foodLimit = Integer.parseInt(WBini.getProperty("FoodLimit"));
- banker.bankMode = Integer.parseInt(WBini.getProperty("BankMode"));
- priority = Integer.parseInt(WBini.getProperty("Priority"));
- minHealth = Integer.parseInt(WBini.getProperty("MinHealth"));
- maxDist = Integer.parseInt(WBini.getProperty("MaxDist"));
- breakAmt = Integer.parseInt(WBini.getProperty("BreakAmt"));
- antibanAmt = Integer.parseInt(WBini.getProperty("AntibanAmt"));
- logoutSkill = Integer.parseInt(WBini.getProperty("LogoutSkill"));
- randLength = Integer.parseInt(WBini.getProperty("RandLength"));
- midLength = Integer.parseInt(WBini.getProperty("MidLength"));
- randTime = Integer.parseInt(WBini.getProperty("RandTime"));
- midTime = Integer.parseInt(WBini.getProperty("MidTime"));
- banker.withdrawFood = Boolean.parseBoolean(WBini.getProperty("WithdrawFood"));
- stayArea = Boolean.parseBoolean(WBini.getProperty("StayArea"));
- ranging = Boolean.parseBoolean(WBini.getProperty("Ranging"));
- buryBones = Boolean.parseBoolean(WBini.getProperty("BuryBones"));
- multiway = Boolean.parseBoolean(WBini.getProperty("Multiway"));
- idsInstead = Boolean.parseBoolean(WBini.getProperty("IdsInstead"));
- if (idsInstead) {
- int[] id = new int[mobName.length];
- for (int i1 = 0; i1 < mobName.length; i1++) {
- id[i1] = Integer.parseInt(mobName[i1]);
- }
- mobId = id;
- }
- if (buryBones)
- allLoots = addElement("bones", allLoots);
- Bbreaking = Boolean.parseBoolean(WBini.getProperty("Bbreaking"));
- doBanking = Boolean.parseBoolean(WBini.getProperty("doBanking"));
- chatResponder = Boolean.parseBoolean(WBini.getProperty("ChatResponder"));
- cabbage = Boolean.parseBoolean(WBini.getProperty("Cabbage"));
- useBones = Boolean.parseBoolean(WBini.getProperty("UseBones"));
- useAlch = Boolean.parseBoolean(WBini.getProperty("UseAlch"));
- useLow = Boolean.parseBoolean(WBini.getProperty("UseLow"));
- useTabs = Boolean.parseBoolean(WBini.getProperty("UseTabs"));
- usePrayer = Boolean.parseBoolean(WBini.getProperty("UsePrayer"));
- usePrayerPotion = Boolean.parseBoolean(WBini.getProperty("UsePrayerPotion"));
- usePrayerLogout = Boolean.parseBoolean(WBini.getProperty("UsePrayerLogout"));
- int sx = 0, sy = 0, px = 0, py = 0;
- sx = Integer.parseInt(WBini.getProperty("SafeSpotX"));
- sy = Integer.parseInt(WBini.getProperty("SafeSpotY"));
- px = Integer.parseInt(WBini.getProperty("StartLocX"));
- py = Integer.parseInt(WBini.getProperty("StartLocY"));
- safeSpot = new RSTile(sx, sy);
- startLoc = new RSTile(px, py);
- if (doBanking) {
- banker.actionsList.clear();
- String[] t = WBini.getProperty("PathToBank").split("/");
- for (int x = 0; x < t.length; x++) {
- String[] div = t[x].split(",");
- if (div != null) {
- if (div.length == 5) {
- Action a = new Action(new RSTile(Integer.parseInt(div[0]), Integer.parseInt(div[1])),
- Integer.parseInt(div[2]), Integer.parseInt(div[3]), Integer.parseInt(div[4]), "nil");
- banker.actionsList.add(a);
- } else {
- Action a = new Action(new RSTile(Integer.parseInt(div[0]), Integer.parseInt(div[1])),
- Integer.parseInt(div[2]), Integer.parseInt(div[3]), Integer.parseInt(div[4]), div[5]);
- banker.actionsList.add(a);
- }
- }
- }
- banker.actions = banker.actionsList.toArray(new Action[banker.actionsList.size()]);
- banker.actionsListReverse.clear();
- String[] t2 = WBini.getProperty("PathToMob").split("/");
- for (int x = 0; x < t.length; x++) {
- String[] div = t2[x].split(",");
- if (div != null) {
- if (div.length == 5) {
- Action a = new Action(new RSTile(Integer.parseInt(div[0]), Integer.parseInt(div[1])),
- Integer.parseInt(div[2]), Integer.parseInt(div[3]), Integer.parseInt(div[4]), "nil");
- banker.actionsListReverse.add(a);
- } else {
- Action a = new Action(new RSTile(Integer.parseInt(div[0]), Integer.parseInt(div[1])),
- Integer.parseInt(div[2]), Integer.parseInt(div[3]), Integer.parseInt(div[4]), div[5]);
- banker.actionsListReverse.add(a);
- }
- }
- }
- banker.actionsReverse = banker.actionsListReverse.toArray(new Action[banker.actionsListReverse.size()]);
- }
- } else {
- log.warning("[GUI] This profile is not compatible with this version of the script.");
- log.info("[GUI] You should create a new profile instead.");
- stopScript();
- return;
- }
- } catch (Throwable ax) {
- log.log(Level.SEVERE, "Error loading profile: ", ax);
- log.warning("[GUI] Error occurred when loading profile, logging out!");
- logOutR = true;
- }
- stage++;
- }
- break;
- case 10:
- if (new Rectangle(166, 404, 50, 20).contains(p)) {
- stage++;
- checkUpdate = true;
- }
- if (new Rectangle(247, 404, 50, 20).contains(p)) {
- stage++;
- checkUpdate = false;
- }
- break;
- case 11:
- break;
- }
- } else {
- if (game.getClientState() == 10) {
- if (new Rectangle(481, 344, 15, 15).contains(p)) {
- if (thePainter.showPaint)
- thePainter.showPaint = false;
- else
- thePainter.showPaint = true;
- }
- if (thePainter.showPaint) {
- if (new Rectangle(416, 443, 80, 15).contains(p)) {
- if (totalMode)
- totalMode = false;
- else
- totalMode = true;
- }
- if (!totalMode) {
- if (new Rectangle(462, 352, 12, 12).contains(p)) {
- if (thePainter.paintSkill < 6)
- thePainter.paintSkill++;
- else
- thePainter.paintSkill = 0;
- }
- if (new Rectangle(16, 352, 12, 12).contains(p)) {
- if (thePainter.paintSkill > 0)
- thePainter.paintSkill--;
- else
- thePainter.paintSkill = 6;
- }
- }
- }
- }
- }
- }
- private String[] addElement(String n, String[] oldArray) {
- if (oldArray == null) {
- return new String[]{n};
- }
- String[] newarray = new String[oldArray.length + 1];
- for (int i = 0; i < oldArray.length; i++) {
- newarray[i] = oldArray[i];
- }
- newarray[oldArray.length] = n;
- return newarray;
- }
- private int[] addElement(int n, int[] oldArray) {
- if (oldArray == null) {
- return new int[]{n};
- }
- int[] newarray = new int[oldArray.length + 1];
- for (int i = 0; i < oldArray.length; i++) {
- newarray[i] = oldArray[i];
- }
- newarray[oldArray.length] = n;
- return newarray;
- }
- //-----------CHAT RESPONDER-----------\\
- private class ChatResponder extends Thread {
- char[] quickChat = {'z', 'g', 'd', 'l', 'r', 'm', 'y'};
- int[] skillID = {0, 2, 1, 3, 4, 6, 5};
- long lastSaidHi = System.currentTimeMillis() - 110000, lastDenyBot = System.currentTimeMillis() - 110000;
- long nextModAlert = System.currentTimeMillis(), sayNo = System.currentTimeMillis();
- long[] lastSaidLevel = {System.currentTimeMillis() - 110000, System.currentTimeMillis() - 110000,
- System.currentTimeMillis() - 110000, System.currentTimeMillis() - 110000, System.currentTimeMillis() - 110000, System.currentTimeMillis() - 110000};
- boolean run = true;
- boolean typing = false; //read by antiban (true = suppress antiban)
- boolean wait = false; //written by antiban (true = chat responder will wait)
- boolean pause = false; //true if look away from screen is active
- //Chat Responder Customization
- String[] skillName = {"atk", "str", "def", "hp", "ranged", "magic", "prayer"};
- String[] tradeRes = {"no thanks", "no thx", "nope", "im fine"};
- String[] greetingRes = {"hi!", "hi.", "hi", "hello", "hello!", "hello.", "hello..", "yo", "yo!", "yes?", "what", "what?", "hey!"};
- String[] botterRes = {"huh", "zzz", "...", "???", "?????", "what", "what?", "no", "nop", "nope"};
- String[][] match = {{"atk", "attac", "atttac", "attck"}, {"str", "stengt", "strengt"}, {"def", "defence", "defense"},
- {"hitpoints", "hp", "const", "constitution"}, {"range", "rannge"}, {"magic", "mage"}, {"pray", "prray"}};
- public void run() {
- while (!thePainter.savedStats || getChatMessage() == null) {
- sleepNE(200);
- }
- while (run) {
- try {
- if (game.getClientState() == 10 && !pause) {
- if (useChatRes && tradeResponse) {
- if (sayNo < System.currentTimeMillis()) {
- tradeResponse = false;
- int timeOut = random(110000, 130000);
- sayNo = System.currentTimeMillis() + timeOut;
- sleepNE(random(300, 700));
- String[] res = tradeRes;
- int rand = random(0, res.length);
- sendText(res[rand]);
- log("[Response] Said No to a Trade Request. Timeout: " + timeOut / 1000 + " sec");
- }
- }
- String m = getChatMessage().toLowerCase();
- if (m != null && !m.equals(lastMessage) && (m.contains(getMyPlayer().getName().toLowerCase() + ": <") != true)) {
- if (useChatRes) {
- response(m);
- } else {
- sleepNE(random(700, 850));
- }
- lastMessage = m;
- } else {
- sleepNE(random(600, 700));
- }
- } else {
- sleepNE(random(300, 400));
- }
- } catch (java.lang.Throwable t) {
- }
- }
- }
- private boolean findText(String t, String[] check) {
- String[] m = check;
- for (int i = 0; i < m.length; i++) {
- if (t.contains(m[i])) {
- return true;
- }
- }
- return false;
- }
- private void response(String m) {
- for (int i = 0; i < 7; i++) {
- if ((System.currentTimeMillis() - 150000) >= lastSaidLevel[i]) {
- if (findText(m, match[i]) && findText(m, new String[]{"level", "levl", "lvel", "lvl"})) {
- lastSaidLevel[i] = System.currentTimeMillis();
- resCount++;
- sleepNE(random(600, 2000));
- final int random = random(1, 11);
- if (random == 1) {
- sendText(skillName[i] + " lvl " + skills.getCurrentLevel(skillID[i]));
- } else if (random == 2) {
- sendText("level: " + skills.getCurrentLevel(skillID[i]));
- } else if (random == 3) {
- sendText("" + skills.getCurrentLevel(skillID[i]));
- } else if (random == 4) {
- sendText("mines " + skills.getCurrentLevel(skillID[i]));
- } else if (random == 5) {
- sendText("lv " + skills.getCurrentLevel(skillID[i]));
- } else if (random == 6) {
- sendText(Integer.toString(skills.getCurrentLevel(skillID[i])));
- } else if (random > 6) {
- sleepNE(random(100, 200));
- keyboard.sendKey((char) KeyEvent.VK_ENTER);
- sleepNE(random(800, 1300));
- keyboard.sendKey('S');
- sleepNE(random(800, 1300));
- keyboard.sendKey(quickChat[i]);
- sleepNE(random(800, 1300));
- keyboard.sendKey('2');
- }
- log("[Response] Answered to Level Question: '" + m + "'");
- sleepNE(random(200, 300));
- return;
- }
- }
- }
- if (findText(m, new String[]{"bottin", "botin", "botttin", "botter", "bottter", "boter", "bootin", "boottin", "booter", "bootter"})) {
- if (m.contains("?") || m.contains(getMyPlayer().getName().toLowerCase()) || m.contains("!")) {
- if ((System.currentTimeMillis() - 130000) >= lastDenyBot) {
- lastDenyBot = System.currentTimeMillis();
- resCount++;
- sleepNE(random(600, 2000));
- String[] bot = botterRes;
- final int random3 = random(0, bot.length);
- sendText(bot[random3]);
- log("[Response] Answered to Botting Message: '" + m + "'");
- sleepNE(random(150, 250));
- return;
- }
- }
- }
- if (findText(m, new String[]{"hi ", "hello", "hi<", "hey", "hi!", "hi.", "yo!", "yo.", "yo<"})) {
- if ((System.currentTimeMillis() - 130000) >= lastSaidHi) {
- lastSaidHi = System.currentTimeMillis();
- resCount++;
- sleepNE(random(600, 1600));
- String[] hi = greetingRes;
- final int random2 = random(0, hi.length);
- sendText(hi[random2]);
- log("[Response] Answered to Greeting: '" + m + "'");
- sleepNE(random(150, 250));
- return;
- }
- }
- sleepNE(random(650, 750));
- }
- private void sendText(final String text) {
- final char[] chs = text.toCharArray();
- typing = true;
- if (wait) {
- for (int i = 0; i < 21; i++) {
- sleepNE(10);
- if (!wait) {
- i = 21;
- }
- }
- }
- for (final char element : chs) {
- keyboard.sendKey(element);
- sleepNE(random(280, 550));
- }
- keyboard.sendKey((char) KeyEvent.VK_ENTER);
- typing = false;
- }
- private String getChatMessage() {
- try {
- String text = null;
- for (int x = 280; x >= 180; x--) {
- if (interfaces.get(137).getComponent(x).getText() != null) {
- if (interfaces.get(137).getComponent(x).getText().contains("<col=")) {
- text = interfaces.get(137).getComponent(x).getText();
- break;
- }
- }
- }
- return text;
- } catch (Exception e) {
- }
- return null;
- }
- private void sleepNE(int ms) {
- try {
- Thread.sleep(ms);
- } catch (Exception e) {
- }
- }
- }
- //-----------------GUI----------------\\
- private class WhiteBearGUI {
- private static final long serialVersionUID = 1L;
- private WhiteBearGUI() {
- initComponents();
- }
- private void jRadioButton2ActionPerformed(ActionEvent e) {
- if (jRadioButton2.isSelected()) {
- tbDistance.setEnabled(true);
- } else {
- tbDistance.setEnabled(false);
- }
- }
- private void jRadioButton7ActionPerformed(ActionEvent e) {
- if (jRadioButton7.isSelected()) {
- priorityCombo2.setEnabled(true);
- jRadioButton8.setEnabled(true);
- tbFoodAmt.setEnabled(true);
- priorityCombo3.setEnabled(true);
- } else {
- priorityCombo2.setEnabled(false);
- jRadioButton8.setEnabled(false);
- tbFoodAmt.setEnabled(false);
- priorityCombo3.setEnabled(false);
- }
- }
- private void button1ActionPerformed(ActionEvent e) {
- multiway = jRadioButton.isSelected();
- idsInstead = jRadioButton1.isSelected();
- mobNames = tbMobNames.getText().toLowerCase();
- mobName = mobNames.split(",");
- if (idsInstead) {
- int[] id = new int[mobName.length];
- for (int i = 0; i < mobName.length; i++) {
- try {
- id[i] = Integer.parseInt(mobName[i].trim());
- } catch (NumberFormatException nf) {
- id[i] = 0;
- log.severe("[GUI] Error when converting '" + mobName[i].trim() + "' to integer!");
- return;
- }
- }
- mobId = id;
- }
- itemNames = tbItemNames.getText().toLowerCase();
- priority = priorityCombo.getSelectedIndex();
- stayArea = jRadioButton2.isSelected();
- maxDist = Integer.parseInt(tbDistance.getText().trim());
- if (maxDist < 2)
- maxDist = 2;
- if (maxDist > 15)
- maxDist = 15;
- useAlch = jRadioButton5.isSelected();
- useLow = (alchemyCombo.getSelectedIndex() == 0);
- ranging = jRadioButton3.isSelected();
- useBones = jRadioButton6.isSelected();
- if (useBones) {
- eatFood = true;
- log.info("You are using Bones to Peaches, therefore Peaches will be added as a food.");
- }
- useTabs = (bonesCombo2.getSelectedIndex() == 0);
- buryBones = jRadioButton4.isSelected();
- doBanking = jRadioButton7.isSelected();
- banker.bankMode = priorityCombo2.getSelectedIndex();
- banker.foodLimit = Integer.parseInt(tbFoodAmt.getText().trim());
- if (banker.foodLimit < 3) {
- banker.foodLimit = 3;
- log.info("[GUI] Minimum Food Withdraw Amt is 3.");
- }
- if (banker.foodLimit > 28) {
- banker.foodLimit = 28;
- log.info("[GUI] Maximum Food Withdraw Amt is 28.");
- }
- banker.withdrawFood = jRadioButton8.isSelected();
- // Check if looting
- if (itemNames.length() <= 0)
- looting = false;
- else {
- String[] itemNamexz = itemNames.split(",");
- String[] names = new String[itemNamexz.length];
- for (int i = 0; i < itemNamexz.length; i++) {
- names[i] = itemNamexz[i].trim();
- }
- userLoots = names;
- }
- // Check if eating
- if (tbFoodName.getText().length() > 0) {
- foodInt = Integer.parseInt(tbFoodName.getText().trim());
- eatFood = true;
- } else {
- eatFood = false;
- }
- minHealth = Integer.parseInt(tbEatHealth.getText());
- banker.bankType = priorityCombo3.getSelectedIndex();
- guiOpen = false;
- guiDefine = true;
- WhiteBearGUI.dispose();
- }
- private void initComponents() {
- WhiteBearGUI = new JFrame();
- panel1 = new JPanel();
- tabbedPane1 = new JTabbedPane();
- panel6 = new JPanel();
- tbMobNames = new JFormattedTextField();
- label17 = new JLabel();
- jRadioButton = new JCheckBox();
- jRadioButton1 = new JCheckBox();
- jRadioButton2 = new JCheckBox();
- label23 = new JLabel();
- tbDistance = new JFormattedTextField();
- label7 = new JLabel();
- priorityCombo = new JComboBox();
- panel2 = new JPanel();
- jRadioButton5 = new JCheckBox();
- alchemyCombo = new JComboBox();
- label6 = new JLabel();
- label18 = new JLabel();
- tbItemNames = new JFormattedTextField();
- jRadioButton3 = new JCheckBox();
- jRadioButton4 = new JCheckBox();
- jRadioButton6 = new JCheckBox();
- bonesCombo2 = new JComboBox();
- panel7 = new JPanel();
- label20 = new JLabel();
- tbFoodName = new JFormattedTextField();
- label21 = new JLabel();
- tbEatHealth = new JFormattedTextField();
- jRadioButton7 = new JCheckBox();
- label8 = new JLabel();
- priorityCombo2 = new JComboBox();
- jRadioButton8 = new JCheckBox();
- tbFoodAmt = new JFormattedTextField();
- label9 = new JLabel();
- label10 = new JLabel();
- priorityCombo3 = new JComboBox();
- button1 = new JButton();
- label1 = new JLabel();
- label2 = new JLabel();
- //======== WhiteBearGUI ========
- {
- WhiteBearGUI.setAlwaysOnTop(true);
- WhiteBearGUI.setBackground(Color.black);
- WhiteBearGUI.setResizable(false);
- WhiteBearGUI.setMinimumSize(new Dimension(405, 265));
- WhiteBearGUI.setTitle("White Bear AIO Fighter");
- WhiteBearGUI.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- WhiteBearGUI.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- Container WhiteBearGUIContentPane = WhiteBearGUI.getContentPane();
- WhiteBearGUIContentPane.setLayout(null);
- //======== panel1 ========
- {
- panel1.setBackground(Color.black);
- panel1.setForeground(Color.green);
- panel1.setMinimumSize(new Dimension(100, 200));
- panel1.setLayout(null);
- //======== tabbedPane1 ========
- {
- tabbedPane1.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- tabbedPane1.setForeground(new Color(0, 153, 0));
- //======== panel6 ========
- {
- panel6.setBackground(Color.black);
- panel6.setLayout(null);
- //---- tbMobNames ----
- tbMobNames.setFont(new Font("Century Gothic", Font.PLAIN, 14));
- tbMobNames.setForeground(new Color(255, 255, 204));
- tbMobNames.setBackground(Color.gray);
- tbMobNames.setText("green dragon,blue dragon");
- panel6.add(tbMobNames);
- tbMobNames.setBounds(102, 8, 275, 25);
- //---- label17 ----
- label17.setText("Mob Names:");
- label17.setBackground(new Color(51, 51, 51));
- label17.setForeground(new Color(255, 255, 102));
- label17.setFont(new Font("Century Gothic", Font.BOLD, 14));
- panel6.add(label17);
- label17.setBounds(7, 8, 100, 20);
- //---- jRadioButton ----
- jRadioButton.setText("Multiway Combat");
- jRadioButton.setBackground(Color.black);
- jRadioButton.setForeground(Color.yellow);
- jRadioButton.setFont(new Font("Century Gothic", Font.BOLD, 13));
- panel6.add(jRadioButton);
- jRadioButton.setBounds(99, 37, 140, 21);
- //---- jRadioButton1 ----
- jRadioButton1.setText("ID instead of Name");
- jRadioButton1.setBackground(Color.black);
- jRadioButton1.setForeground(Color.yellow);
- jRadioButton1.setFont(new Font("Century Gothic", Font.BOLD, 13));
- panel6.add(jRadioButton1);
- jRadioButton1.setBounds(240, 37, 150, 21);
- //---- jRadioButton2 ----
- jRadioButton2.setText("Stay in Area");
- jRadioButton2.setBackground(Color.black);
- jRadioButton2.setForeground(Color.yellow);
- jRadioButton2.setFont(new Font("Century Gothic", Font.BOLD, 13));
- jRadioButton2.setSelected(true);
- jRadioButton2.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- jRadioButton2ActionPerformed(e);
- }
- });
- panel6.add(jRadioButton2);
- jRadioButton2.setBounds(8, 68, 112, 21);
- //---- label23 ----
- label23.setText("Max Distance:");
- label23.setBackground(new Color(51, 51, 51));
- label23.setForeground(new Color(255, 255, 102));
- label23.setFont(new Font("Century Gothic", Font.BOLD, 14));
- panel6.add(label23);
- label23.setBounds(129, 68, 106, 20);
- //---- tbDistance ----
- tbDistance.setFont(new Font("Century Gothic", Font.PLAIN, 14));
- tbDistance.setForeground(new Color(255, 255, 204));
- tbDistance.setBackground(Color.gray);
- tbDistance.setText("4");
- panel6.add(tbDistance);
- tbDistance.setBounds(237, 67, 53, 25);
- //---- label7 ----
- label7.setText("Priority:");
- label7.setBackground(new Color(51, 51, 51));
- label7.setForeground(new Color(255, 255, 102));
- label7.setFont(new Font("Century Gothic", Font.BOLD, 14));
- panel6.add(label7);
- label7.setBounds(36, 103, 60, 20);
- //---- priorityCombo ----
- priorityCombo.setBackground(Color.black);
- priorityCombo.setForeground(new Color(51, 51, 51));
- priorityCombo.setBorder(null);
- priorityCombo.setFont(new Font("Century Gothic", Font.BOLD, 12));
- priorityCombo.setModel(new DefaultComboBoxModel(new String[]{
- "Normal",
- "Monsters",
- "Items"
- }));
- priorityCombo.setSelectedIndex(0);
- panel6.add(priorityCombo);
- priorityCombo.setBounds(102, 101, 115, 25);
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for (int i = 0; i < panel6.getComponentCount(); i++) {
- Rectangle bounds = panel6.getComponent(i).getBounds();
- preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
- preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
- }
- Insets insets = panel6.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- panel6.setMinimumSize(preferredSize);
- panel6.setPreferredSize(preferredSize);
- }
- }
- tabbedPane1.addTab("Fighting", panel6);
- //======== panel2 ========
- {
- panel2.setBackground(Color.black);
- panel2.setLayout(null);
- //---- jRadioButton5 ----
- jRadioButton5.setText("Use");
- jRadioButton5.setBackground(Color.black);
- jRadioButton5.setForeground(Color.yellow);
- jRadioButton5.setFont(new Font("Century Gothic", Font.BOLD, 13));
- panel2.add(jRadioButton5);
- jRadioButton5.setBounds(9, 48, 51, 21);
- //---- alchemyCombo ----
- alchemyCombo.setBackground(Color.black);
- alchemyCombo.setForeground(new Color(51, 51, 51));
- alchemyCombo.setBorder(null);
- alchemyCombo.setFont(new Font("Century Gothic", Font.BOLD, 12));
- alchemyCombo.setModel(new DefaultComboBoxModel(new String[]{
- "Low",
- "High"
- }));
- alchemyCombo.setSelectedIndex(0);
- panel2.add(alchemyCombo);
- alchemyCombo.setBounds(62, 46, 60, 25);
- //---- label6 ----
- label6.setText("Alchemy");
- label6.setBackground(new Color(51, 51, 51));
- label6.setForeground(Color.yellow);
- label6.setFont(new Font("Century Gothic", Font.BOLD, 13));
- panel2.add(label6);
- label6.setBounds(133, 48, 70, 20);
- //---- label18 ----
- label18.setText("Item Names:");
- label18.setBackground(new Color(51, 51, 51));
- label18.setForeground(new Color(255, 255, 102));
- label18.setFont(new Font("Century Gothic", Font.BOLD, 14));
- panel2.add(label18);
- label18.setBounds(8, 9, 72, 20);
- //---- tbItemNames ----
- tbItemNames.setFont(new Font("Century Gothic", Font.PLAIN, 14));
- tbItemNames.setForeground(new Color(255, 255, 204));
- tbItemNames.setBackground(Color.gray);
- tbItemNames.setText("green dragon,blue dragon");
- panel2.add(tbItemNames);
- tbItemNames.setBounds(90, 8, 288, 25);
- //---- jRadioButton3 ----
- jRadioButton3.setText("Collect Arrows");
- jRadioButton3.setBackground(Color.black);
- jRadioButton3.setForeground(Color.yellow);
- jRadioButton3.setFont(new Font("Century Gothic", Font.BOLD, 13));
- panel2.add(jRadioButton3);
- jRadioButton3.setBounds(256, 48, 120, 21);
- //---- jRadioButton4 ----
- jRadioButton4.setText("Bury Bones");
- jRadioButton4.setBackground(Color.black);
- jRadioButton4.setForeground(Color.yellow);
- jRadioButton4.setFont(new Font("Century Gothic", Font.BOLD, 13));
- panel2.add(jRadioButton4);
- jRadioButton4.setBounds(256, 85, 108, 21);
- //---- jRadioButton6 ----
- jRadioButton6.setText("Use Bones to Peaches");
- jRadioButton6.setBackground(Color.black);
- jRadioButton6.setForeground(Color.yellow);
- jRadioButton6.setFont(new Font("Century Gothic", Font.BOLD, 13));
- panel2.add(jRadioButton6);
- jRadioButton6.setBounds(9, 85, 165, 21);
- //---- bonesCombo2 ----
- bonesCombo2.setBackground(Color.black);
- bonesCombo2.setForeground(new Color(51, 51, 51));
- bonesCombo2.setBorder(null);
- bonesCombo2.setFont(new Font("Century Gothic", Font.BOLD, 12));
- bonesCombo2.setModel(new DefaultComboBoxModel(new String[]{
- "Tab",
- "Spell"
- }));
- bonesCombo2.setSelectedIndex(0);
- panel2.add(bonesCombo2);
- bonesCombo2.setBounds(174, 85, 60, 25);
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for (int i = 0; i < panel2.getComponentCount(); i++) {
- Rectangle bounds = panel2.getComponent(i).getBounds();
- preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
- preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
- }
- Insets insets = panel2.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- panel2.setMinimumSize(preferredSize);
- panel2.setPreferredSize(preferredSize);
- }
- }
- tabbedPane1.addTab("Looting", panel2);
- //======== panel7 ========
- {
- panel7.setBackground(Color.black);
- panel7.setLayout(null);
- //---- label20 ----
- label20.setText("Food ID:");
- label20.setBackground(new Color(51, 51, 51));
- label20.setForeground(new Color(255, 255, 102));
- label20.setFont(new Font("Century Gothic", Font.BOLD, 14));
- panel7.add(label20);
- label20.setBounds(9, 11, 67, 20);
- //---- tbFoodName ----
- tbFoodName.setFont(new Font("Century Gothic", Font.PLAIN, 14));
- tbFoodName.setForeground(new Color(255, 255, 204));
- tbFoodName.setBackground(Color.gray);
- tbFoodName.setText("190");
- panel7.add(tbFoodName);
- tbFoodName.setBounds(81, 9, 54, 25);
- //---- label21 ----
- label21.setText("Eat when health is below");
- label21.setBackground(new Color(51, 51, 51));
- label21.setForeground(new Color(255, 255, 102));
- label21.setFont(new Font("Century Gothic", Font.BOLD, 14));
- panel7.add(label21);
- label21.setBounds(146, 11, 173, 20);
- //---- tbEatHealth ----
- tbEatHealth.setFont(new Font("Century Gothic", Font.PLAIN, 14));
- tbEatHealth.setForeground(new Color(255, 255, 204));
- tbEatHealth.setBackground(Color.gray);
- tbEatHealth.setText("100");
- panel7.add(tbEatHealth);
- tbEatHealth.setBounds(319, 9, 60, 25);
- //---- jRadioButton7 ----
- jRadioButton7.setText("Enable Banking");
- jRadioButton7.setBackground(Color.black);
- jRadioButton7.setForeground(Color.yellow);
- jRadioButton7.setFont(new Font("Century Gothic", Font.BOLD, 13));
- jRadioButton7.setSelected(true);
- jRadioButton7.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- jRadioButton7ActionPerformed(e);
- }
- });
- panel7.add(jRadioButton7);
- jRadioButton7.setBounds(10, 44, 130, 21);
- //---- label8 ----
- label8.setText("Bank Mode:");
- label8.setBackground(new Color(51, 51, 51));
- label8.setForeground(new Color(255, 255, 102));
- label8.setFont(new Font("Century Gothic", Font.BOLD, 14));
- panel7.add(label8);
- label8.setBounds(24, 76, 90, 20);
- //---- priorityCombo2 ----
- priorityCombo2.setBackground(Color.black);
- priorityCombo2.setForeground(new Color(51, 51, 51));
- priorityCombo2.setBorder(null);
- priorityCombo2.setFont(new Font("Century Gothic", Font.BOLD, 12));
- priorityCombo2.setModel(new DefaultComboBoxModel(new String[]{
- "Banker",
- "Bank Booth",
- "Bank Chest"
- }));
- priorityCombo2.setSelectedIndex(0);
- panel7.add(priorityCombo2);
- priorityCombo2.setBounds(124, 74, 124, 25);
- //---- jRadioButton8 ----
- jRadioButton8.setText("Withdraw at most");
- jRadioButton8.setBackground(Color.black);
- jRadioButton8.setForeground(Color.yellow);
- jRadioButton8.setFont(new Font("Century Gothic", Font.BOLD, 13));
- panel7.add(jRadioButton8);
- jRadioButton8.setBounds(24, 112, 140, 21);
- //---- tbFoodAmt ----
- tbFoodAmt.setFont(new Font("Century Gothic", Font.PLAIN, 14));
- tbFoodAmt.setForeground(new Color(255, 255, 204));
- tbFoodAmt.setBackground(Color.gray);
- tbFoodAmt.setText("28");
- panel7.add(tbFoodAmt);
- tbFoodAmt.setBounds(165, 110, 40, 25);
- //---- label9 ----
- label9.setText("food");
- label9.setBackground(new Color(51, 51, 51));
- label9.setForeground(Color.yellow);
- label9.setFont(new Font("Century Gothic", Font.BOLD, 13));
- panel7.add(label9);
- label9.setBounds(213, 112, 48, 20);
- //---- label10 ----
- label10.setText("Bank when:");
- label10.setBackground(new Color(51, 51, 51));
- label10.setForeground(new Color(255, 255, 102));
- label10.setFont(new Font("Century Gothic", Font.BOLD, 14));
- panel7.add(label10);
- label10.setBounds(154, 44, 80, 20);
- //---- priorityCombo3 ----
- priorityCombo3.setBackground(Color.black);
- priorityCombo3.setForeground(new Color(51, 51, 51));
- priorityCombo3.setBorder(null);
- priorityCombo3.setFont(new Font("Century Gothic", Font.BOLD, 12));
- priorityCombo3.setModel(new DefaultComboBoxModel(new String[]{
- "Out of food",
- "Inventory Full"
- }));
- priorityCombo3.setSelectedIndex(0);
- panel7.add(priorityCombo3);
- priorityCombo3.setBounds(241, 43, 135, 25);
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for (int i = 0; i < panel7.getComponentCount(); i++) {
- Rectangle bounds = panel7.getComponent(i).getBounds();
- preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
- preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
- }
- Insets insets = panel7.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- panel7.setMinimumSize(preferredSize);
- panel7.setPreferredSize(preferredSize);
- }
- }
- tabbedPane1.addTab("Others", panel7);
- }
- panel1.add(tabbedPane1);
- tabbedPane1.setBounds(10, 47, 393, 178);
- //---- button1 ----
- button1.setText("Done Configuring");
- button1.setBackground(Color.black);
- button1.setFont(new Font("Century Gothic", Font.BOLD, 16));
- button1.setForeground(new Color(0, 102, 51));
- button1.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- button1ActionPerformed(e);
- }
- });
- panel1.add(button1);
- button1.setBounds(96, 233, 205, 35);
- //---- label1 ----
- label1.setText("White Bear AIO Fighter");
- label1.setBackground(new Color(51, 51, 51));
- label1.setForeground(new Color(153, 255, 153));
- label1.setFont(new Font("Century Gothic", Font.BOLD, 22));
- panel1.add(label1);
- label1.setBounds(50, 6, 250, 40);
- //---- label2 ----
- label2.setText("Version: " + properties.version());
- label2.setBackground(new Color(51, 51, 51));
- label2.setForeground(new Color(204, 255, 0));
- label2.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- panel1.add(label2);
- label2.setBounds(300, 21, 83, 21);
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for (int i = 0; i < panel1.getComponentCount(); i++) {
- Rectangle bounds = panel1.getComponent(i).getBounds();
- preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
- preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
- }
- Insets insets = panel1.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- panel1.setMinimumSize(preferredSize);
- panel1.setPreferredSize(preferredSize);
- }
- }
- WhiteBearGUIContentPane.add(panel1);
- panel1.setBounds(0, 0, 420, 295);
- WhiteBearGUIContentPane.setPreferredSize(new Dimension(420, 305));
- WhiteBearGUI.setSize(420, 305);
- WhiteBearGUI.setLocationRelativeTo(WhiteBearGUI.getOwner());
- }
- }
- private JFrame WhiteBearGUI;
- private JPanel panel1;
- private JTabbedPane tabbedPane1;
- private JPanel panel6;
- private JFormattedTextField tbMobNames;
- private JLabel label17;
- private JCheckBox jRadioButton;
- private JCheckBox jRadioButton1;
- private JCheckBox jRadioButton2;
- private JLabel label23;
- private JFormattedTextField tbDistance;
- private JLabel label7;
- private JComboBox priorityCombo;
- private JPanel panel2;
- private JCheckBox jRadioButton5;
- private JComboBox alchemyCombo;
- private JLabel label6;
- private JLabel label18;
- private JFormattedTextField tbItemNames;
- private JCheckBox jRadioButton3;
- private JCheckBox jRadioButton4;
- private JCheckBox jRadioButton6;
- private JComboBox bonesCombo2;
- private JPanel panel7;
- private JLabel label20;
- private JFormattedTextField tbFoodName;
- private JLabel label21;
- private JFormattedTextField tbEatHealth;
- private JCheckBox jRadioButton7;
- private JLabel label8;
- private JComboBox priorityCombo2;
- private JCheckBox jRadioButton8;
- private JFormattedTextField tbFoodAmt;
- private JLabel label9;
- private JLabel label10;
- private JComboBox priorityCombo3;
- private JButton button1;
- private JLabel label1;
- private JLabel label2;
- }
- private class WhiteBearGUI2 {
- private static final long serialVersionUID = 1L;
- private WhiteBearGUI2() {
- initComponents();
- }
- private void button1ActionPerformed(ActionEvent e) {
- int x = Integer.parseInt(tbLocX.getText());
- int y = Integer.parseInt(tbLocY.getText());
- int obj = Integer.parseInt(tbObject.getText());
- int type = jComboBox.getSelectedIndex() + 1;
- String action = tbObject1.getText();
- if (calc.distanceTo(new RSTile(x, y)) > 1.1) {
- log.severe("[Action] Your character must be standing right beside the object!");
- return;
- } else {
- Action a = new Action(new RSTile(x, y), type, game.getPlane(), obj, action);
- if (stage == 4) {
- if (pathRecord == 1) {
- banker.actionsList.add(a);
- log.info("[Action] Successfully added Action: " + a.toString());
- } else {
- log.severe("[Action] You have stopped recording path to bank!");
- }
- } else if (stage == 5) {
- if (pathRecordBack == 1) {
- banker.actionsListReverse.add(a);
- log.info("[Action] Successfully added Action: " + a.toString());
- } else {
- log.severe("[Action] You have stopped recording path to monsters!");
- }
- } else {
- log.severe("[Action] You are not on Stage 4 or 5 of setup!");
- }
- guiOpen2 = false;
- WhiteBearGUI.dispose();
- }
- }
- private void jComboBoxItemStateChanged(ItemEvent e) {
- if (jComboBox.getSelectedIndex() == 2) {
- label20.setText("Item ID:");
- } else {
- label20.setText("Object ID:");
- }
- }
- private void initComponents() {
- label7 = new JLabel();
- label7.setFont(new Font("Century Gothic", Font.BOLD, 14));
- label7.setForeground(Color.green);
- label7.setText("O");
- label7.setLocation(new Point(253, 103));
- label7.setSize(new Dimension(14, 19));
- label7.setBackground(new Color(81, 81, 81));
- label7.addMouseListener(new java.awt.event.MouseAdapter() {
- public void mousePressed(java.awt.event.MouseEvent e) {
- RSTile loc = getMyPlayer().getLocation();
- tbLocX.setText(Integer.toString(loc.getX()));
- tbLocY.setText(Integer.toString(loc.getY()));
- }
- });
- label6 = new JLabel();
- label6.setFont(new Font("Century Gothic", Font.BOLD, 14));
- label6.setForeground(Color.green);
- label6.setText("v");
- label6.setSize(new Dimension(10, 19));
- label6.setLocation(new Point(255, 122));
- label6.setBackground(new Color(81, 81, 81));
- label6.addMouseListener(new java.awt.event.MouseAdapter() {
- public void mousePressed(java.awt.event.MouseEvent e) {
- RSTile loc = getMyPlayer().getLocation();
- tbLocX.setText(Integer.toString(loc.getX()));
- tbLocY.setText(Integer.toString(loc.getY() - 1));
- }
- });
- label5 = new JLabel();
- label5.setFont(new Font("Century Gothic", Font.BOLD, 14));
- label5.setForeground(Color.green);
- label5.setText("^");
- label5.setSize(new Dimension(10, 19));
- label5.setLocation(new Point(255, 85));
- label5.setBackground(new Color(81, 81, 81));
- label5.addMouseListener(new java.awt.event.MouseAdapter() {
- public void mousePressed(java.awt.event.MouseEvent e) {
- RSTile loc = getMyPlayer().getLocation();
- tbLocX.setText(Integer.toString(loc.getX()));
- tbLocY.setText(Integer.toString(loc.getY() + 1));
- }
- });
- label4 = new JLabel();
- label4.setFont(new Font("Century Gothic", Font.BOLD, 14));
- label4.setForeground(Color.green);
- label4.setText(">");
- label4.setSize(new Dimension(10, 19));
- label4.setLocation(new Point(268, 103));
- label4.setBackground(new Color(81, 81, 81));
- label4.addMouseListener(new java.awt.event.MouseAdapter() {
- public void mousePressed(java.awt.event.MouseEvent e) {
- RSTile loc = getMyPlayer().getLocation();
- tbLocX.setText(Integer.toString(loc.getX() + 1));
- tbLocY.setText(Integer.toString(loc.getY()));
- }
- });
- label3 = new JLabel();
- label3.setBounds(new Rectangle(239, 102, 11, 19));
- label3.setFont(new Font("Century Gothic", Font.BOLD, 14));
- label3.setForeground(Color.green);
- label3.setText("<");
- label3.setBackground(new Color(81, 81, 81));
- label3.addMouseListener(new java.awt.event.MouseAdapter() {
- public void mousePressed(java.awt.event.MouseEvent e) {
- RSTile loc = getMyPlayer().getLocation();
- tbLocX.setText(Integer.toString(loc.getX() - 1));
- tbLocY.setText(Integer.toString(loc.getY()));
- }
- });
- label22 = new JLabel();
- label22.setBounds(new Rectangle(14, 175, 100, 19));
- label22.setFont(new Font("Century Gothic", Font.BOLD, 14));
- label22.setForeground(new Color(255, 255, 102));
- label22.setText("Action Name:");
- label22.setBackground(new Color(51, 51, 51));
- WhiteBearGUI = new JFrame();
- panel1 = new JPanel();
- button1 = new JButton();
- label1 = new JLabel();
- tbObject = new JFormattedTextField();
- label20 = new JLabel();
- label18 = new JLabel();
- tbLocX = new JFormattedTextField();
- label17 = new JLabel();
- label21 = new JLabel();
- tbLocY = new JFormattedTextField();
- //======== WhiteBearGUI ========
- {
- WhiteBearGUI.setAlwaysOnTop(true);
- WhiteBearGUI.setBackground(Color.black);
- WhiteBearGUI.setPreferredSize(new Dimension(312, 293));
- WhiteBearGUI.setResizable(false);
- WhiteBearGUI.setMinimumSize(new Dimension(312, 265));
- WhiteBearGUI.setTitle("White Bear AIO Fighter");
- WhiteBearGUI.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- WhiteBearGUI.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- Container WhiteBearGUIContentPane = WhiteBearGUI.getContentPane();
- WhiteBearGUIContentPane.setLayout(null);
- //======== panel1 ========
- {
- panel1.setBackground(Color.black);
- panel1.setForeground(Color.green);
- panel1.setMinimumSize(new Dimension(100, 200));
- panel1.setLayout(null);
- //---- button1 ----
- button1.setText("Add Action");
- button1.setBounds(new Rectangle(59, 207, 205, 35));
- button1.setBackground(Color.black);
- button1.setFont(new Font("Century Gothic", Font.BOLD, 16));
- button1.setForeground(new Color(0, 102, 51));
- button1.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- button1ActionPerformed(e);
- }
- });
- panel1.add(button1);
- button1.setBounds(59, 202, 205, 35);
- //---- label1 ----
- label1.setText("White Bear AIO Fighter");
- label1.setLocation(new Point(35, 7));
- label1.setSize(new Dimension(250, 40));
- label1.setBackground(new Color(51, 51, 51));
- label1.setForeground(new Color(153, 255, 153));
- label1.setFont(new Font("Century Gothic", Font.BOLD, 22));
- panel1.add(label1);
- //---- tbFoodName ----
- tbObject.setFont(new Font("Century Gothic", Font.PLAIN, 14));
- tbObject.setForeground(new Color(255, 255, 204));
- tbObject.setBackground(Color.gray);
- tbObject.setText("0");
- panel1.add(tbObject);
- tbObject.setBounds(108, 134, 64, 25);
- //---- label20 ----
- label20.setText("Object ID:");
- label20.setBackground(new Color(51, 51, 51));
- label20.setForeground(new Color(255, 255, 102));
- label20.setFont(new Font("Century Gothic", Font.BOLD, 14));
- panel1.add(label20);
- label20.setBounds(13, 136, 79, 20);
- //---- label18 ----
- label18.setText("Location: x:");
- label18.setBackground(new Color(51, 51, 51));
- label18.setForeground(new Color(255, 255, 102));
- label18.setFont(new Font("Century Gothic", Font.BOLD, 14));
- panel1.add(label18);
- label18.setBounds(13, 100, 91, 20);
- //---- tbLocX ----
- tbLocX.setFont(new Font("Century Gothic", Font.PLAIN, 14));
- tbLocX.setForeground(new Color(255, 255, 204));
- tbLocX.setBackground(Color.gray);
- tbLocX.setText("0");
- panel1.add(tbLocX);
- tbLocX.setBounds(103, 97, 49, 25);
- //---- label17 ----
- label17.setText("Action Type:");
- label17.setBackground(new Color(51, 51, 51));
- label17.setForeground(new Color(255, 255, 102));
- label17.setFont(new Font("Century Gothic", Font.BOLD, 14));
- panel1.add(label17);
- label17.setBounds(14, 60, 100, 20);
- //---- label21 ----
- label21.setText("y:");
- label21.setBackground(new Color(51, 51, 51));
- label21.setForeground(new Color(255, 255, 102));
- label21.setFont(new Font("Century Gothic", Font.BOLD, 14));
- panel1.add(label21);
- label21.setBounds(158, 100, 22, 20);
- //---- tbLocY ----
- tbLocY.setFont(new Font("Century Gothic", Font.PLAIN, 14));
- tbLocY.setForeground(new Color(255, 255, 204));
- tbLocY.setBackground(Color.gray);
- tbLocY.setText("0");
- panel1.add(tbLocY);
- tbLocY.setBounds(179, 97, 51, 25);
- //---- jComboBox ----
- jComboBox = new JComboBox();
- jComboBox.setBounds(new Rectangle(126, 58, 134, 25));
- jComboBox.setMaximumRowCount(3);
- jComboBox.setModel(new DefaultComboBoxModel(new String[]{
- "Ladder/ Rope",
- "Doors",
- "Teleport Tab"
- }));
- jComboBox.setFont(new Font("Century Gothic", Font.PLAIN, 12));
- jComboBox.addItemListener(new ItemListener() {
- public void itemStateChanged(ItemEvent e) {
- jComboBoxItemStateChanged(e);
- }
- });
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for (int i = 0; i < panel1.getComponentCount(); i++) {
- Rectangle bounds = panel1.getComponent(i).getBounds();
- preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
- preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
- }
- Insets insets = panel1.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- panel1.setMinimumSize(preferredSize);
- panel1.setPreferredSize(preferredSize);
- }
- }
- WhiteBearGUIContentPane.add(panel1);
- panel1.setBounds(0, 0, 308, 242);
- panel1.setBounds(new Rectangle(0, 0, 321, 251));
- panel1.add(jComboBox, null);
- panel1.add(label22, null);
- panel1.add(getTbObject1(), null);
- panel1.add(label3, null);
- panel1.add(label4, null);
- panel1.add(label5, null);
- panel1.add(label6, null);
- panel1.add(label7, null);
- WhiteBearGUIContentPane.setPreferredSize(new Dimension(405, 265));
- WhiteBearGUIContentPane.setSize(new Dimension(302, 237));
- WhiteBearGUIContentPane.setSize(new Dimension(308, 237));
- WhiteBearGUI.setSize(319, 265);
- WhiteBearGUI.setLocationRelativeTo(WhiteBearGUI.getOwner());
- }
- }
- private JFrame WhiteBearGUI;
- private JPanel panel1;
- private JButton button1;
- private JLabel label1;
- private JFormattedTextField tbObject;
- private JLabel label20;
- private JLabel label18;
- private JFormattedTextField tbLocX;
- private JLabel label17;
- private JLabel label21;
- private JFormattedTextField tbLocY;
- private JComboBox jComboBox = null;
- private JLabel label22 = null;
- private JFormattedTextField tbObject1 = null;
- private JLabel label3 = null;
- private JLabel label4 = null;
- private JLabel label5 = null;
- private JLabel label6 = null;
- private JLabel label7 = null;
- private JFormattedTextField getTbObject1() {
- if (tbObject1 == null) {
- tbObject1 = new JFormattedTextField();
- tbObject1.setBounds(new Rectangle(122, 172, 140, 25));
- tbObject1.setFont(new Font("Century Gothic", Font.PLAIN, 14));
- tbObject1.setForeground(new Color(255, 255, 204));
- tbObject1.setText("Climb-up Ladder");
- tbObject1.setBackground(Color.gray);
- }
- return tbObject1;
- }
- }
- }
Add Comment
Please, Sign In to add comment