Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import java.awt.event.MouseEvent;
- import javax.imageio.ImageIO;
- import java.io.IOException;
- import java.net.URL;
- import org.osbot.script.MethodProvider;
- import org.osbot.script.Script;
- import org.osbot.script.ScriptManifest;
- import org.osbot.script.rs2.map.Position;
- import org.osbot.script.rs2.model.Entity;
- import org.osbot.script.rs2.model.Item;
- import org.osbot.script.rs2.model.Player;
- import org.osbot.script.rs2.skill.Skill;
- import org.osbot.script.rs2.ui.Tab;
- import org.osbot.script.rs2.utility.Area;
- @ScriptManifest(author = "BrownBird", name = "BBagility", version = 1.4, info = "An AIO agillity script! || BETA V1.4")
- public class BBaglility extends Script {
- boolean log = false;
- boolean branch = false;
- boolean rope = false;
- boolean downBranch = false;
- boolean pipe = false;
- boolean logBarb = false;
- boolean ropeSwing = false;
- boolean BalanceLedge = false;
- boolean steppingStone = false;
- boolean rocks = false;
- boolean tree1 = false;
- boolean tree2 = false;
- boolean skullSlope = false;
- boolean monkeyBars = false;
- int crumblingWall;
- int climbNet;
- public String CROSS_LOG = "Log balance";
- public String NET = "Obstacle net";
- public String BRANCH = "Tree branch";
- public String ROPE = "Balancing rope";
- public String PIPE = "Obstacle pipe";
- private final Area areaGnome = (new Area(2489, 3435, 2482, 3438));
- private final Area areaBarbSwing = (new Area(2546, 9948, 2555, 9955));
- private final Area areBarbSwingTop = (new Area(2551, 3554, 2552, 3554));
- private final Area areaBarbEdge = (new Area(2533, 3547, 2537, 3545));
- private final Area areaBarbWall = (new Area(2536, 3551, 2534, 3555));
- private final Area areaBarbWallDone = (new Area(2543, 3551, 2545, 3555));
- private final Area areaBarbEdgeOutside = (new Area(2539, 3548, 2541, 3544));
- private final Area areaBarbEdgeWater = (new Area(2549, 3543, 2542, 3542));
- private final Area areaBarbLog = (new Area(2252, 3547, 2550, 3545));
- private final Area wildPipeArea = (new Area(3005, 3949, 3003, 3951));
- private final Area wildLadderUpArea = (new Area(3007, 3962, 3002, 3965));
- private final Area wildLogArea = (new Area(3001, 3946, 3002, 3943));
- private final Area wildSwingArea = (new Area(3008, 3948, 3003, 3954));
- private final Area wildSwingHalfArea = (new Area(3008, 3948, 3005, 3953));
- private final Area wildFailSwingArea = (new Area(2993, 10340, 3006, 10365));
- private final Area wildLadderUp = (new Area(3006, 10364, 3002, 10358));
- /* private final Area apeSwingArea = (new Area(2753, 2729, 2750, 2733));
- private final Area apeSteppingStoneArea = (new Area(2757, 2741, 2755, 2744));
- private final Area apeFailArea1 = (new Area(2757, 2748, 2757, 2748));
- private final Area apeStoneArea = (new Area(2753, 2742, 2753, 2742));
- private final Area apeTree1Area = (new Area(2753, 2742, 2753, 2742));
- private final Area apeBarArea = (new Area(2747, 2741, 2747, 2741));
- private final Area apeSkullArea = (new Area(2742, 2741, 2742, 2741));
- private final Area apeSwing2Area = (new Area(2756, 2731, 2756, 2731));
- private final Area apeFinalArea = (new Area(2770, 2747, 2770, 2747));*/
- String run = "False";
- Item food;
- String foodName;
- int eatLevel;
- int startHP;
- int randomInt;
- int pitch;
- int angle;
- private final Color color1 = new Color(255, 255, 255);
- private final Color color2 = new Color(0, 0, 0);
- private final BasicStroke stroke1 = new BasicStroke(1);
- private final Font font1 = new Font("Arial", 0, 14);
- private final Color color4 = new Color(255, 255, 255, 0);
- private final Color color3 = new Color(255, 255, 255);
- private final Color color5 = new Color(255, 255, 255);
- private final Font font5 = new Font("Arial Black", 1, 14);
- private final Image img3 = getImage("http://i42.tinypic.com/2hnrz29.png");
- private final Image img2 = getImage("http://i43.tinypic.com/b3sb42.png");
- private final Image img1 = getImage("http://i42.tinypic.com/5yz1aw.png");
- String status = "Loading";
- String course = "";
- long expPH;
- long startExp;
- long exp;
- long level;
- long leveled;
- long expTNL;
- int runInt;
- public long startTime = 0;
- public long millis = 0;
- public long hours = 0;
- public long minutes = 0;
- public long seconds = 0;
- public long last = 0;
- Point p;
- boolean setting = true;
- boolean progress = false;
- boolean info = false;
- boolean running = true;
- boolean drop = false;
- boolean gnome = false;
- boolean barb = false;
- boolean ape = false;
- boolean wild = false;
- Rectangle Settings = new Rectangle(428, 339, 50, 19);
- Rectangle main = new Rectangle(375, 338, 53, 20);
- Rectangle infoTab = new Rectangle(478, 339, 33, 19);
- Rectangle enableRun = new Rectangle(107, 349, 12, 11);
- Rectangle enableDrop = new Rectangle(107, 363, 12, 11);
- Rectangle enableGnome = new Rectangle(107, 379, 12, 11);
- Rectangle enableBarb = new Rectangle(126, 395, 12, 11);
- Rectangle enableApe = new Rectangle(113, 411, 12, 11);
- Rectangle enableWild = new Rectangle(317, 349, 12, 11);
- @Override
- public void onStart() {
- client.setMouseSpeed(random(5, 8));
- startExp = client.getSkills().getExperience(Skill.AGILITY);
- level = client.getSkills().getLevel(Skill.AGILITY);
- startTime = System.currentTimeMillis();
- status = "Starting script";
- startHP = client.getSkills().getCurrentLevel(Skill.HITPOINTS);
- randomInt = random(1,10);
- }
- @Override
- public void onExit() throws InterruptedException {
- if(!client.getInventory().contains(foodName)) {
- logoutTab.logOut();
- log("No food left logging out!");
- }
- }
- @Override
- public int onLoop() throws InterruptedException {
- Player player = myPlayer();
- food = client.getInventory().getItemForNameThatContains( "Lobster", "Shark", "Meat", "Shrimp", "Chicken",
- "Rabbit", "Anchovies", "Sardine", "Trout", "Cod", "Pike", "Salmon",
- "Tuna", "Bass", "Swordfish", "Monkfish", "Sea turtle", "Manta ray", "Toad's legs", "Cake");
- if(food != null) {
- foodName = food.getName();
- } else {
- foodName = null;
- }
- eatLevel = (startHP / 2) - randomInt;
- if (client.getSkills().getCurrentLevel(Skill.HITPOINTS) <= eatLevel && client.getInventory().contains(foodName)) {
- status = "Eating";
- client.getInventory().interactWithName(foodName, "Eat");
- randomInt = random(1,10);
- eatLevel = (startHP / 2) - randomInt;
- sleep(random(500, 900));
- }
- if (currentTab() != Tab.INVENTORY) {
- openTab(Tab.INVENTORY);
- }
- if (gnome == true) {
- course = "Gnome Course";
- Entity balanceLog = closestObjectForName(CROSS_LOG);
- Entity upNet = closestObjectForName(NET);
- Entity upBranch = closestObjectForName(BRANCH);
- Entity ropeBalance = closestObjectForName(ROPE);
- Entity branch2 = closestObjectForName(BRANCH);
- Entity overNet = closestObjectForName(NET);
- Entity pipeCrawl = closestObjectForName(PIPE);
- if (log == false && climbNet == 0 && branch == false
- && rope == false && downBranch == false && pipe == false) {
- if (balanceLog != null) {
- if (!player.isAnimating() && !player.isMoving()) {
- if (balanceLog.isVisible()) {
- status = "Walking across balancing log";
- balanceLog.interact("Walk-across");
- sleep(random(700, 900));
- } else {
- client.moveCameraToEntity(balanceLog);
- }
- }
- }
- }
- if (log == true && climbNet == 0 && branch == false
- && rope == false && downBranch == false && pipe == false) {
- if (upNet != null) {
- if (!player.isAnimating() && !player.isMoving()) {
- if (upNet.isVisible()) {
- status = "Climbing over net";
- upNet.interact("Climb-over");
- sleep(random(700, 900));
- } else {
- client.moveCameraToEntity(upNet);
- }
- }
- }
- }
- if (log == true && climbNet == 1 && branch == false
- && rope == false && downBranch == false && pipe == false) {
- if (upBranch != null) {
- if (!player.isAnimating() && !player.isMoving()) {
- if (upBranch.isVisible()) {
- status = "Climbing up branch";
- upBranch.interact("Climb");
- sleep(random(2000, 2200));
- } else {
- client.moveCameraToEntity(upBranch);
- }
- }
- }
- }
- if (log == true && climbNet == 1 && branch == true && rope == false
- && downBranch == false && pipe == false) {
- if (ropeBalance != null) {
- if (!player.isAnimating() && !player.isMoving()) {
- if (ropeBalance.isVisible()) {
- status = "Balancing on rope";
- ropeBalance.interact("Walk-on");
- sleep(random(700, 900));
- } else {
- client.rotateCameraToAngle(random(200, 240));
- }
- }
- }
- }
- if (log == true && climbNet == 1 && branch == true && rope == true
- && downBranch == false && pipe == false) {
- if (branch2 != null) {
- if (!player.isAnimating() && !player.isMoving()) {
- if (branch2.isVisible()) {
- status = "Climbing down branch";
- branch2.interact("Climb-down");
- sleep(random(700, 900));
- } else {
- client.moveCameraToEntity(branch2);
- }
- }
- }
- }
- if (log == true && climbNet == 1 && branch == true && rope == true
- && downBranch == true && pipe == false) {
- if (overNet != null) {
- if (!player.isAnimating() && !player.isMoving()) {
- if (overNet.isVisible()) {
- status = "Climbing over net";
- overNet.interact("Climb-over");
- sleep(random(700, 900));
- } else {
- client.rotateCameraToAngle(random(25, 75));
- }
- }
- }
- }
- if (log == true && climbNet == 2 && branch == true && rope == true
- && downBranch == true && pipe == false) {
- if (pipeCrawl != null) {
- if (!player.isAnimating() && !player.isMoving()) {
- if (pipeCrawl.isVisible()) {
- status = "Squeezing through pipe";
- pipeCrawl.interact("Squeeze-through");
- sleep(random(700, 900));
- } else {
- client.moveCameraToEntity(pipeCrawl);
- }
- }
- }
- }
- if (player.getAnimation() == 749) {
- sleep(random(700, 900));
- }
- if (player.isInArea(areaGnome) && log == true && climbNet == 2
- && branch == true && rope == true && downBranch == true
- && pipe == false) {
- log = false;
- branch = false;
- rope = false;
- downBranch = false;
- pipe = false;
- climbNet = 0;
- sleep(random(700, 900));
- }
- }
- if (running == true) {
- if (run == "False" && client.getRunEnergy() >= runInt) {
- status = "Toggling running";
- settingsTab.open();
- random(199, 246);
- setRunning(true);
- run = "True";
- } else if (run == "False" && client.getRunEnergy() == 100) {
- status = "Toggling running";
- settingsTab.open();
- random(199, 246);
- setRunning(true);
- run = "True";
- } else if (client.getRunEnergy() == 0) {
- runInt = random(1, 70);
- run = "False";
- }
- }
- if (barb == true) {
- course = "Barbarian Course";
- Position position = myPlayer().getPosition();
- Area area = new Area(position.getX(), position.getY() - 2,
- position.getX() + 3, position.getY() + 2);
- Entity swing = closestObjectForName("Ropeswing");
- Entity log = closestObjectForName("Log balance");
- Entity net = closestObjectForName("Obstacle net");
- Entity ledge = closestObjectForName("Balancing ledge");
- Entity wall = closestObjectForName(area, "Crumbling Wall");
- Entity ladder = closestObjectForName("Ladder");
- if(!client.getInventory().contains(foodName)) {
- stop();
- }
- if(player.isInArea(areaBarbEdgeWater) && !player.isAnimating() && !player.isMoving()) {
- status = "Re-trying log";
- walk(areaBarbLog);
- }
- if (player.isInArea(areaBarbEdge) && player.getZ() == 0) {
- if (!player.isAnimating() && !player.isMoving()) {
- status = "Re-trying ledge";
- climbNet = 0;
- walk(areaBarbEdgeOutside);
- }
- }
- if (player.isInArea(areaBarbSwing)) {
- if (ladder != null) {
- if (!player.isAnimating() && !player.isMoving()) {
- if (ladder.isVisible()) {
- status = "Climbing up ladder";
- ladder.interact("Climb-up");
- sleep(random(1500, 2000));
- } else {
- client.moveCameraToEntity(ladder);
- }
- }
- }
- }
- if (!player.isInArea(areBarbSwingTop) && ropeSwing == false
- && logBarb == false && climbNet == 0
- && BalanceLedge == false && player.getZ() == 0
- && crumblingWall == 0) {
- if (!player.isAnimating() && !player.isMoving()) {
- walk(areBarbSwingTop);
- }
- }
- if (ropeSwing == false && logBarb == false && climbNet == 0
- && BalanceLedge == false && player.getZ() == 0
- && crumblingWall == 0) {
- if (swing != null) {
- if (!player.isAnimating() && !player.isMoving()) {
- if (swing.isVisible()) {
- status = "Swinging across";
- swing.interact("Swing-on");
- sleep(random(700, 900));
- } else {
- walk(areBarbSwingTop);
- }
- }
- }
- }
- if (ropeSwing == true && logBarb == false && climbNet == 0
- && BalanceLedge == false && player.getZ() == 0
- && crumblingWall == 0) {
- if (log != null) {
- if (!player.isAnimating() && !player.isMoving()) {
- if (log.isVisible()) {
- status = "Walking across balancing log";
- log.interact("Walk-across");
- sleep(random(700, 900));
- } else {
- client.moveCameraToEntity(log);
- }
- }
- }
- }
- if (ropeSwing == true && logBarb == true && climbNet == 0
- && BalanceLedge == false && player.getZ() == 0
- && crumblingWall == 0) {
- if (net != null) {
- if (!player.isAnimating() && !player.isMoving()) {
- if (net.isVisible()) {
- status = "Climbing up net";
- net.interact("Climb-over");
- sleep(random(700, 900));
- } else {
- client.moveCameraToEntity(net);
- }
- }
- }
- }
- if (ropeSwing == true && logBarb == true && climbNet == 1
- && BalanceLedge == false && player.getZ() == 1
- && crumblingWall == 0) {
- if (ledge != null) {
- if (!player.isAnimating() && !player.isMoving()) {
- if (ledge.isVisible()) {
- status = "Edging across ledge";
- ledge.interact("Walk-across");
- sleep(random(1000, 1200));
- } else {
- client.moveCameraToEntity(ledge);
- }
- }
- }
- }
- if (ropeSwing == true && logBarb == true && climbNet == 1
- && BalanceLedge == true && player.getZ() == 1
- && crumblingWall == 0) {
- if (ladder != null) {
- if (!player.isAnimating() && !player.isMoving()) {
- if (ladder.isVisible()) {
- status = "Climbing down ladder";
- ladder.interact("Climb-down");
- sleep(random(1900, 2100));
- walk(areaBarbWall);
- } else {
- client.moveCameraToEntity(ladder);
- }
- }
- }
- }
- if (ropeSwing == true && logBarb == true && climbNet == 1
- && BalanceLedge == true && player.getZ() == 0
- && crumblingWall == 0 && !player.isInArea(areaBarbWall)) {
- if (!player.isAnimating() && !player.isMoving()) {
- status = "Walking to crumbling wall";
- walk(areaBarbWall);
- }
- }
- if (ropeSwing == true && logBarb == true && climbNet == 1
- && BalanceLedge == true && player.getZ() == 0
- && crumblingWall == 0 || crumblingWall == 1
- || crumblingWall == 2) {
- if (wall != null) {
- if (!player.isAnimating() && !player.isMoving()) {
- if (wall.isVisible()) {
- status = "Climbing over wall";
- wall.interact("Climb-over");
- sleep(random(700, 900));
- } else {
- client.moveCameraToEntity(wall);
- }
- }
- }
- }
- if (player.isInArea(areaBarbWallDone)) {
- ropeSwing = false;
- logBarb = false;
- climbNet = 0;
- BalanceLedge = false;
- crumblingWall = 0;
- }
- }
- if(ape == true) {
- log("Currently Not Availale, Please Wait for Update.");
- /* course = "Ape Toll Course";
- Entity stepStone = closestObjectForName("Stepping stone");
- Entity tree = closestObjectForName("Tropical tree");
- Entity bars = closestObjectForName("Monkeybars");
- Entity climbSkull = closestObjectForName("Skull slope");
- Entity swing = closestObjectForName("Rope");
- if(!client.getInventory().contains(foodName)) {
- stop();
- }
- if(player.isInArea(apeStoneArea)) {
- steppingStone = true;
- } else if(player.isInArea(apeTree1Area)) {
- tree1 = true;
- } else if(player.isInArea(apeBarArea)) {
- monkeyBars = true;
- } else if(player.isInArea(apeSkullArea)) {
- skullSlope = true;
- } else if(player.isInArea(apeSwing2Area)) {
- ropeSwing = true;
- } else if(player.isInArea(apeFinalArea)) {
- tree2 = true;
- }
- if(!player.isInArea(apeSteppingStoneArea)) {
- if(!player.isAnimating() && !player.isMoving()) {
- status = "Walking to stepping stone";
- walk(apeSteppingStoneArea);
- }
- }
- if(player.isInArea(apeFailArea1)) {
- if(!player.isAnimating() && !player.isMoving()) {
- steppingStone = false;
- tree1 = false;
- monkeyBars = false;
- skullSlope = false;
- ropeSwing = false;
- }
- }
- if (steppingStone == false && tree1 == false && monkeyBars == false && skullSlope == false && ropeSwing == false && tree2 == false && player.isInArea(apeSteppingStoneArea)) {
- if (!player.isAnimating() && !player.isMoving()) {
- if(stepStone != null) {
- if(stepStone.isVisible()) {
- status = "Stepping across stones";
- stepStone.interact("Jump-to");
- } else {
- client.moveCameraToEntity(stepStone);
- }
- }
- }
- }
- if (steppingStone == true && tree1 == true && monkeyBars == false && skullSlope == false && ropeSwing == false && tree2 == false) {
- if (!player.isAnimating() && !player.isMoving()) {
- if(tree != null) {
- if(tree.isVisible()) {
- status = "Climbing up tree";
- tree.interact("Climb");
- } else {
- client.moveCameraToEntity(tree);
- }
- }
- }
- }
- if (steppingStone == true && tree1 == true && monkeyBars == false && skullSlope == false && ropeSwing == false && tree2 == false && player.getZ() == 2) {
- if (!player.isAnimating() && !player.isMoving()) {
- if(bars != null) {
- if(bars.isVisible()) {
- status = "Going across monekey bars";
- bars.interact("Swing Across");
- } else {
- client.moveCameraToEntity(bars);
- }
- }
- }
- }
- if (steppingStone == true && tree1 == true && monkeyBars == true && skullSlope == false && ropeSwing == false && tree2 == false) {
- if (!player.isAnimating() && !player.isMoving()) {
- if(climbSkull != null) {
- if(climbSkull.isVisible()) {
- status = "Climbing skulls";
- climbSkull.interact("Climb-up");
- } else {
- client.moveCameraToEntity(climbSkull);
- }
- }
- }
- }
- if(steppingStone == true && tree1 == true && monkeyBars == true && skullSlope == true && ropeSwing == false && tree2 == false && !player.isInArea(apeSwingArea)) {
- if(!player.isAnimating() && !player.isMoving()) {
- status = "Walking to swing";
- walk(apeSwingArea);
- }
- }
- if (steppingStone == true && tree1 == true && monkeyBars == true && skullSlope == true && ropeSwing == false && tree2 == false && player.isInArea(apeSwingArea)) {
- if (!player.isAnimating() && !player.isMoving()) {
- if(swing != null) {
- if(swing.isVisible()) {
- status = "Climbing skulls";
- swing.interact("Swing");
- } else {
- client.moveCameraToEntity(swing);
- }
- }
- }
- }
- if (steppingStone == true && tree1 == true && monkeyBars == true && skullSlope == true && ropeSwing == true && tree2 == false) {
- if (!player.isAnimating() && !player.isMoving()) {
- if(tree != null) {
- if(tree.isVisible()) {
- status = "Climbing down";
- tree.interact("Climb-down");
- } else {
- client.moveCameraToEntity(tree);
- }
- }
- }
- }
- if (steppingStone == true && tree1 == true && monkeyBars == true && skullSlope == true && ropeSwing == true && tree2 == true) {
- steppingStone = false;
- tree1 = false;
- monkeyBars = false;
- skullSlope = false;
- ropeSwing = false;
- tree2 = false;
- }
- */
- }
- if(wild == true) {
- course = "Wilderness Course";
- Entity swing = closestObjectForName("Ropeswing");
- Entity logBalance = closestObjectForName("Log balance");
- Entity ladder = closestObjectForName("Ladder");
- Entity pipeCrawl = closestObjectForName(PIPE);
- Entity stepStone = closestObjectForName("Stepping stone");
- Entity climbRock = closestObjectForName("Rocks");
- if(!client.getInventory().contains(foodName)) {
- stop();
- }
- if(player.getAnimation() == 749) {
- sleep(random(2000, 2000));
- }
- if (pipe == false && ropeSwing == false && steppingStone == false && log == false && rocks == false) {
- if (!player.isAnimating() && !player.isMoving()) {
- if(pipeCrawl != null) {
- if(pipeCrawl.isVisible()) {
- status = "Squeezing through pipe";
- pipeCrawl.interact("Squeeze-through");
- } else {
- client.rotateCameraToAngle(random(250, 270));
- client.rotateCameraPitch(random(14, 32));
- }
- }
- }
- }
- if(player.isInArea(wildPipeArea)) {
- pipe = true;
- }
- if(player.isInArea(wildFailSwingArea)) {
- if(!player.isMoving()) {
- if(ladder != null) {
- if(ladder.isVisible()) {
- ladder.interact("Climb-up");
- sleep(random(700,900));
- } else {
- walk(wildLadderUp);
- }
- }
- }
- }
- if (pipe == true && ropeSwing == false && steppingStone == false && log == false && rocks == false && !player.isInArea(wildSwingArea)) {
- if (!player.isAnimating() && !player.isMoving()) {
- status = "Walking to swing";
- walk(wildSwingHalfArea);
- }
- }
- if (pipe == true && ropeSwing == false && steppingStone == false && log == false && rocks == false && player.isInArea(wildSwingArea)) {
- if (!player.isAnimating() && !player.isMoving()) {
- if(swing != null) {
- if(swing.isVisible()) {
- status = "Swinging across";
- swing.interact("Swing-on");
- } else {
- client.rotateCameraToAngle(random(50, 75));
- }
- }
- }
- }
- if (pipe == true && ropeSwing == true && steppingStone == false && log == false && rocks == false) {
- if (!player.isAnimating() && !player.isMoving()) {
- if(stepStone != null) {
- if(stepStone.isVisible()) {
- status = "Crossing lava";
- stepStone.interact("Cross");
- } else {
- client.rotateCameraPitch(random(300,380));
- client.rotateCameraToAngle(random(50, 75));
- }
- }
- }
- }
- if(player.isInArea(wildLadderUpArea) && pipe == true && ropeSwing == true && steppingStone == true && log == false && rocks == false) {
- steppingStone = false;
- }
- if (pipe == true && ropeSwing == true && steppingStone == true && log == false && rocks == false && !player.isInArea(wildLogArea)) {
- if (!player.isAnimating() && !player.isMoving()) {
- status = "Walking to log";
- walk(wildLogArea);
- }
- }
- if (pipe == true && ropeSwing == true && steppingStone == true && log == false && rocks == false && player.isInArea(wildLogArea)) {
- if (!player.isAnimating() && !player.isMoving()) {
- if(logBalance != null) {
- if(logBalance.isVisible()) {
- status = "Crossing log";
- logBalance.interact("Walk-across");
- } else {
- client.moveCameraToEntity(logBalance);
- }
- }
- }
- }
- if (pipe == true && ropeSwing == true && steppingStone == true && log == true && rocks == false) {
- if (!player.isMoving()) {
- if(climbRock != null) {
- if(climbRock.isVisible()) {
- status = "Climbing rock";
- climbRock.interact("Climb");
- } else {
- client.rotateCameraToAngle(random(110, 150));
- client.rotateCameraPitch(random(14, 32));
- }
- }
- }
- }
- if (pipe == true && ropeSwing == true && steppingStone == true && log == true && rocks == true) {
- pipe = false;
- ropeSwing = false;
- steppingStone = false;
- log = false;
- rocks = false;
- }
- }
- AntiBan();
- return random(500, 650);
- }
- private Image getImage(String url) {
- try {
- return ImageIO.read(new URL(url));
- } catch (IOException e) {
- return null;
- }
- }
- @Override
- public void onPaint(Graphics graphics) {
- pitch = client.getCameraPitch();
- angle = client.getCameraPitchAngle();
- exp = client.getSkills().getExperience(Skill.AGILITY) - startExp;
- leveled = client.getSkills().getLevel(Skill.AGILITY) - level;
- expTNL = experienceToNextLevel(Skill.AGILITY);
- millis = System.currentTimeMillis() - startTime;
- hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- seconds = millis / 1000;
- expPH = (int) ((exp) * 3600000D / (System.currentTimeMillis() - startTime));
- Graphics2D g = (Graphics2D) graphics;
- if (!setting) {
- // nothing
- } else {
- g.drawImage(img2, -3, 266, null);
- g.setColor(color4);
- g.fillRect(107, 349, 12, 11);
- g.setColor(color3);
- g.setStroke(stroke1);
- g.drawRect(107, 349, 12, 11);
- g.setColor(color4);
- g.fillRect(107, 363, 12, 11);
- g.setColor(color3);
- g.drawRect(107, 363, 12, 11);
- g.setColor(color4);
- g.fillRect(107, 379, 12, 11);
- g.setColor(color3);
- g.drawRect(107, 379, 12, 11);
- g.setColor(color4);
- g.fillRect(126, 395, 12, 11);
- g.setColor(color3);
- g.drawRect(126, 395, 12, 11);
- g.setColor(color4);
- g.fillRect(113, 411, 12, 11);
- g.setColor(color3);
- g.drawRect(113, 411, 12, 11);
- g.setColor(color4);
- g.fillRect(317, 349, 12, 11);
- g.setColor(color3);
- g.drawRect(317, 349, 12, 11);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(478, 339, 33, 19);// info
- g.drawRect(375, 338, 53, 20);// main
- g.drawRect(428, 339, 50, 19);// settings
- }
- if (!progress) {
- // nothing
- } else {
- g.drawImage(img1, -3, 266, null);
- g.setFont(font1);
- g.setColor(color1);
- g.drawString("" + +hours + " hours " + minutes + " minutes "
- + seconds + " seconds", 94, 362);
- g.drawString("" + exp, 104, 382);
- g.drawString("" + expPH, 135, 403);
- g.drawString("" + expTNL, 84, 424);
- g.drawString("" + course, 389, 380);
- g.drawString("" + level + "(+" + leveled + ")", 303, 401);
- g.drawString("" + status, 322, 425);
- g.drawString("Food: " + foodName, 10, 100);
- g.drawString("HP: " + client.getSkills().getCurrentLevel(Skill.HITPOINTS), 10, 120);
- g.drawString("Eating at " + eatLevel, 10, 140);
- g.drawString("Running at " + runInt, 10, 160);
- g.drawString("Camera pitch is " + pitch, 10, 200);
- g.drawString("Camera angle is " + angle, 10, 220);
- g.drawString("Running? " + run, 10, 180);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(478, 339, 33, 19);// info
- g.drawRect(375, 338, 53, 20);// main
- g.drawRect(428, 339, 50, 19);// settings
- }
- if (!info) {
- // nothing
- } else {
- g.drawImage(img3, -3, 266, null);
- g.setFont(font1);
- g.setColor(color1);
- g.drawString("BETA 1.4", 155, 414);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(478, 339, 33, 19);// info
- g.drawRect(375, 338, 53, 20);// main
- g.drawRect(428, 339, 50, 19);// settings
- }
- if (setting == true) {
- if (!running) {
- // nothing..
- } else {
- g.setFont(font5);
- g.setColor(color5);
- g.drawString("X", 107, 359);
- }
- if (!drop) {
- // nothing..
- } else {
- g.setFont(font5);
- g.setColor(color5);
- g.drawString("X", 107, 373);
- }
- if (!gnome) {
- // nothing..
- } else {
- g.setFont(font5);
- g.setColor(color5);
- g.drawString("X", 107, 389);
- }
- if (!barb) {
- // nothing..
- } else {
- g.setFont(font5);
- g.setColor(color5);
- g.drawString("X", 126, 405);
- }
- if (!ape) {
- // nothing..
- } else {
- g.setFont(font5);
- g.setColor(color5);
- g.drawString("X", 113, 421);
- }
- if (!wild) {
- // nothing..
- } else {
- g.setFont(font5);
- g.setColor(color5);
- g.drawString("X", 317, 359);
- }
- }
- }
- public void onMessage(String message) throws InterruptedException {
- if (message.contains("You walk carefully across the slippery log...")) {
- if (gnome == true) {
- log = true;
- }
- }
- if (message.contains("You climb the netting...")) {
- climbNet++;
- }
- if (message.contains("...To the platform above")) {
- branch = true;
- }
- if (message.contains("You carefully cross the tightrope.")) {
- rope = true;
- }
- if (message.contains("You carefully start")) {
- sleep(random(6100, 6200));
- }
- if (message.contains("You climb down the tree...")) {
- downBranch = true;
- }
- if (message.contains("You skillfully swing across.")) {
- ropeSwing = true;
- }
- if (message.contains("You make it safely")) {
- logBarb = true;
- }
- if (message.contains("You reach the top")) {
- rocks = true;
- }
- if(message.contains("You safely cross to the other side")) {
- steppingStone = true;
- }
- if (message.contains("You skillfully edge across the gap.")) {
- log = true;
- BalanceLedge = true;
- }
- if (message.contains("You climb the low wall...")) {
- crumblingWall++;
- }
- }
- public void AntiBan() throws InterruptedException {
- int randomNum = (random(1, 500));
- if (randomNum == 1) {
- status = "Anti-Ban";
- client.rotateCameraPitch(random(35, 60));
- } else if (randomNum == 33) {
- status = "Anti-Ban";
- client.rotateCameraToAngle(random(100, 350));
- } else if (randomNum == 57) {
- status = "Anti-Ban";
- openTab(Tab.SKILLS);
- if (client.getInterface(320).getChild(127).isVisible()) {
- client.getInterface(320).getChild(127).hover();
- sleep(random(1200, 1500));
- openTab(Tab.INVENTORY);
- }
- } else if (randomNum == 437) {
- status = "Anti-Ban";
- client.rotateCameraPitch(random(15, 50));
- } else if (randomNum == 43) {
- status = "Anti-Ban";
- client.rotateCameraPitch(random(84, 100));
- } else if (randomNum == 78) {
- status = "Anti-Ban";
- client.rotateCameraPitch(random(5, 19));
- } else if (randomNum == 443) {
- status = "Anti-Ban";
- moveMouseOutsideScreen();
- } else if (randomNum == 13) {
- status = "Anti-Ban";
- client.rotateCameraPitch(random(67, 90));
- client.rotateCameraToAngle(random(43, 68));
- }
- }
- @Override
- public void mouseClicked(MouseEvent e) {
- p = e.getPoint();
- if (setting == true) {
- // running support
- if (enableRun.contains(p) && !running) {
- running = true;
- } else if (enableRun.contains(p) && running) {
- running = false;
- }
- if (enableDrop.contains(p) && !drop) {
- drop = true;
- } else if (enableDrop.contains(p) && drop) {
- drop = false;
- }
- if (enableGnome.contains(p) && !gnome) {
- gnome = true;
- } else if (enableGnome.contains(p) && gnome) {
- gnome = false;
- }
- if (enableBarb.contains(p) && !barb) {
- barb = true;
- } else if (enableBarb.contains(p) && barb) {
- barb = false;
- }
- if (enableApe.contains(p) && !ape) {
- ape = true;
- } else if (enableApe.contains(p) && ape) {
- ape = false;
- }
- if (enableWild.contains(p) && !wild) {
- wild = true;
- } else if (enableWild.contains(p) && wild) {
- wild = false;
- }
- }
- // settings
- if (Settings.contains(p) && !setting) {
- setting = true;
- progress = false;
- info = false;
- }
- // main
- if (main.contains(p) && !progress) {
- progress = true;
- setting = false;
- info = false;
- }
- // info
- if (infoTab.contains(p) && !info) {
- info = true;
- setting = false;
- progress = false;
- }
- }
- public boolean WalkAlongPath(int[][] path, boolean AscendThroughPath,
- int distanceFromEnd) {
- if (distanceToPoint(AscendThroughPath ? path[path.length - 1][0]
- : path[0][0], AscendThroughPath ? path[path.length - 1][1]
- : path[0][1]) <= distanceFromEnd)
- return true;
- else {
- WalkAlongPath(path, AscendThroughPath);
- return false;
- }
- }
- public void WalkAlongPath(int[][] path, boolean AscendThroughPath) {
- int destination = 0;
- for (int i = 0; i < path.length; i++)
- if (distanceToPoint(path[i][0], path[i][1]) < distanceToPoint(
- path[destination][0], path[destination][1]))
- destination = i;
- if (client.getMyPlayer().isMoving()
- && distanceToPoint(path[destination][0], path[destination][1]) > (isRunning() ? 3
- : 2))
- return;
- if (AscendThroughPath && destination != path.length - 1
- || !AscendThroughPath && destination != 0)
- destination += (AscendThroughPath ? 1 : -1);
- try {
- walk(new Position(path[destination][0], path[destination][1], 0));
- Thread.sleep(700 + MethodProvider.random(600));
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- private int distanceToPoint(int pointX, int pointY) {
- return (int) Math.sqrt(Math
- .pow(client.getMyPlayer().getX() - pointX, 2)
- + Math.pow(client.getMyPlayer().getY() - pointY, 2));
- }
- private int experienceToNextLevel(Skill skill) {
- int[] xpForLevels = new int[] { 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 };
- int xp = client.getSkills().getExperience(skill);
- for (int i = 0; i < 99; i++) {
- if (xp < xpForLevels[i]) {
- return (xpForLevels[i] - xp);
- }
- }
- return (200000000 - xp);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment