Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.event.MouseEvent;
- import java.awt.event.MouseListener;
- import org.rsbot.script.wrappers.RSComponent;
- import java.awt.*;
- import java.awt.image.BufferedImage;
- import org.rsbot.event.events.MessageEvent;
- import org.rsbot.event.listeners.MessageListener;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.*;
- import org.rsbot.script.methods.Game;
- import org.rsbot.script.methods.Magic;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.script.wrappers.*;
- @ScriptManifest(authors = { "vADmn" }, keywords = { "hunter kit, magic, lunar" }, name = "vHuntKitPro", description = "A bot that makes hunter kits gaining 150k+ xp/ph", version = 1.1)
- public class VHKPro extends Script implements MessageListener, PaintListener, MouseListener {
- public int[] chest = { 42192, 4483 };
- public int astral = 9075;
- public int astralprice = 106;
- public int hunterkit = 11159;
- public boolean useBank = false;
- public String Status;
- BufferedImage normal = null;
- BufferedImage clicked = null;
- int startExp;
- int xpGained = 0;
- int spellCasted = 0;
- public int EstCast;
- public int startLevel;
- public int lvlsGained;
- public int expPerCast = 70;
- public int castsTNL;
- private int percentTNL;
- public int expHour = 0;
- public int currLevel;
- public long startTime = 0;
- public long millis = 0;
- public long hours = 0;
- public long minutes = 0;
- public long seconds = 0;
- public long last = 0;
- public boolean showPaint = true;
- private final Color color1 = new Color(0, 0, 0, 186);
- private final Color color2 = new Color(255, 0, 0);
- private final Color color3 = new Color(255, 255, 255);
- private final BasicStroke stroke1 = new BasicStroke(1);
- private final BasicStroke stroke2 = new BasicStroke(2);
- private final Font font1 = new Font("Arial", 1, 18);
- private final Font font2 = new Font("Arial", 1, 11);
- @Override
- public boolean onStart() {
- Status = "Starting vHunterKitPro...";
- startExp = skills.getCurrentExp(Skills.MAGIC);
- startLevel = skills.getCurrentLevel(Skills.MAGIC);
- startTime = System.currentTimeMillis();
- mouse.setSpeed(random(5, 6));
- log("vHunterKitPro Started");
- sleep(random(50, 90));
- return true;
- }
- @Override
- public void mouseClicked(MouseEvent e) {
- RSComponent inter = interfaces.get(137).getComponent(0);
- if (inter.getArea().contains(e.getPoint())) {
- if (showPaint) {
- showPaint = !showPaint;
- } else {
- showPaint = true;
- }
- }
- }
- public int cast() {
- if (game.getCurrentTab() != Game.TAB_MAGIC) {
- game.openTab(Game.TAB_MAGIC);
- } else {
- magic.castSpell(Magic.SPELL_HUNTER_KIT);
- }
- return random(10, 65);
- }
- public int bank() {
- antiBanB();
- RSObject Bank = objects.getNearest(chest);
- if (!bank.isOpen()) {
- mouse.setSpeed(random(5, 7));
- Bank.doClick();
- sleep(random(800, 1200));
- } else if (bank.isOpen()) {
- mouse.setSpeed(random(5, 7));
- bank.depositAllExcept(astral);
- sleep(random(450, 820));
- bank.close();
- useBank = false;
- antiBanB();
- }
- return random(200, 400);
- }
- private void antiBanA() {
- Status = "Anti-Ban(1)";
- int r = random(0, 110);
- switch (r) {
- case 27:
- mouse.moveRandomly(2, 7);
- sleep(random(20, 80));
- case 12:
- sleep(random(50, 80));
- break;
- case 88:
- sleep(random(350, 2780));
- mouse.moveRandomly(2, 6);
- break;
- case 61:
- sleep(random(1150, 3380));
- mouse.moveRandomly(2, 5);
- break;
- case 19:
- mouse.setSpeed(random(4, 6));
- sleep(random(3200, 4650));
- mouse.moveRandomly(3, 7);
- break;
- case 51:
- mouse.setSpeed(random(4, 6));
- sleep(random(50,270));
- break;
- case 93:
- sleep(random(80, 180));
- break;
- case 15:
- mouse.moveRandomly(3, 7);
- sleep(random(30, 150));
- }
- }
- public void antiBanB() {
- Status = "Anti-Ban(2)";
- int y = random(0, 100);
- switch (y) {
- case 84:
- mouse.moveOffScreen();
- sleep(random(5000, 15400));
- mouse.moveRandomly(random(450, 800));
- break;
- case 78:
- mouse.moveOffScreen();
- sleep(random(4000, 14400));
- break;
- case 32:
- mouse.moveRandomly(random(500, 1100));
- sleep(random(1150, 2390));
- break;
- case 15:
- sleep(random(800, 1200));
- mouse.moveRandomly(10, 50);
- sleep(random(30, 50));
- mouse.setSpeed(random(4, 5));
- skills.doHover(Skills.INTERFACE_MAGIC);
- sleep(random(4000, 8700));
- mouse.moveSlightly();
- sleep(random(30, 90));
- break;
- case 57:
- sleep(random(310, 410));
- break;
- case 25:
- mouse.setSpeed(random(4, 7));
- break;
- case 31:
- mouse.setSpeed(random(4, 5));
- mouse.moveSlightly();
- mouse.moveSlightly();
- mouse.setSpeed(random(5, 7));
- sleep(random(50,90));
- break;
- case 68:
- sleep(random(150, 380));
- break;
- case 40:
- sleep(random(50, 80));
- mouse.moveRandomly(random(1500, 2100));
- sleep(random(50, 90));
- skills.doHover(Skills.INTERFACE_MAGIC);
- sleep(random(2000, 3000));
- mouse.moveSlightly();
- sleep(random(30, 90));
- break;
- case 74:
- sleep(random(100, 150));
- break;
- case 36:
- mouse.moveSlightly();
- sleep(random(30, 50));
- skills.doHover(Skills.INTERFACE_MAGIC);
- sleep(random(6000, 9000));
- mouse.moveSlightly();
- sleep(random(20, 120));
- break;
- case 96:
- mouse.moveSlightly();
- mouse.setSpeed(random(4, 6));
- sleep(random(380, 570));
- break;
- case 100:
- sleep(random(30, 50));
- skills.doHover(Skills.INTERFACE_MAGIC);
- sleep(random(6000, 9000));
- mouse.moveSlightly();
- sleep(random(100, 150));
- break;
- }
- }
- @Override
- public int loop() {
- Status = "Casting";
- antiBanA();
- if (useBank)
- return bank();
- return cast();
- }
- @Override
- public void messageReceived(MessageEvent e) {
- String message = e.getMessage();
- if (message
- .matches("You need at least one free inventory space to cast this spell.")) {
- Status = "Banking";
- useBank = true;
- }
- if (message.contains("enough astral runes")) {
- env.saveScreenshot(true);
- stopScript();
- log("Run out of astral runes, shutting down.");
- }
- if (message.contains("You've just advanced a")) {
- env.saveScreenshot(true);
- log("Level up, screenshotting...");
- }
- }
- @Override
- public void onFinish() {
- log("Thank you for using vHuntKitPro.");
- env.saveScreenshot(true);
- }
- @Override
- public void mouseEntered(MouseEvent e) {
- // TODO Auto-generated method stub
- }
- @Override
- public void mouseExited(MouseEvent e) {
- // TODO Auto-generated method stub
- }
- @Override
- public void mousePressed(MouseEvent e) {
- // TODO Auto-generated method stub
- }
- @Override
- public void mouseReleased(MouseEvent e) {
- // TODO Auto-generated method stub
- }
- // END: Paint Code generated using Enfilade's Easel, design and modification by vadmn
- @Override
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D) g1;
- castsTNL = skills.getExpToNextLevel(Skills.MAGIC) / expPerCast;
- currLevel = skills.getCurrentLevel(Skills.MAGIC);
- lvlsGained = currLevel - startLevel;
- 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;
- EstCast = skills.getExpToNextLevel(Skills.MAGIC) / 65;
- expHour = (int) ((xpGained) * 3600000D / (System.currentTimeMillis() - startTime));
- percentTNL = skills.getPercentToNextLevel(Skills.MAGIC);
- xpGained = skills.getCurrentExp(Skills.MAGIC) - startExp;
- spellCasted = xpGained / 70;
- final int percentBar = (int) (skills
- .getPercentToNextLevel(Skills.MAGIC) * 5.1);
- g.setColor(color2);
- g.fillRect(1, 318, percentBar, 18);
- g.setColor(color1);
- g.drawRect(1, 318, percentBar, 18);
- g.setColor(color1);
- if(showPaint){
- g.fillRoundRect(1, 338, 517, 140, 0, 16);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRoundRect(1, 338, 517, 140, 0, 16);
- g.setColor(color1);
- g.fillRoundRect(350, 4, 165, 21, 16, 16);
- g.setColor(color2);
- g.setStroke(stroke2);
- g.drawRoundRect(350, 4, 165, 21, 16, 16);
- g.setColor(color1);
- g.fillRoundRect(350, 52, 165, 21, 16, 16);
- g.setColor(color2);
- g.drawRoundRect(350, 52, 165, 21, 16, 16);
- g.setColor(color1);
- g.fillRoundRect(350, 28, 165, 21, 16, 16);
- g.setColor(color2);
- g.drawRoundRect(350, 28, 165, 21, 16, 16);
- g.setFont(font1);
- g.setColor(color3);
- g.drawString("vHunterKit Pro v1.1", 13, 360);
- g.setFont(font2);
- g.drawString("XP/ph: " + expHour, 13, 386);
- g.drawString("Percent/tnl: " + percentTNL, 13, 412);
- g.drawString("By vADmn", 191, 373);
- g.drawString("XP/tnl: " + skills.getExpToNextLevel(Skills.MAGIC), 13,
- 399);
- g.drawString("Spells Casted: " + spellCasted, 13, 425);
- g.drawString("Time Running: "+ hours +"h"+ minutes + "m" + seconds + "s", 363, 20);
- g.drawString("Status: " + Status, 363, 44);
- g.drawString("Location: Soul Wars", 363, 68);
- g.drawString("Casts/tnl: " + castsTNL, 13, 438);
- g.drawString("XP Gained: " + xpGained, 13, 451);
- g.drawString("Profit Loss: "+ "-" +astralprice*2*spellCasted, 165, 387);
- g.drawString("Levels Gained: " + lvlsGained, 165, 399);
- } else {
- g.setFont(font2);
- g.setColor(color1);
- g.drawString("vHunterKit Pro v1.1", 392, 470);
- }
- }
- }
- // END: Paint Code generated using Enfilade's Easel, design and modification by vadmn
Add Comment
Please, Sign In to add comment