- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Point;
- import java.awt.RenderingHints;
- import java.util.ArrayList;
- import java.util.Map;
- import org.rsbot.bot.Bot;
- import org.rsbot.bot.input.Mouse;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.Calculations;
- import org.rsbot.script.Constants;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.Skills;
- import org.rsbot.script.wrappers.RSInterface;
- import org.rsbot.script.wrappers.RSInterfaceChild;
- import org.rsbot.script.wrappers.RSPlayer;
- import org.rsbot.script.wrappers.RSTile;
- @ScriptManifest(authors = { "Jacmob/Montonago" }, category = "Agility", name = "Monty's Barbarian Agility", version = 1.1, description = "<html>\n<body style=\"font-family: Arial; background-color: #DDFFDD;\">\n<div style=\"width: 100%; height: 35px; background-color: #BBEEBB; text-align: center;\"\n<h2 style=\"color: #118811;\">Barbarian Course</h2>\n</div>\n<div style=\"width:100%; background-color: #007700; text-align:center; color: #FFFFFF; height: 15px;\">Created by: Jacmob; Fixed by: Montonago"
- + "<p>Version 1.1</p></div>\n<div style=\"width: 100%; padding: 10px; padding-bottom: 12px; background-color: #EEFFEE;\">Start in the Barbarian Agility Course.<br><br>Food and energy potions are supported.</div>\n<div style=\"width: 100%; padding: 10px;\">\n<h3>Auto Stop (Enter Runtime to Enable)</h3><input type=\"text\" name=\"hours\" id=\"hrs\" size=3 /><label for=\"hrs\" > : </label><input type=\"text\" name=\"mins\" id=\"mins\" size=3 /><label for=\"mins\"> : </label><input type=\"text\" name=\"secs\" id=\"secs\" size=3 /><label for=\"secs\"> (hrs:mins:secs)</label><br /><br /><input type=\"checkbox\" name=\"chkXP\" id=\"chkXP\" value=\"true\" /><label for=\"debug\">Check XP (Extra AntiBan)</label></div>\n</body>\n</html")
- public class BarbarianAgilityMonty extends Script implements PaintListener {
- public long currentExp, startExp, st, startLevel;
- public boolean setpainton = true;
- boolean showEXP = false;
- boolean showMisc = true;
- final int percentToLevel = 0;
- int positionOfLap = 0;
- public static final int[] Food = new int[] {
- 315, //Shrimp
- 325, //Sardine
- 319, //Anchovies
- 347, //Herring
- 355, //Mackerel
- 333, //Trout
- 339, //Cod
- 351, //Pike
- 329, //Salmon
- 361, //Tuna
- 10135, //Rainbow Fish
- 5003, //Cave Eel
- 379, //Lobster
- 361, //Bass
- 373, //Swordfish
- 7946, //Monkfish
- 385, //Shark
- 397, //Sea Turtle
- 391, //Manta Ray
- 2309, //Bread
- 2003, //Stew
- 2011, //Curry
- 7068, //Tuna and Corn
- 6701, //Baked Potato
- 6703, //Potato with Butter
- 7054, //Chilli Potato
- 6705, //Potato with Cheese
- 7060, //Tuna Potato
- 1971, //Kebab
- 4608, //Super Kebab
- 1883, //Ugthanki Kebab
- 7218, //Summer Pie
- 7220, //Half-Summer Pie
- };
- public static final int[] energyPot = new int[] { 3014, 3012, 3010, 3008,
- 3022, 3020, 3018, 3016 };
- public int LapsDone = 0;
- public static final String[] SKILL_NAMES = {"attack", "defence", "strength", "constitution", "range", "prayer", "magic", "cooking", "woodcutting", "fletching", "fishing", "firemaking", "crafting", "smithing", "mining", "herblore", "agility", "thieving", "slayer", "farming", "runecrafting", "hunter", "construction", "summoning", "dungeoneering", "-unused-"};
- public static final int[] XP_TABLE = {0, 0, 83, 174, 276, 388, 512, 650, 801, 969, 1154, 1358, 1584, 1833, 2107, 2411, 2746, 3115, 3523, 3973, 4470, 5018, 5624, 6291, 7028, 7842, 8740, 9730, 10824, 12031, 13363, 14833, 16456, 18247, 20224, 22406, 24815, 27473, 30408, 33648, 37224, 41171, 45529, 50339, 55649, 61512, 67983, 75127, 83014, 91721, 101333, 111945, 123660, 136594, 150872, 166636, 184040, 203254, 224466, 247886, 273742, 302288, 333804, 368599, 407015, 449428, 496254, 547953, 605032, 668051, 737627, 814445, 899257, 992895, 1096278, 1210421, 1336443, 1475581, 1629200, 1798808, 1986068, 2192818, 2421087, 2673114, 2951373, 3258594, 3597792, 3972294, 4385776, 4842295, 5346332, 5902831, 6517253, 7195629, 7944614, 8771558, 9684577, 10692629, 11805606, 13034431, 14391160, 15889109, 17542976, 19368992, 21385073, 23611006, 26068632, 28782069, 31777943, 35085654, 38737661, 42769801, 47221641, 52136869, 57563718, 63555443, 70170840, 77474828, 85539082, 94442737, 104273167};
- public static final int ATTACK = 0;
- public static final int DEFENSE = 1;
- public static final int STRENGTH = 2;
- public static final int CONSTITUTION = 3;
- public static final int RANGE = 4;
- public static final int PRAYER = 5;
- public static final int MAGIC = 6;
- public static final int COOKING = 7;
- public static final int WOODCUTTING = 8;
- public static final int FLETCHING = 9;
- public static final int FISHING = 10;
- public static final int FIREMAKING = 11;
- public static final int CRAFTING = 12;
- public static final int SMITHING = 13;
- public static final int MINING = 14;
- public static final int HERBLORE = 15;
- public static final int AGILITY = 16;
- public static final int THIEVING = 17;
- public static final int SLAYER = 18;
- public static final int FARMING = 19;
- public static final int RUNECRAFTING = 20;
- public static final int HUNTER = 21;
- public static final int CONSTRUCTION = 22;
- public static final int SUMMONING = 23;
- public static final int DUNGEONEERING = 24;
- private boolean lapJustDone = false;
- private boolean lapBegun = false;
- private boolean checkXP = false;
- private int RunningEnergy = random(15, 30);
- private int DrinkingEnergy = -1;
- private int currentFails = 0;
- private int startingxp = -1;
- private long startTime = -1;
- private long stopTime = -1;
- private boolean atTile3(final RSTile tile, final String action) {
- return atTile3(tile, action, 0, 0, 10);
- }
- private boolean atTile3(final RSTile tile, final String action,
- final int xOffset, final int yOffset) {
- return atTile3(tile, action, xOffset, yOffset, 10);
- }
- // atTile3 -Jacmob
- private boolean atTile3(final RSTile tile, final String action,
- final int xOffset, final int yOffset, final int variation) {
- try {
- final Point location = Calculations.tileToScreen(tile);
- if (location.x == -1 || location.y == -1) {
- return false;
- }
- moveMouse(location.x + xOffset, location.y + yOffset, variation,
- variation);
- wait(random(30, 60));
- getMenuItems();
- final ArrayList<String> mis = getMenuItems();
- if (mis.get(0).contains(action)) {
- clickMouse(true);
- } else {
- for (int i = 1; i < mis.size(); i++) {
- if (mis.get(i).contains(action)) {
- clickMouse(false);
- if (atMenu(action)) {
- return true;
- }
- }
- }
- return false;
- }
- return true;
- } catch (final Exception e) {
- return false;
- }
- }
- private RSTile checkTile(final RSTile tile) { // most credits to Fusion89k
- if (distanceTo(tile) < 15) {
- return tile;
- }
- final RSTile loc = getMyPlayer().getLocation();
- final RSTile walk = new RSTile((loc.getX() + tile.getX()) / 2, (loc
- .getY() + tile.getY()) / 2);
- return tileOnMap(walk) ? walk : checkTile(walk);
- }
- private void Drink() {
- while (getInventoryCount(BarbarianAgilityMonty.energyPot) >= 1
- && getEnergy() <= DrinkingEnergy) {
- DrinkingEnergy = random(10, 40);
- for (final int element : BarbarianAgilityMonty.energyPot) {
- if (getInventoryCount(element) == 0) {
- continue;
- }
- log("Drinking energy potion.");
- atInventoryItem(element, "Drink");
- wait(random(500, 800));
- break;
- }
- }
- }
- private boolean Eat() {
- for (final int element : BarbarianAgilityMonty.Food) {
- if (getInventoryCount(element) >= 1) {
- atInventoryItem(element, "Eat");
- return true;
- }
- }
- return false;
- }
- private RSTile[] generatePath(int startX, int startY,
- final int destinationX, final int destinationY) { // most credits to
- // aftermath
- double dx, dy;
- final ArrayList<RSTile> list = new ArrayList<RSTile>();
- list.add(new RSTile(startX, startY));
- while (Math.hypot(destinationY - startY, destinationX - startX) > 8) {
- dx = destinationX - startX;
- dy = destinationY - startY;
- final int gamble = random(14, 17);
- while (Math.hypot(dx, dy) > gamble) {
- dx *= .95;
- dy *= .95;
- }
- startX += (int) dx;
- startY += (int) dy;
- list.add(new RSTile(startX, startY));
- }
- list.add(new RSTile(destinationX, destinationY));
- return list.toArray(new RSTile[list.size()]);
- }
- private RSTile[] generatePath(final RSTile tile) {
- return generatePath(getMyPlayer().getLocation().getX(), getMyPlayer()
- .getLocation().getY(), tile.getX(), tile.getY());
- }
- private String getFormattedTime(final long timeMillis) {
- long millis = timeMillis;
- final long seconds2 = millis / 1000;
- final long hours = millis / (1000 * 60 * 60);
- millis -= hours * 1000 * 60 * 60;
- final long minutes = millis / (1000 * 60);
- millis -= minutes * 1000 * 60;
- final long seconds = millis / 1000;
- String hoursString = "";
- String minutesString = "";
- String secondsString = seconds + "";
- String type = "seconds";
- if (minutes > 0) {
- minutesString = minutes + ":";
- type = "minutes";
- } else if (hours > 0 && seconds2 > 0) {
- minutesString = "0:";
- }
- if (hours > 0) {
- hoursString = hours + ":";
- type = "hours";
- }
- if (minutes < 10 && type != "seconds") {
- minutesString = "0" + minutesString;
- }
- if (hours < 10 && type == "hours") {
- hoursString = "0" + hoursString;
- }
- if (seconds < 10 && type != "seconds") {
- secondsString = "0" + secondsString;
- }
- return hoursString + minutesString + secondsString + " " + type;
- }
- private int getState() {
- final RSTile StartCoord = new RSTile(2552, 3554);
- final RSTile FailCoord = new RSTile(2548, 9951);
- final RSTile Fail2Coord = new RSTile(2548, 3551);
- final RSTile LogCoord = new RSTile(2552, 3549);
- final RSTile Log2Coord = new RSTile(2551, 3546);
- final RSTile LogFailCoord = new RSTile(2545, 3542);
- final RSTile NetCoord = new RSTile(2541, 3546);
- final RSTile BalanceCoord = new RSTile(2537, 3546);
- final RSTile BalanceFailCoord = new RSTile(2534, 3545);
- final RSTile LadderCoord = new RSTile(2532, 3546);
- final RSTile WallCoord = new RSTile(2532, 3546);
- final RSTile Wall2Coord = new RSTile(2536, 3553);
- final RSTile Wall3Coord = new RSTile(2538, 3553);
- final RSTile EndCoord = new RSTile(2543, 3553);
- if (distanceTo(StartCoord) < 3) {
- return 1;
- }
- if (distanceTo(Fail2Coord) < 2 && getPlane() == 0) {
- return 10;
- }
- if ((distanceTo(LogCoord) < 3 || distanceTo(Log2Coord) < 2)
- && getPlane() == 0) {
- return 2;
- }
- if (distanceTo(LogFailCoord) < 4 && getPlane() == 0) {
- return 3;
- }
- if (distanceTo(NetCoord) < 4 && getPlane() == 0) {
- return 4;
- }
- if (distanceTo(BalanceCoord) < 4 && getPlane() == 1) {
- return 5;
- }
- if (distanceTo(LadderCoord) < 3 && getPlane() == 1) {
- return 6;
- }
- if (distanceTo(WallCoord) < 4 && getMyPlayer().getLocation().getY() == 3546 && getPlane() == 0) {
- return 7;
- }
- if (distanceTo(Wall2Coord) < 4
- && getMyPlayer().getLocation().getX() < 2538 && getPlane() == 0) {
- return 8;
- }
- if (distanceTo(Wall3Coord) < 6
- && getMyPlayer().getLocation().getX() < 2543 && getPlane() == 0) {
- return 9;
- }
- if (distanceTo(EndCoord) < 5 && getPlane() == 0) {
- return 10;
- }
- if (distanceTo(FailCoord) < 20) {
- return 11;
- }
- if (distanceTo (BalanceFailCoord) <2 && getMyPlayer().getLocation().getX() == 2534 && getMyPlayer().getLocation().getY() == 3545) {
- return 12;
- }
- return -1;
- }
- public double getVersion() {
- return 1.1;
- }
- public int getMouseSpeed(){
- return 6;
- }
- public int LevelBar(final int index) {
- final int lvl = skills.getRealSkillLevel(index);
- if (lvl == 99)
- return 0;
- final int xpTotal = XP_TABLE[lvl + 1] - XP_TABLE[lvl];
- if (xpTotal == 0)
- return 0;
- final int xpDone = skills.getCurrentSkillExp(index) - XP_TABLE[lvl];
- return 246 * xpDone / xpTotal;
- }
- private void hoverAgility() {
- final RSInterfaceChild agitab = RSInterface.getInterface(320).getChild(
- 134);
- openTab(Constants.TAB_STATS);
- moveMouse(new Point(agitab.getAbsoluteX()
- + random(2, agitab.getWidth() - 1), agitab.getAbsoluteY()
- + random(2, agitab.getHeight() - 1)));
- wait(random(900, 2000));
- openTab(Constants.TAB_INVENTORY);
- }
- @Override
- public int loop() {
- try {
- if (!getMyPlayer().isMoving() && getMyPlayer().getAnimation() == -1) {
- } else {
- wait(200);
- }
- if (stopTime != -1 && startTime != -1
- && System.currentTimeMillis() - startTime > stopTime) {
- log("Stop Time Reached. Logging off in 10 seconds.");
- wait(random(10000, 12000));
- stopScript();
- }
- if (checkXP && random(1, 1000) == 1) {
- hoverAgility();
- }
- if (getEnergy() >= RunningEnergy && !isRunning()) {
- setRun(true);
- RunningEnergy = random(15, 30);
- wait(random(400, 500));
- }
- if (getEnergy() != 0 && getEnergy() <= DrinkingEnergy) {
- Drink();
- }
- if (getInventoryCount(2313) > 0) {
- atInventoryItem(2313, "Drop");
- wait (300);
- }
- if (getMyPlayer().getHPPercent() < (50 + random(0, 10))) {
- log("Health is below 50%. Eating food...");
- if (!Eat()) {
- log("No food to eat. Waiting 10 seconds.");
- wait(random(10000, 12000));
- if (getMyPlayer().getHPPercent() >= (60 + random(0, 10))) {
- log("Failure correction activated. Logout cancelled.");
- return random(100, 200);
- }
- logout();
- log("No food to eat. Logged out.");
- Bot.getScriptHandler().stopScript(ID);
- } else {
- if (getMyPlayer().getHPPercent() < (50 + random(0, 10))) {
- wait(random(800, 1000));
- Eat();
- } else {
- return random (400, 500);
- }
- return random(400, 500);
- }
- }
- final RSPlayer me = getMyPlayer();
- final int state = getState();
- if (me.getAnimation() != -1 || me.isMoving()) {
- if (lapJustDone) {
- setCameraRotation(random(175, 185));
- LapsDone++;
- positionOfLap = 8;
- lapJustDone = false;
- }
- return random(50, 200);
- }
- switch (state) {
- case 0:
- break;
- case -1: // Failure!
- if (currentFails > 30 && getPlane() == 0) {
- log("Unknown Location - Returning To Start");
- walkPathMM(randomizePath(
- generatePath(new RSTile(2552, 3554)), 0, 1), 16);
- }
- currentFails += 1;
- wait(1000);
- break;
- case 1: // Rope
- if (!getMyPlayer().isMoving() && getMyPlayer().getAnimation() == -1) {
- positionOfLap = 1;
- if (distanceTo(new RSTile(2552, 3554)) > 1) {
- walkTo(new RSTile(2552, 3554));
- wait(random(50, 100));
- } else if (atTile3(new RSTile(2552, 3552), "Swing-on")) {
- wait(random(650, 800));
- } else {
- setCameraRotation(random(175, 185));
- currentFails += 1;
- wait(1000);
- }
- lapBegun = true;
- return random(50, 100);
- } else {
- wait(200);
- }
- case 2: // Log
- if (!getMyPlayer().isMoving() && getMyPlayer().getAnimation() == -1) {
- positionOfLap = 2;
- if (atTile3(new RSTile(2550, 3546), "Walk-across", 0, 5)) {
- setCameraRotation(random(5, 10));
- wait(random(400, 500));
- } else {
- currentFails += 1;
- wait(1000);
- }
- break;
- } else {
- wait(200);
- }
- case 3: // Log Failed
- if (!getMyPlayer().isMoving() && getMyPlayer().getAnimation() == -1) {
- walkTo(new RSTile(2551, 3546));
- wait(random(700, 900));
- break;
- } else {
- wait(200);
- }
- case 4: // Net
- if (!getMyPlayer().isMoving() && getMyPlayer().getAnimation() == -1) {
- positionOfLap = 3;
- if (atTile3(new RSTile(2538, 3546), "Climb-over", 0, -10)) {
- setCameraRotation(random(85, 95));
- wait(random(300, 500));
- } else {
- currentFails += 1;
- wait(1000);
- }
- wait(random(300, 500));
- break;
- } else {
- wait(200);
- }
- case 5: // Ledge
- if (!getMyPlayer().isMoving() && getMyPlayer().getAnimation() == -1) {
- positionOfLap = 3;
- if (atTile3(new RSTile(2535, 3547), "Walk-across", 7, 0)) {
- setCameraRotation(random(185, 175));
- wait(random(1000, 1100));
- } else if (currentFails > 0 && currentFails % 20 == 0) {
- turnToTile(new RSTile(2535, 3547));
- } else {
- currentFails += 1;
- wait(1000);
- }
- break;
- } else {
- wait(200);
- }
- case 6: // Ladder
- if (atTile3(new RSTile(2532, 3545), "Climb-down")) {
- positionOfLap = 4;
- wait(random(500, 700));
- } else if (currentFails > 0 && currentFails % 20 == 0) {
- turnToTile(new RSTile(2532, 3545));
- } else {
- currentFails += 1;
- wait(1000);
- }
- break;
- case 7: // Walk To Crumbling Wall
- if (!getMyPlayer().isMoving() && getMyPlayer().getAnimation() == -1) {
- positionOfLap = 5;
- walkTo(new RSTile(2536, 3553));
- wait(random(50, 100));
- setCameraRotation(random(265, 285));
- wait(random(100, 200));
- break;
- } else {
- wait(200);
- }
- case 8: // First Crumbling Wall
- if (!getMyPlayer().isMoving() && getMyPlayer().getAnimation() == -1) {
- positionOfLap = 6;
- if (atTile3(new RSTile(2538, 3553), "Climb-over", -4, 15)) {
- wait(random(300, 400));
- } else if (currentFails > 0 && currentFails % 20 == 0) {
- turnToTile(new RSTile(2538, 3553));
- } else {
- currentFails += 1;
- wait(1000);
- }
- break;
- } else {
- wait(200);
- }
- case 9: // Second Crumbling Wall
- if (!getMyPlayer().isMoving() && getMyPlayer().getAnimation() == -1) {
- if (atTile3(new RSTile(2543, 3553), "Climb-over", 0, 15)) {
- positionOfLap = 7;
- wait(random(200, 300));
- if (lapBegun) {
- lapJustDone = true;
- }
- lapBegun = false;
- } else if (currentFails > 0 && currentFails % 20 == 0) {
- turnToTile(new RSTile(2543, 3553));
- } else {
- currentFails += 1;
- wait(1000);
- }
- break;
- } else {
- wait(200);
- }
- case 10: // Return To Start
- if (!getMyPlayer().isMoving() && getMyPlayer().getAnimation() == -1) {
- currentFails = 0;
- walkTo(checkTile(new RSTile(2552, 3554)));
- setCameraRotation(random(175, 185));
- wait(random(400, 750));
- break;
- } else {
- wait(200);
- }
- case 11:
- if (!getMyPlayer().isMoving() && getMyPlayer().getAnimation() == -1) {
- if (distanceTo(new RSTile(2547, 9951)) > 5) {
- walkTo(new RSTile(2548, 9951));
- }
- if (atTile3(new RSTile(2547, 9951), "Climb-up")) {
- wait(random(300, 400));
- } else if (currentFails > 0 && currentFails % 20 == 0) {
- turnToTile(new RSTile(2547, 9951));
- } else {
- currentFails += 1;
- wait(1000);
- }
- break;
- } else {
- wait(200);
- }
- case 12:
- //failed ledge
- if (!getMyPlayer().isMoving() && getMyPlayer().getAnimation() == -1) {
- positionOfLap -= 1;
- if (distanceTo(new RSTile(2540, 3546)) <8) {
- walkTo (new RSTile(2540, 3546));
- setCameraRotation(random(5, 10));
- wait(random(3000,2900));
- break;
- }
- } else {
- wait (200);
- }
- default: // Stop Script
- return -1;
- }
- } catch (final Exception e) {
- log.severe("SCRIPT ERROR");
- return 0;
- }
- return random(100, 200);
- }
- @Override
- public void onFinish() {
- log("Gained "
- + (skills.getCurrentSkillExp(Constants.STAT_AGILITY) - startingxp)
- + " XP ("
- + (skills.getRealSkillLevel(Constants.STAT_AGILITY) - skills
- .getLvlByExp(startingxp)) + " levels) in "
- + getFormattedTime(System.currentTimeMillis() - startTime)
- + ".");
- }
- @Override
- public boolean onStart(final Map<String, String> args) {
- if (args.get("chkXP") == null) {
- checkXP = false;
- }
- showEXP = false;
- showMisc = true;
- if (!(args.get("hours").equals("") && args.get("mins").equals("") && args
- .get("secs").equals(""))) {
- int sHours = 0, sMins = 0, sSecs = 0;
- if (!args.get("hours").equals("")) {
- sHours = Integer.parseInt(args.get("hours"));
- }
- if (!args.get("mins").equals("")) {
- sMins = Integer.parseInt(args.get("mins"));
- }
- if (!args.get("secs").equals("")) {
- sSecs = Integer.parseInt(args.get("secs"));
- }
- stopTime = sHours * 3600000 + sMins * 60000 + sSecs * 1000;
- log("Script will stop after " + getFormattedTime(stopTime));
- }
- return true;
- }
- //This variable is used for Antialiasing. DO NOT DELETE!
- private final RenderingHints rh = new RenderingHints(
- RenderingHints.KEY_TEXT_ANTIALIASING,
- RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
- public void onRepaint(Graphics g) {
- if (isLoggedIn() && skills.getRealSkillLevel(Constants.STAT_AGILITY) > 1) {
- if (startingxp == -1) {
- startingxp = skills.getCurrentSkillExp(Constants.STAT_AGILITY);
- startTime = System.currentTimeMillis();
- DrinkingEnergy = random(10, 40);
- if (getState() == -1) {
- walkPathMM(randomizePath(
- generatePath(new RSTile(2474, 3436)), 2, 2), 16);
- }
- }
- int lapPercentage = (246 * positionOfLap / 8);
- final int levelsGained = skills
- .getRealSkillLevel(Constants.STAT_AGILITY)
- - skills.getLvlByExp(startingxp);
- final long runSeconds = (System.currentTimeMillis() - startTime) / 1000;
- if (levelsGained < 0) {
- startingxp = skills.getCurrentSkillExp(Constants.STAT_AGILITY);
- }
- final int xpDone = skills.getCurrentSkillExp(STAT_AGILITY) - XP_TABLE[(skills.getRealSkillLevel(STAT_AGILITY))];
- ((Graphics2D)g).setRenderingHints(rh);
- Mouse m = Bot.getClient().getMouse();
- //Below is formula for getting where the real mouse is on the screen.
- //if(m.x >= <X> && m.x < <X> + <WIDTH> && m.y >= <Y> && m.y < <Y> + <HEIGHT>)
- //<Graphics reference>.fillRect(<X>, <Y>, <WIDTH>, <HEIGHT>);
- if(m.x >= 368 && m.x < 368 + 140 && m.y >= 304 && m.y < 304 + 30) {
- setpainton = (false);
- } else {
- setpainton = (true);
- }
- int pctolevel = skills.getPercentToNextLevel(STAT_AGILITY);
- int pclevelbar = LevelBar(STAT_AGILITY);
- if (setpainton) {
- //Background
- g.setColor(new Color(0, 0, 0, 160));
- g.fillRoundRect(4, 228, 512, 112, 10, 10);
- g.setColor(new Color(255, 0, 51));
- g.drawRoundRect(4, 228, 512, 112, 10, 10);
- g.setColor(new Color(0, 0, 0, 105));
- g.fillRoundRect(8, 232, 504, 104, 10, 10);
- g.setColor(new Color(255, 255, 255));
- g.drawRoundRect(8, 232, 504, 104, 10, 10);
- //ShowExpButton
- if(m.x >= 368 && m.x < 368 + 140 && m.y >= 236 && m.y < 236 + 30) {
- showEXP = (true);
- showMisc = (false);
- }
- g.setColor(new Color(255, 255, 255, 121));
- g.fillRoundRect(368, 236, 140, 30, 10, 10);
- g.setColor(new Color(255, 255, 255));
- g.drawRoundRect(368, 236, 140, 30, 10, 10);
- g.setFont(new Font("Aharoni", 0, 17));
- g.setColor(new Color(255, 255, 255));
- if (!showEXP) {
- g.drawString("Show Exp", 396, 258);
- } else {
- g.drawString("EXP Open", 396, 258);
- }
- //ShowMiscButton
- if(m.x >= 368 && m.x < 368 + 140 && m.y >= 270 && m.y < 270 + 30) {
- showEXP = (false);
- showMisc = (true);
- }
- g.setColor(new Color(255, 255, 255, 121));
- g.fillRoundRect(368, 270, 140, 30, 10, 10);
- g.setColor(new Color(255, 255, 255));
- g.drawRoundRect(368, 270, 140, 30, 10, 10);
- g.setFont(new Font("Aharoni", 0, 17));
- g.setColor(new Color(255, 255, 255));
- if (!showMisc) {
- g.drawString("Show Misc", 394, 292);
- } else {
- g.drawString("Misc Open", 394, 292);
- }
- //HeadLine
- g.setFont(new Font("Aharoni", 0, 17));
- g.setColor(new Color(255, 255, 255));
- g.drawString("Jacmobs's Standard Barbarian Agility v1.1", 12, 250);
- g.setColor(new Color(255, 0, 51));
- g.drawLine(10, 252, 354, 252);
- g.setFont(new Font("Aharoni", 0, 15));
- g.setColor(new Color(255, 255, 255));
- g.drawString("Runtime: " + getFormattedTime(System.currentTimeMillis() - startTime), 12, 268);
- //MiscStuff
- if (showMisc == (true)) {
- g.setFont(new Font("Aharoni", 0, 15));
- g.setColor(new Color(255, 255, 255));
- g.drawString("Laps Done: " + LapsDone, 12, 284);
- if (LapsDone == 0) {
- g.drawString("Laps per Hour: Estimating", 12, 300);
- } else if (LapsDone > 0) {
- g.drawString("Laps per Hour: " + LapsDone * 3600 / runSeconds, 12, 300);
- }
- g.drawString("Times Failed: " + "In the works", 12, 316);
- g.drawString("Lap Progress: Bar", 12, 332);
- //ProgressBarLaps
- g.setColor(new Color(255, 0, 0));
- g.fillRoundRect(110, 320, 246, 12, 10, 10);
- g.setColor(new Color(0, 255, 0));
- g.fillRoundRect(110, 320, lapPercentage, 12, 10, 10);
- g.setColor(new Color(0, 0, 255));
- g.drawRoundRect(110, 320, 246, 12, 10, 10);
- g.drawRoundRect(110, 320, lapPercentage, 12, 10, 10);
- }
- //EXPStuff
- if (showEXP == (true)) {
- g.setFont(new Font("Aharoni", 0, 15));
- g.setColor(new Color(255, 255, 255));
- g.drawString("Exp Gained: " + (skills.getCurrentSkillExp(Constants.STAT_AGILITY) - startingxp)+ "XP", 12, 284);
- if ((skills.getCurrentSkillExp(Constants.STAT_AGILITY) - startingxp) <1 ) {
- g.drawString("Exp per Hour: Estimating", 12, 300);
- } else {
- g.drawString("Exp per Hour: "+ (skills.getCurrentSkillExp(Constants.STAT_AGILITY) - startingxp)* 3600 / runSeconds +"XP/h", 12, 300);
- }
- g.drawString("Exp to Level: " + skills.getXPToNextLevel(Constants.STAT_AGILITY)+ "XP", 12, 316);
- g.drawString("Levels Gained: "+ levelsGained, 242, 284);
- g.drawString("Exp Progress: ", 12, 332);
- g.drawString("% to Level: " + (pctolevel) + "%", 260, 316);
- //ProgressBarEXP
- g.setColor(new Color(255, 0, 0));
- g.fillRoundRect(110, 320, 246, 12, 10, 10);
- g.setColor(new Color(0, 255, 0));
- g.fillRoundRect(110, 320, pclevelbar, 12, 10, 10);
- g.setColor(new Color(0, 0, 255));
- g.drawRoundRect(110, 320, 246, 12, 10, 10);
- g.drawRoundRect(110, 320, pclevelbar, 12, 10, 10);
- }
- }
- //HidePaintButton
- g.setColor(new Color(255, 255, 255, 121));
- g.fillRoundRect(368, 304, 140, 30, 10, 10);
- g.setColor(new Color(255, 255, 255));
- g.drawRoundRect(368, 304, 140, 30, 10, 10);
- g.setFont(new Font("Aharoni", 0, 17));
- g.setColor(new Color(255, 255, 255));
- if (setpainton) {
- g.drawString("Hide Paint", 394, 326);
- } else if (!setpainton) {
- g.drawString("Paint Hidden", 390, 326);
- }
- }
- }
- }