Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import java.util.*;
- import java.io.*;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.RenderingHints;
- import java.awt.Color;
- import javax.swing.*;
- import javax.swing.border.*;
- import org.rsbot.bot.Bot;
- import org.rsbot.script.*;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.methods.Game;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.wrappers.RSComponent;
- import org.rsbot.script.wrappers.RSInterface;
- import org.rsbot.script.methods.*;
- import org.rsbot.event.listeners.*;
- import org.rsbot.event.listeners.PaintListener;
- @ScriptManifest(authors = "Beuner", keywords = "", name = "Alch Pro", version = 2.2, description = "Alchs Anything")
- public class AlchPro extends Script implements PaintListener {
- public int NatID = 561;
- public int StaffID[] = {1387, 1401, 3054, 3053, 1393};
- public int startExp;
- public int gainedExp;
- public int startLvl;
- public int gainedLvls;
- public int ExpHour = 0;
- public int xpLevel;
- private int currentLevel;
- public int castHour = 0;
- public int castTotal;
- private long startTime;
- private long nextLvl;
- private long runTime;
- private long expLevel;
- public long timeLevel;
- private int percentLevel;
- public int alchLvl;
- private final Font font1 = new Font("Tahoma", Font.BOLD, 11);
- private final Font font2 = new Font("Tahoma", Font.PLAIN, 11);
- private final Color color1 = new Color(0, 0, 0, 180);
- public boolean onStart() {
- startExp = skills.getCurrentExp(skills.MAGIC);
- startLvl = skills.getRealLevel(skills.MAGIC);
- startTime = System.currentTimeMillis();
- inventory.getCount(true, 562);
- log("Alch Pro");
- log("Checking Nature Runes");
- sleep(random(100,250));
- log("Checking Staff");
- if (!inventory.containsOneOf(NatID)) {
- log("No Nature Runes Detected");
- stopScript(true);
- }
- if (!equipment.containsOneOf(StaffID)) {
- log("No Staff Detected");
- stopScript(true);
- }
- log("Taking Picture of Starting Stats");
- mouse.move(random(588, 607), random(173, 193));
- sleep(random(230, 400));
- mouse.click(true);
- sleep(random(100, 230));
- mouse.move(random(556, 603), random(354, 368));
- sleep(random(1000, 2300));
- env.saveScreenshot(true);
- sleep(random(2400, 3700));
- if (game.getCurrentTab() != Game.TAB_MAGIC) {
- game.openTab(Game.TAB_MAGIC);
- log("Nature Runes Detected!");
- sleep(random(150, 230));
- log("Staff Detected!");
- }
- return true;
- }
- public boolean Alch() {
- sleep(random(275,300));
- mouse.click(true);
- sleep(random(190, 350));
- interfaces.getComponent(192, 59).doClick();
- return true;
- }
- public void antiBan() {
- int rand = random(1, 100);
- switch (rand) {
- case 1:
- if (random(1, 10) == 1) {
- log("Checking Inventory");
- game.openTab(Game.TAB_INVENTORY);
- if (inventory.getCount(NatID) == 0) {
- log("No Law Runes Left");
- stopScript(true);
- }
- sleep(random(987, 2356));
- mouse.move(random(741, 755), random(176, 194));
- sleep(random(123, 310));
- mouse.click(true);
- mouse.move(random(564, 579), random(369, 375));
- sleep(random(420, 560));
- mouse.click(true);
- sleep(random(210, 290));
- mouse.click(true);
- }
- break;
- case 2:
- if (random(1, 30) == 1) {
- log("Checking Stats");
- mouse.move(random(590, 599), random(174, 192));
- sleep(random(15, 19));
- mouse.click(true);
- sleep(random(57, 73));
- mouse.move(random(556, 603), random(354, 368));
- sleep(random(3250, 12321));
- game.openTab(Game.TAB_MAGIC);
- mouse.move(random(741, 755), random(176, 194));
- sleep(random(123, 310));
- mouse.click(true);
- mouse.move(random(564, 579), random(369, 375));
- sleep(random(420, 560));
- mouse.click(true);
- sleep(random(210, 290));
- mouse.click(true);
- }
- break;
- case 3:
- if (random(1, 50) == 1) {
- log("Checking Friends");
- mouse.move(random(557, 572), random(476, 492));
- sleep(random(123, 423));
- mouse.click(true);
- sleep(random(1368,5398));
- mouse.move(random(741, 755), random(176, 194));
- sleep(random(123, 310));
- mouse.click(true);
- mouse.move(random(564, 579), random(369, 375));
- sleep(random(420, 560));
- mouse.click(true);
- sleep(random(210, 290));
- mouse.click(true);
- }
- break;
- case 4:
- if (random(1, 20) == 1) {
- log("Moving Camera");
- camera.setAngle(random(98, 278));
- }
- break;
- case 5:
- if (random(1, 35) == 1) {
- log("AFK");
- mouse.moveOffScreen();
- sleep(random(798, 86214));
- mouse.move(random(741, 755), random(176, 194));
- sleep(random(123, 310));
- mouse.click(true);
- mouse.move(random(564, 579), random(369, 375));
- sleep(random(420, 560));
- mouse.click(true);
- sleep(random(210, 290));
- mouse.click(true);
- }
- case 6:
- if (random(1, 5) == 1) {
- if (ExpHour < 55000 && runTime < 1800000 && runTime > 300000) {
- log("<55k Exp/Hr at <30min Runtime");
- log("Force Stopping Script");
- game.openTab(Game.TAB_MAGIC);
- sleep(random(1000,2300));
- env.saveScreenshot(true);
- sleep(random(2000, 2500));
- stopScript(true);
- }
- if (ExpHour > 55000 && runTime < 1800000) {
- log(">55k Exp/Hr at <30min Runtime");
- log("Script Resuming");
- }
- if (ExpHour < 60000 && runTime > 1800000 && runTime < 3600000) {
- log("<60k Exp/Hr at <1Hr Runtime");
- log("Force Stopping Script");
- game.openTab(Game.TAB_MAGIC);
- sleep(random(1000,2300));
- env.saveScreenshot(true);
- sleep(random(2000, 2500));
- stopScript(true);
- }
- if (ExpHour > 60000 && runTime > 1800000 && runTime < 3600000) {
- log(">60k Exp/Hr at <1Hr Runtime");
- log("Script Resuming");
- }
- if (ExpHour < 65000 && runTime > 3600000 && runTime < 18000000) {
- log("<65k Exp/Hr at >1Hr Runtime");
- log("Force Stopping Script");
- game.openTab(Game.TAB_MAGIC);
- sleep(random(1000,2300));
- env.saveScreenshot(true);
- sleep(random(2000, 2500));
- stopScript(true);
- }
- if (ExpHour > 65000 && runTime > 3600000 && runTime < 18000000) {
- log(">65k Exp/Hr at >1Hr Runtime");
- log("Script Resuming");
- }
- if (ExpHour < 67500 && runTime > 18000000) {
- log("<67.5k Exp/Hr at >5Hr Runtime");
- log("Force Stopping Script");
- game.openTab(Game.TAB_MAGIC);
- sleep(random(1000,2300));
- env.saveScreenshot(true);
- sleep(random(2000, 2500));
- stopScript(true);
- }
- if (ExpHour > 67500 && runTime > 18000000) {
- log(">67.5k Exp/Hr at >5Hr Runtime");
- log("Script Resuming");
- }
- }
- case 7:
- if (random(1, 3) == 1) {
- if (game.getCurrentTab() != Game.TAB_MAGIC) {
- game.openTab(Game.TAB_MAGIC);
- log("Fail-Safe");
- sleep(random(123, 310));
- mouse.move(random(564, 579), random(369, 375));
- sleep(random(420, 560));
- mouse.click(true);
- sleep(random(210, 290));
- mouse.click(true);
- }
- if (game.getCurrentTab() != Game.TAB_INVENTORY) {
- log("Bypassing Fail-Safe");
- sleep(random(123, 310));
- mouse.move(random(564, 579), random(369, 375));
- sleep(random(420, 560));
- mouse.click(true);
- sleep(random(210, 290));
- mouse.click(true);
- }
- }
- }
- }
- @Override
- public int loop() {
- antiBan();
- Alch();
- return random(3, 6);
- }
- public void onFinish() {
- log("Alching Complete");
- game.openTab(Game.TAB_MAGIC);
- sleep(random(1000,2300));
- env.saveScreenshot(true);
- }
- private String formatTime(final long time) {
- final int sec = (int) (time / 1000), h = sec / 3600, m = sec / 60 % 60, s = sec % 60;
- return (h < 10 ? "0" + h : h) + ":" + (m < 10 ? "0" + m : m) + ":"
- + (s < 10 ? "0" + s : s);
- }
- @Override
- public void onRepaint(Graphics g1) {
- final Graphics2D g2 = (Graphics2D) g1;
- g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_ON);
- g2.setColor(color1);
- g2.fillRect(375, 165, 135, 173);
- g2.setFont(font2);
- currentLevel = skills.getRealLevel(skills.MAGIC);
- gainedLvls = skills.getRealLevel(skills.MAGIC) - startLvl;
- gainedExp = skills.getCurrentExp(skills.MAGIC) - startExp;
- castTotal = (int) (gainedExp / 65);
- expLevel = skills.getExpToNextLevel(skills.MAGIC);
- ExpHour = (int) ((3600000.0 / (double) runTime) * gainedExp);
- runTime = System.currentTimeMillis() - startTime;
- xpLevel = skills.getExpToNextLevel(skills.MAGIC);
- nextLvl = (long) ((double) xpLevel / (double) ExpHour * 3600000);
- alchLvl = (int) (expLevel / 65);
- castHour = (int) (ExpHour / 65);
- percentLevel = skills.getPercentToNextLevel(skills.MAGIC);
- g2.setColor(Color.RED);
- g2.drawString("Alch Pro v2.3 by Beuner", 380, 175);
- g2.setColor(Color.WHITE);
- g2.drawString("Run Time: " + formatTime(runTime), 380, 190);
- g2.drawString("Current level: " + currentLevel, 380, 205);
- g2.drawString("Levels gained: " + gainedLvls, 380, 220);
- g2.drawString("Alchs: " + castTotal, 380, 235);
- g2.drawString("Alchs Per Hours: " + castHour, 380, 250);
- g2.drawString("Alchs to Level: " + alchLvl, 380, 265);
- g2.drawString("Exp gained: " + (gainedExp), 380, 280);
- g2.drawString("Exp Per Hour: " + ExpHour, 380, 295);
- g2.drawString("Exp To Level: " + expLevel, 380, 310);
- g2.drawString("Time to Level: " + formatTime(nextLvl), 380, 325);
- g2.setColor(Color.BLACK);
- g2.fillRect(380, 330, 100, 4);
- g2.setColor(Color.RED);
- g2.fillRect(380, 330, percentLevel, 4);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement