Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.rsbuddy.event.listeners.PaintListener;
- import com.rsbuddy.script.ActiveScript;
- import com.rsbuddy.script.Manifest;
- import com.rsbuddy.script.methods.Camera;
- import com.rsbuddy.script.methods.Game;
- import com.rsbuddy.script.methods.Mouse;
- import com.rsbuddy.script.methods.Objects;
- import com.rsbuddy.script.methods.Skills;
- import com.rsbuddy.script.util.Random;
- import com.rsbuddy.script.wrappers.GameObject;
- import java.awt.*;
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- @Manifest(authors = {"b0xb0x"}, keywords = {"Agility", "Low wall"}, name = "Low Wall Climber", version = 1.1, description = "Start at either low wall in Brimhaven Agility Arena.")
- public class LowWallClimber extends ActiveScript implements PaintListener {
- private static final int lowWallID = 3565;
- private long startTime;
- private long runTime;
- int wallAttempted = -1;
- int wallSucceeded = 0;
- int wallFailed = 0;
- int startExp;
- int currentLevel;
- int currentExp;
- int startLevel;
- int expGained;
- int expPerHr;
- int levelsGained;
- int wallToLvl;
- int expToLvl;
- int wallPerHr;
- int seconds;
- int minutes;
- int hours;
- public boolean onStart() {
- log("Starting script!");
- Mouse.setSpeed(Random.nextInt(6, 8));
- startTime = System.currentTimeMillis();
- startExp = Skills.getCurrentExp(Skills.AGILITY);
- startLevel = Skills.getCurrentLevel(Skills.AGILITY);
- return true;
- }
- public int loop() {
- hopWall();
- antiBan();
- return Random.nextInt(4500, 4700);
- }
- public void onFinish() {
- int seconds = (int) (runTime / 1000);
- int minutes = 0;
- int hours = 0;
- if (seconds >= 60) {
- minutes = seconds / 60;
- seconds -= minutes * 60;
- }
- if (minutes >= 60) {
- hours = minutes / 60;
- minutes -= hours * 60;
- }
- log("Thanks for using Low Wall Climber!");
- log("-----------------------------------------------");
- log("Ran for " + hours + ":" + minutes + ":" + seconds + ".");
- log("Gained " + expGained + " agility experience.");
- log("Gained " + levelsGained + " levels.");
- log("Climbed " + wallSucceeded + " walls.");
- }
- private boolean hopWall() {
- GameObject lowWall = Objects.getNearest(3565);
- if (lowWall != null) {
- lowWall.interact("Climb-over");
- Mouse.moveSlightly();
- wallAttempted++;
- }
- return true;
- }
- private boolean antiBan() {
- final int random = Random.nextInt(1,20);
- if (random == 1)
- Camera.setCompassAngle(Random.nextInt(56, 65));
- if (random == 2)
- Camera.setCompassAngle(Random.nextInt(189, 265));
- if (random == 5)
- Camera.setCompassAngle(Random.nextInt(93, 167));
- if (random == 6)
- Camera.setCompassAngle(Random.nextInt(13, 46));
- if (random == 7)
- Camera.setCompassAngle(Random.nextInt(253, 267));
- if (random == 8)
- Camera.setCompassAngle(Random.nextInt(132, 256));
- return true;
- }
- public void onRepaint(Graphics g1) {
- if (Game.isLoggedIn()) {
- runTime = System.currentTimeMillis() - startTime;
- expToLvl = Skills.getExpToNextLevel(Skills.AGILITY);
- currentLevel = Skills.getCurrentLevel(Skills.AGILITY);
- currentExp = Skills.getCurrentExp(Skills.AGILITY);
- expGained = currentExp - startExp;
- expPerHr = (int) (expGained * 3600000.0D / runTime);
- levelsGained = currentLevel - startLevel;
- wallSucceeded = expGained / 8;
- wallFailed = wallAttempted - wallSucceeded;
- wallToLvl = expToLvl / 8;
- wallPerHr = (int) (wallSucceeded * 3600000.0D / runTime);
- int seconds = (int) (runTime / 1000);
- int minutes = 0;
- int hours = 0;
- if (seconds >= 60) {
- minutes = seconds / 60;
- seconds -= minutes * 60;
- }
- if (minutes >= 60) {
- hours = minutes / 60;
- minutes -= hours * 60;
- }
- Graphics2D g = (Graphics2D) g1;
- g.setColor(new Color(0, 100, 100, 150));
- g.fillRoundRect(549, 207, 186, 256, 16, 16);
- g.setColor(new Color(255, 255, 255));
- g.setFont(new Font("GEORGE", Font.BOLD, 22));
- g.drawString("Low Wall Climber", 555, 237);
- g.setFont(new Font("Palatino Linotype", Font.PLAIN, 13));
- g.drawString("Script by b0xb0x" , 565, 253);
- g.drawString("Time elapsed: " + hours + ":" + minutes + ":" + seconds, 565, 272);
- g.drawString("Current level: " + currentLevel, 565, 286);
- g.drawString("Levels gained: " + levelsGained, 565, 300);
- g.drawString("Exp gained: " + expGained, 565, 322);
- g.drawString("Exp/hr: " + expPerHr, 565, 336);
- g.drawString("Exp to level: " + expToLvl, 565, 350);
- g.drawString("Walls climbed: " + wallSucceeded, 565, 372);
- g.drawString("Walls attemped: " + wallAttempted, 565, 386);
- g.drawString("Walls failed: " + wallFailed, 565, 400);
- g.drawString("Walls to lvl: " + wallToLvl, 565, 414);
- g.drawString("Walls/hr: " + wallPerHr, 565, 428);
- g.setColor(new Color(125, 0, 0));
- g.fill3DRect(585, 438, 100, 11, true);
- g.setColor(new Color(0, 125, 0));
- g.fill3DRect(585, 438, Skills.getPercentToNextLevel(Skills.AGILITY), 11, true);
- g.setColor(new Color(255, 255, 255));
- g.drawString(Skills.getPercentToNextLevel(Skills.AGILITY) + "% to " + (Skills.getCurrentLevel(Skills.AGILITY) + 1), 605, 448);
- g.setColor(new Color(255, 255, 255));
- g.setFont(new Font("Palatino Linotype", Font.PLAIN, 10));
- g.drawString("V 1.1", 700, 460);
- g.setColor(new Color(0, 250, 50));
- g.drawLine((Mouse.getLocation().x - 8), (Mouse.getLocation().y), (Mouse.getLocation().x + 8), (Mouse.getLocation().y));
- g.drawLine((Mouse.getLocation().x - 7), (Mouse.getLocation().y + 1), (Mouse.getLocation().x + 7), (Mouse.getLocation().y + 1));
- g.drawLine((Mouse.getLocation().x - 7), (Mouse.getLocation().y - 1), (Mouse.getLocation().x + 7), (Mouse.getLocation().y - 1));
- g.drawLine((Mouse.getLocation().x), (Mouse.getLocation().y - 8), (Mouse.getLocation().x), (Mouse.getLocation().y + 8));
- g.drawLine((Mouse.getLocation().x + 1), (Mouse.getLocation().y - 7), (Mouse.getLocation().x + 1), (Mouse.getLocation().y + 7));
- g.drawLine((Mouse.getLocation().x - 1), (Mouse.getLocation().y - 7), (Mouse.getLocation().x - 1), (Mouse.getLocation().y + 7));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement