Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.BasicStroke;
- import java.awt.Color;
- import java.awt.Container;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.DefaultComboBoxModel;
- import javax.swing.GroupLayout;
- import javax.swing.JButton;
- import javax.swing.JComboBox;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JRadioButton;
- import javax.swing.LayoutStyle;
- import com.rarebot.event.events.MessageEvent;
- import com.rarebot.event.listeners.MessageListener;
- import com.rarebot.event.listeners.PaintListener;
- import com.rarebot.script.Script;
- import com.rarebot.script.ScriptManifest;
- import com.rarebot.script.methods.Game.Tab;
- import com.rarebot.script.methods.Skills;
- import com.rarebot.script.wrappers.RSObject;
- import com.rarebot.script.wrappers.RSTile;
- @ScriptManifest(
- authors = {"Whipz_man"},
- version = 1.1,
- description = "The Ultimate in PowerMining V1.3",
- name = "Whipz_PowerMiner"
- )
- public class Whipz_PowerMiner extends Script implements PaintListener, MessageListener{
- //Pic
- int AllPic[] = {1265, 1267, 1269, 1271, 1273, 1275, 14099, 14107, 15259, 15261};
- //Rock
- int Tin_ID[] = {2094, 2095, 3038, 3245, 5776, 5777, 5778, 9714, 9716, 11933, 11934, 11935, 11957, 11958, 11959, 14902, 14903, 21293, 21294, 21295} ;
- int Copper_ID[] = {2090, 2091, 2097, 3027, 3229, 5779, 5780, 5781, 9708, 9709, 9710, 11936, 11937, 11938, 11960, 11961, 11962, 14906, 14907, 21284, 21285, 21286};
- int Iron_ID[] = {2092, 2093, 5773, 5774, 5775, 9717, 9718, 9719, 11954, 11955, 11956, 14099, 14107, 14913, 14914, 21281, 21282, 21283, 37307, 37308, 37309 };
- int Silver_ID[] = {2311, 11186, 11187, 11188, 11948, 11949, 11950, 15580, 15581, 29224, 29225, 29226, 32444, 32445, 32446, 37304, 37305, 37306};
- int Coal_ID[] = {2096, 2097, 3032, 3233, 5770, 5771, 5772, 10948, 11930, 11931, 11932, 14850, 14851, 21287, 21288, 21289, 29215, 29216, 29217, 32426, 32427, 32428};
- int Gold_ID[] = {5768, 5769, 9720, 9722, 10574, 10575, 10576, 11183, 11184, 11185, 11943, 15576, 15577, 15578, 32432, 32433, 32434, 45067, 45068};
- int Mithril_ID[] = {2102, 2103, 3041, 3280, 5784, 5785, 5786, 11942, 11943, 11944, 21278, 21279, 21280, 32438, 32439, 32440};
- int Adamant_ID[] = {3040, 3273, 5782, 5783, 11939, 11941, 21275, 21276, 21277, 29233, 29235, 32425, 32436, 32437};
- int Rune_ID[] = {14859, 33078, 33079, 45069, 45070};
- int Ore;
- //Mining ID
- int MiningID = 624;
- //RockVaild
- RSTile RockTile = null;
- //Banking
- int boothID = 11402;
- //GUI Stuff
- int[]RMine;
- boolean guiwait = true;
- PowerMiner_GUI q;
- boolean m1d1;
- boolean Max;
- //AntiBan&Paint
- String Status = "Starting up!";
- int OresMined;
- int ExpGained;
- String MineR;
- int StartExp;
- long StartTime;
- long Hours;
- long Minutes;
- long Seconds;
- String R = "";
- private final Color color1 = new Color(0, 255, 255);
- private final BasicStroke stroke1 = new BasicStroke(4);
- private final Font font1 = new Font("Times New Roman", 1, 16);
- private final Font font2 = new Font("Times New Roman", 1, 14);
- private final Font font3 = new Font("Times New Roman", 1, 13);
- int Clevel;
- int LVLG;
- int Slevel;
- long Millis;
- long Hour;
- long Second;
- int ExpPh;
- int OrePh;
- int ExpLvl;
- double Percent;
- double Num;
- public boolean onStart() {
- while (!game.isLoggedIn()) {
- game.login();
- sleep(2000);
- }
- java.awt.EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- q = new PowerMiner_GUI();
- q.setVisible(true);
- q.setAlwaysOnTop(true);
- }
- });
- while (guiwait) sleep (500);
- log("You are going to Mine "+R);
- StartTime = System.currentTimeMillis();
- StartExp = skills.getCurrentExp(Skills.MINING);
- Slevel = skills.getCurrentLevel(skills.MINING);
- return true;
- }
- boolean MineOres() {
- final RSObject rock = objects.getNearest(RMine);
- if (rock != null) {
- if(Max) {
- if (rock != null && calc.distanceTo(rock) <5) {
- if (rock.isOnScreen()) {
- if (rock.interact("Mine")) {
- RockTile = tiles.getTileUnderMouse();
- sleep(1000);
- while(getMyPlayer().isMoving()) {
- sleep(50);
- }
- return true;
- }
- } else {
- return walking.walkTileMM(rock.getLocation(), 1, 1);
- }
- }
- } else {
- if (rock.isOnScreen()) {
- if (rock.interact("Mine")) {
- RockTile = tiles.getTileUnderMouse();
- sleep(1000);
- while(getMyPlayer().isMoving()) {
- sleep(50);
- }
- return true;
- }
- } else {
- return walking.walkTileMM(rock.getLocation(), 1, 1);
- }
- }
- }
- return false;
- }
- boolean RockValid() {
- for (int i = 0; i < RMine.length; i++) {
- if (RockTile != null) {
- final RSObject ob = objects.getTopAt(RockTile);
- if (ob != null) {
- if (ob.getID() == RMine[i]) {
- return true;
- }
- }
- }
- }
- return false;
- }
- @Override
- public int loop() {
- if(StartExp == 0) {
- StartExp = skills.getCurrentExp(skills.getCurrentExp(Skills.MINING));
- Slevel = skills.getCurrentLevel(skills.getCurrentLevel(Skills.MINING));
- }
- if(m1d1) {
- if(inventory.contains(Ore)) {
- inventory.dropAllExcept(AllPic);
- } else {
- if (getMyPlayer().getAnimation() == -1 || !RockValid()) {
- MineOres();
- AntiBan();
- }
- }
- } else {
- if (inventory.isFull()) {
- inventory.dropAllExcept(AllPic);
- } else {
- if (getMyPlayer().getAnimation() == -1 || !RockValid()) {
- MineOres();
- AntiBan();
- }
- }
- }
- return random(750, 1000);
- }
- public void onFinish() {
- log("Thankyou for using Whipz_man PowerMiner!");
- log("You Mined "+OresMined+ " " +R);
- stopScript();
- }
- @SuppressWarnings("serial")
- class PowerMiner_GUI extends JFrame {
- public PowerMiner_GUI() {
- super();
- initComponents();
- }
- private void StartActionPerformed(ActionEvent e) {
- String MRock = Rock.getSelectedItem().toString();
- if(MRock.equals("Tin")) {
- RMine = Tin_ID;
- R = "Tin Ores";
- MineR = "Tin";
- Ore = 438;
- }else if(MRock.equals("Copper")) {
- RMine = Copper_ID;
- R = "Copper Ores";
- MineR = "Copper";
- Ore = 436;
- }else if(MRock.equals("Iron")) {
- RMine = Iron_ID;
- R = "Iron Ores";
- MineR = "Iron";
- Ore = 440;
- }else if(MRock.equals("Silver")) {
- RMine = Silver_ID;
- R = "Silver Ores";
- MineR = "Silver";
- Ore = 442;
- }else if(MRock.equals("Coal")) {
- RMine = Coal_ID;
- R = "Coal";
- MineR = "Coal";
- Ore = 453;
- }else if(MRock.equals("Gold")) {
- RMine = Gold_ID;
- R = "Gold Ores";
- MineR = "Gold";
- Ore = 444;
- }else if(MRock.equals("Mithril")) {
- RMine = Mithril_ID;
- R = "Mithril Ores";
- MineR = "Mithril";
- Ore = 447;
- }else if(MRock.equals("Adamant")) {
- RMine = Adamant_ID;
- R = "Adamant Ores";
- MineR = "Adamant";
- Ore = 449;
- }else {
- RMine = Rune_ID;
- R = "Runite Ores";
- MineR = "Rune";
- Ore = 451;
- }
- if(M1D1.isSelected()) {
- m1d1 = true;
- log("We are going to M1D1");
- } else {
- m1d1 = false;
- log("We are going to mine a full invent then drop");
- }
- if(MaxDistance.isSelected()) {
- Max = true;
- log("We arent going to far away from where we are!");
- } else {
- Max = false;
- log("Mining all "+R+" on Mini Map!");
- }
- guiwait = false;
- q.dispose();
- }
- private void initComponents() {
- label1 = new JLabel();
- label2 = new JLabel();
- Rock = new JComboBox();
- Start = new JButton();
- M1D1 = new JRadioButton();
- MaxDistance = new JRadioButton();
- Container contentPane = getContentPane();
- //---- label1 ----
- label1.setText("Whipz_man PowerMiner");
- label1.setFont(new Font("Times New Roman", Font.BOLD, 18));
- label1.setForeground(Color.red);
- //---- label2 ----
- label2.setText("What would you like to mine?");
- label2.setForeground(Color.red);
- label2.setFont(new Font("Times New Roman", Font.BOLD, 12));
- //---- Rock ----
- Rock.setModel(new DefaultComboBoxModel(new String[] {
- "Tin",
- "Copper",
- "Iron",
- "Silver",
- "Coal",
- "Gold",
- "Mithril",
- "Adamant",
- "Rune"
- }));
- Rock.setForeground(Color.red);
- Rock.setFont(new Font("Times New Roman", Font.BOLD, 12));
- //---- Start ----
- Start.setText("Start");
- Start.setForeground(Color.red);
- Start.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- StartActionPerformed(e);
- }
- });
- //---- M1D1 ----
- M1D1.setText("M1D1");
- M1D1.setFont(new Font("Times New Roman", Font.BOLD, 11));
- M1D1.setForeground(Color.red);
- //---- MaxDistance ----
- MaxDistance.setText("Max Distance Set");
- MaxDistance.setForeground(Color.red);
- MaxDistance.setFont(new Font("Times New Roman", Font.BOLD, 11));
- GroupLayout contentPaneLayout = new GroupLayout(contentPane);
- contentPane.setLayout(contentPaneLayout);
- contentPaneLayout.setHorizontalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
- .addContainerGap(182, Short.MAX_VALUE)
- .addComponent(Start)
- .addContainerGap())
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(22, 22, 22)
- .addComponent(label1, GroupLayout.PREFERRED_SIZE, 202, GroupLayout.PREFERRED_SIZE)
- .addContainerGap(25, Short.MAX_VALUE))
- .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
- .addContainerGap(47, Short.MAX_VALUE)
- .addComponent(label2, GroupLayout.PREFERRED_SIZE, 166, GroupLayout.PREFERRED_SIZE)
- .addGap(36, 36, 36))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(76, 76, 76)
- .addGroup(contentPaneLayout.createParallelGroup()
- .addComponent(Rock, GroupLayout.PREFERRED_SIZE, 83, GroupLayout.PREFERRED_SIZE)
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(10, 10, 10)
- .addGroup(contentPaneLayout.createParallelGroup()
- .addComponent(MaxDistance)
- .addComponent(M1D1))))
- .addContainerGap(48, Short.MAX_VALUE))
- );
- contentPaneLayout.setVerticalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(label1)
- .addGap(1, 1, 1)
- .addComponent(label2, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(Rock, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(M1D1)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(MaxDistance)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 32, Short.MAX_VALUE)
- .addComponent(Start)
- .addContainerGap())
- );
- pack();
- setLocationRelativeTo(getOwner());
- }
- private JLabel label1;
- private JLabel label2;
- private JComboBox Rock;
- private JButton Start;
- private JRadioButton M1D1;
- private JRadioButton MaxDistance;
- }
- private int AntiBan() {
- Status = "Performing AntiBan";
- int random = random(1, 12);
- switch (random) {
- case 1:
- mouse.moveSlightly();
- sleep(500,600);
- break;
- case 2:
- mouse.moveRandomly(10, 50);
- break;
- case 3:
- mouse.moveOffScreen();
- break;
- case 4:
- camera.moveRandomly(random(250, 1500));
- break;
- case 6:
- if (random(0, 18) == 3) {
- game.openTab(Tab.STATS);
- skills.doHover(Skills.INTERFACE_MINING);
- sleep(random(2000, 2400));
- }
- break;
- case 8:
- if (random(0, 13) == 2) {
- camera.setAngle(random(30, 70));
- sleep(400, 1200);
- }
- break;
- }
- return random(1000, 5000);
- }
- public void messageReceived(MessageEvent e) {
- String msg = e.getMessage();
- if (msg.contains("manage to mine two")) {
- OresMined += 2;
- } else if (msg.contains("manage to")) {
- OresMined++;
- }
- }
- @Override
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- g.setFont(font1);
- g.setColor(color1);
- g.drawString("Whipz_man's PowerMiner", 336, 197);
- g.setFont(font2);
- g.drawString("The Ultimate PowerMiner", 345, 211);
- g.setFont(font3);
- g.drawString("Runtime:", 345, 228);
- g.drawString("Exp Gained:", 345, 243);
- g.drawString("Exp p/h:", 345, 258);
- g.drawString("Ores Mined:", 345, 273);
- g.drawString("Ores p/h:", 345, 288);
- g.drawString("Lvls Gained:", 345, 303);
- g.drawString("Ore being Mined:", 345, 318);
- g.setStroke(stroke1);
- g.drawRoundRect(331, 179, 184, 157, 16, 16);
- g.drawString(""+OresMined, 448, 273);
- g.drawString(""+ExpGained, 448, 243);
- g.drawString(""+OrePh, 448, 288);
- g.drawString(""+ExpPh, 448, 258);
- g.drawString(""+Hour+":"+Minutes+":"+Seconds, 448, 228);
- g.drawString(""+LVLG, 448, 303);
- g.drawString(""+R, 448, 318);
- ExpGained = skills.getCurrentExp(Skills.MINING) - StartExp;
- java.text.DecimalFormat df = new java.text.DecimalFormat("##.##");
- Clevel = skills.getCurrentLevel(Skills.MINING);
- LVLG = Clevel - Slevel;
- ExpGained = skills.getCurrentExp(Skills.MINING) - StartExp;
- Millis = System.currentTimeMillis() - StartTime;
- Num = ((3600000.0 / (double) Millis));
- ExpPh = (int) (Num * ExpGained);
- OrePh = (int) (Num * OresMined);
- Hour = Millis / (1000 * 60 * 60);
- Millis -= Hour * (1000 * 60 * 60);
- Minutes = Millis / (1000 * 60);
- Millis -= Minutes * (1000 * 60);
- Seconds = Millis / 1000;
- }
- }import java.awt.BasicStroke;
- import java.awt.Color;
- import java.awt.Container;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.DefaultComboBoxModel;
- import javax.swing.GroupLayout;
- import javax.swing.JButton;
- import javax.swing.JComboBox;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JRadioButton;
- import javax.swing.LayoutStyle;
- import com.rarebot.event.events.MessageEvent;
- import com.rarebot.event.listeners.MessageListener;
- import com.rarebot.event.listeners.PaintListener;
- import com.rarebot.script.Script;
- import com.rarebot.script.ScriptManifest;
- import com.rarebot.script.methods.Game.Tab;
- import com.rarebot.script.methods.Skills;
- import com.rarebot.script.wrappers.RSObject;
- import com.rarebot.script.wrappers.RSTile;
- @ScriptManifest(
- authors = {"Whipz_man"},
- version = 1.1,
- description = "The Ultimate in PowerMining V1.3",
- name = "Whipz_PowerMiner"
- )
- public class Whipz_PowerMiner extends Script implements PaintListener, MessageListener{
- //Pic
- int AllPic[] = {1265, 1267, 1269, 1271, 1273, 1275, 14099, 14107, 15259, 15261};
- //Rock
- int Tin_ID[] = {2094, 2095, 3038, 3245, 5776, 5777, 5778, 9714, 9716, 11933, 11934, 11935, 11957, 11958, 11959, 14902, 14903, 21293, 21294, 21295} ;
- int Copper_ID[] = {2090, 2091, 2097, 3027, 3229, 5779, 5780, 5781, 9708, 9709, 9710, 11936, 11937, 11938, 11960, 11961, 11962, 14906, 14907, 21284, 21285, 21286};
- int Iron_ID[] = {2092, 2093, 5773, 5774, 5775, 9717, 9718, 9719, 11954, 11955, 11956, 14099, 14107, 14913, 14914, 21281, 21282, 21283, 37307, 37308, 37309 };
- int Silver_ID[] = {2311, 11186, 11187, 11188, 11948, 11949, 11950, 15580, 15581, 29224, 29225, 29226, 32444, 32445, 32446, 37304, 37305, 37306};
- int Coal_ID[] = {2096, 2097, 3032, 3233, 5770, 5771, 5772, 10948, 11930, 11931, 11932, 14850, 14851, 21287, 21288, 21289, 29215, 29216, 29217, 32426, 32427, 32428};
- int Gold_ID[] = {5768, 5769, 9720, 9722, 10574, 10575, 10576, 11183, 11184, 11185, 11943, 15576, 15577, 15578, 32432, 32433, 32434, 45067, 45068};
- int Mithril_ID[] = {2102, 2103, 3041, 3280, 5784, 5785, 5786, 11942, 11943, 11944, 21278, 21279, 21280, 32438, 32439, 32440};
- int Adamant_ID[] = {3040, 3273, 5782, 5783, 11939, 11941, 21275, 21276, 21277, 29233, 29235, 32425, 32436, 32437};
- int Rune_ID[] = {14859, 33078, 33079, 45069, 45070};
- int Ore;
- //Mining ID
- int MiningID = 624;
- //RockVaild
- RSTile RockTile = null;
- //Banking
- int boothID = 11402;
- //GUI Stuff
- int[]RMine;
- boolean guiwait = true;
- PowerMiner_GUI q;
- boolean m1d1;
- boolean Max;
- //AntiBan&Paint
- String Status = "Starting up!";
- int OresMined;
- int ExpGained;
- String MineR;
- int StartExp;
- long StartTime;
- long Hours;
- long Minutes;
- long Seconds;
- String R = "";
- private final Color color1 = new Color(0, 255, 255);
- private final BasicStroke stroke1 = new BasicStroke(4);
- private final Font font1 = new Font("Times New Roman", 1, 16);
- private final Font font2 = new Font("Times New Roman", 1, 14);
- private final Font font3 = new Font("Times New Roman", 1, 13);
- int Clevel;
- int LVLG;
- int Slevel;
- long Millis;
- long Hour;
- long Second;
- int ExpPh;
- int OrePh;
- int ExpLvl;
- double Percent;
- double Num;
- public boolean onStart() {
- while (!game.isLoggedIn()) {
- game.login();
- sleep(2000);
- }
- java.awt.EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- q = new PowerMiner_GUI();
- q.setVisible(true);
- q.setAlwaysOnTop(true);
- }
- });
- while (guiwait) sleep (500);
- log("You are going to Mine "+R);
- StartTime = System.currentTimeMillis();
- StartExp = skills.getCurrentExp(Skills.MINING);
- Slevel = skills.getCurrentLevel(skills.MINING);
- return true;
- }
- boolean MineOres() {
- final RSObject rock = objects.getNearest(RMine);
- if (rock != null) {
- if(Max) {
- if (rock != null && calc.distanceTo(rock) <5) {
- if (rock.isOnScreen()) {
- if (rock.interact("Mine")) {
- RockTile = tiles.getTileUnderMouse();
- sleep(1000);
- while(getMyPlayer().isMoving()) {
- sleep(50);
- }
- return true;
- }
- } else {
- return walking.walkTileMM(rock.getLocation(), 1, 1);
- }
- }
- } else {
- if (rock.isOnScreen()) {
- if (rock.interact("Mine")) {
- RockTile = tiles.getTileUnderMouse();
- sleep(1000);
- while(getMyPlayer().isMoving()) {
- sleep(50);
- }
- return true;
- }
- } else {
- return walking.walkTileMM(rock.getLocation(), 1, 1);
- }
- }
- }
- return false;
- }
- boolean RockValid() {
- for (int i = 0; i < RMine.length; i++) {
- if (RockTile != null) {
- final RSObject ob = objects.getTopAt(RockTile);
- if (ob != null) {
- if (ob.getID() == RMine[i]) {
- return true;
- }
- }
- }
- }
- return false;
- }
- @Override
- public int loop() {
- if(StartExp == 0) {
- StartExp = skills.getCurrentExp(skills.getCurrentExp(Skills.MINING));
- Slevel = skills.getCurrentLevel(skills.getCurrentLevel(Skills.MINING));
- }
- if(m1d1) {
- if(inventory.contains(Ore)) {
- inventory.dropAllExcept(AllPic);
- } else {
- if (getMyPlayer().getAnimation() == -1 || !RockValid()) {
- MineOres();
- AntiBan();
- }
- }
- } else {
- if (inventory.isFull()) {
- inventory.dropAllExcept(AllPic);
- } else {
- if (getMyPlayer().getAnimation() == -1 || !RockValid()) {
- MineOres();
- AntiBan();
- }
- }
- }
- return random(750, 1000);
- }
- public void onFinish() {
- log("Thankyou for using Whipz_man PowerMiner!");
- log("You Mined "+OresMined+ " " +R);
- stopScript();
- }
- @SuppressWarnings("serial")
- class PowerMiner_GUI extends JFrame {
- public PowerMiner_GUI() {
- super();
- initComponents();
- }
- private void StartActionPerformed(ActionEvent e) {
- String MRock = Rock.getSelectedItem().toString();
- if(MRock.equals("Tin")) {
- RMine = Tin_ID;
- R = "Tin Ores";
- MineR = "Tin";
- Ore = 438;
- }else if(MRock.equals("Copper")) {
- RMine = Copper_ID;
- R = "Copper Ores";
- MineR = "Copper";
- Ore = 436;
- }else if(MRock.equals("Iron")) {
- RMine = Iron_ID;
- R = "Iron Ores";
- MineR = "Iron";
- Ore = 440;
- }else if(MRock.equals("Silver")) {
- RMine = Silver_ID;
- R = "Silver Ores";
- MineR = "Silver";
- Ore = 442;
- }else if(MRock.equals("Coal")) {
- RMine = Coal_ID;
- R = "Coal";
- MineR = "Coal";
- Ore = 453;
- }else if(MRock.equals("Gold")) {
- RMine = Gold_ID;
- R = "Gold Ores";
- MineR = "Gold";
- Ore = 444;
- }else if(MRock.equals("Mithril")) {
- RMine = Mithril_ID;
- R = "Mithril Ores";
- MineR = "Mithril";
- Ore = 447;
- }else if(MRock.equals("Adamant")) {
- RMine = Adamant_ID;
- R = "Adamant Ores";
- MineR = "Adamant";
- Ore = 449;
- }else {
- RMine = Rune_ID;
- R = "Runite Ores";
- MineR = "Rune";
- Ore = 451;
- }
- if(M1D1.isSelected()) {
- m1d1 = true;
- log("We are going to M1D1");
- } else {
- m1d1 = false;
- log("We are going to mine a full invent then drop");
- }
- if(MaxDistance.isSelected()) {
- Max = true;
- log("We arent going to far away from where we are!");
- } else {
- Max = false;
- log("Mining all "+R+" on Mini Map!");
- }
- guiwait = false;
- q.dispose();
- }
- private void initComponents() {
- label1 = new JLabel();
- label2 = new JLabel();
- Rock = new JComboBox();
- Start = new JButton();
- M1D1 = new JRadioButton();
- MaxDistance = new JRadioButton();
- Container contentPane = getContentPane();
- //---- label1 ----
- label1.setText("Whipz_man PowerMiner");
- label1.setFont(new Font("Times New Roman", Font.BOLD, 18));
- label1.setForeground(Color.red);
- //---- label2 ----
- label2.setText("What would you like to mine?");
- label2.setForeground(Color.red);
- label2.setFont(new Font("Times New Roman", Font.BOLD, 12));
- //---- Rock ----
- Rock.setModel(new DefaultComboBoxModel(new String[] {
- "Tin",
- "Copper",
- "Iron",
- "Silver",
- "Coal",
- "Gold",
- "Mithril",
- "Adamant",
- "Rune"
- }));
- Rock.setForeground(Color.red);
- Rock.setFont(new Font("Times New Roman", Font.BOLD, 12));
- //---- Start ----
- Start.setText("Start");
- Start.setForeground(Color.red);
- Start.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- StartActionPerformed(e);
- }
- });
- //---- M1D1 ----
- M1D1.setText("M1D1");
- M1D1.setFont(new Font("Times New Roman", Font.BOLD, 11));
- M1D1.setForeground(Color.red);
- //---- MaxDistance ----
- MaxDistance.setText("Max Distance Set");
- MaxDistance.setForeground(Color.red);
- MaxDistance.setFont(new Font("Times New Roman", Font.BOLD, 11));
- GroupLayout contentPaneLayout = new GroupLayout(contentPane);
- contentPane.setLayout(contentPaneLayout);
- contentPaneLayout.setHorizontalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
- .addContainerGap(182, Short.MAX_VALUE)
- .addComponent(Start)
- .addContainerGap())
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(22, 22, 22)
- .addComponent(label1, GroupLayout.PREFERRED_SIZE, 202, GroupLayout.PREFERRED_SIZE)
- .addContainerGap(25, Short.MAX_VALUE))
- .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
- .addContainerGap(47, Short.MAX_VALUE)
- .addComponent(label2, GroupLayout.PREFERRED_SIZE, 166, GroupLayout.PREFERRED_SIZE)
- .addGap(36, 36, 36))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(76, 76, 76)
- .addGroup(contentPaneLayout.createParallelGroup()
- .addComponent(Rock, GroupLayout.PREFERRED_SIZE, 83, GroupLayout.PREFERRED_SIZE)
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(10, 10, 10)
- .addGroup(contentPaneLayout.createParallelGroup()
- .addComponent(MaxDistance)
- .addComponent(M1D1))))
- .addContainerGap(48, Short.MAX_VALUE))
- );
- contentPaneLayout.setVerticalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(label1)
- .addGap(1, 1, 1)
- .addComponent(label2, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(Rock, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(M1D1)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(MaxDistance)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 32, Short.MAX_VALUE)
- .addComponent(Start)
- .addContainerGap())
- );
- pack();
- setLocationRelativeTo(getOwner());
- }
- private JLabel label1;
- private JLabel label2;
- private JComboBox Rock;
- private JButton Start;
- private JRadioButton M1D1;
- private JRadioButton MaxDistance;
- }
- private int AntiBan() {
- Status = "Performing AntiBan";
- int random = random(1, 12);
- switch (random) {
- case 1:
- mouse.moveSlightly();
- sleep(500,600);
- break;
- case 2:
- mouse.moveRandomly(10, 50);
- break;
- case 3:
- mouse.moveOffScreen();
- break;
- case 4:
- camera.moveRandomly(random(250, 1500));
- break;
- case 6:
- if (random(0, 18) == 3) {
- game.openTab(Tab.STATS);
- skills.doHover(Skills.INTERFACE_MINING);
- sleep(random(2000, 2400));
- }
- break;
- case 8:
- if (random(0, 13) == 2) {
- camera.setAngle(random(30, 70));
- sleep(400, 1200);
- }
- break;
- }
- return random(1000, 5000);
- }
- public void messageReceived(MessageEvent e) {
- String msg = e.getMessage();
- if (msg.contains("manage to mine two")) {
- OresMined += 2;
- } else if (msg.contains("manage to")) {
- OresMined++;
- }
- }
- @Override
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- g.setFont(font1);
- g.setColor(color1);
- g.drawString("Whipz_man's PowerMiner", 336, 197);
- g.setFont(font2);
- g.drawString("The Ultimate PowerMiner", 345, 211);
- g.setFont(font3);
- g.drawString("Runtime:", 345, 228);
- g.drawString("Exp Gained:", 345, 243);
- g.drawString("Exp p/h:", 345, 258);
- g.drawString("Ores Mined:", 345, 273);
- g.drawString("Ores p/h:", 345, 288);
- g.drawString("Lvls Gained:", 345, 303);
- g.drawString("Ore being Mined:", 345, 318);
- g.setStroke(stroke1);
- g.drawRoundRect(331, 179, 184, 157, 16, 16);
- g.drawString(""+OresMined, 448, 273);
- g.drawString(""+ExpGained, 448, 243);
- g.drawString(""+OrePh, 448, 288);
- g.drawString(""+ExpPh, 448, 258);
- g.drawString(""+Hour+":"+Minutes+":"+Seconds, 448, 228);
- g.drawString(""+LVLG, 448, 303);
- g.drawString(""+R, 448, 318);
- ExpGained = skills.getCurrentExp(Skills.MINING) - StartExp;
- java.text.DecimalFormat df = new java.text.DecimalFormat("##.##");
- Clevel = skills.getCurrentLevel(Skills.MINING);
- LVLG = Clevel - Slevel;
- ExpGained = skills.getCurrentExp(Skills.MINING) - StartExp;
- Millis = System.currentTimeMillis() - StartTime;
- Num = ((3600000.0 / (double) Millis));
- ExpPh = (int) (Num * ExpGained);
- OrePh = (int) (Num * OresMined);
- Hour = Millis / (1000 * 60 * 60);
- Millis -= Hour * (1000 * 60 * 60);
- Minutes = Millis / (1000 * 60);
- Millis -= Minutes * (1000 * 60);
- Seconds = Millis / 1000;
- }
- }import java.awt.BasicStroke;
- import java.awt.Color;
- import java.awt.Container;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.DefaultComboBoxModel;
- import javax.swing.GroupLayout;
- import javax.swing.JButton;
- import javax.swing.JComboBox;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JRadioButton;
- import javax.swing.LayoutStyle;
- import com.rarebot.event.events.MessageEvent;
- import com.rarebot.event.listeners.MessageListener;
- import com.rarebot.event.listeners.PaintListener;
- import com.rarebot.script.Script;
- import com.rarebot.script.ScriptManifest;
- import com.rarebot.script.methods.Game.Tab;
- import com.rarebot.script.methods.Skills;
- import com.rarebot.script.wrappers.RSObject;
- import com.rarebot.script.wrappers.RSTile;
- @ScriptManifest(
- authors = {"Whipz_man"},
- version = 1.1,
- description = "The Ultimate in PowerMining V1.3",
- name = "Whipz_PowerMiner"
- )
- public class Whipz_PowerMiner extends Script implements PaintListener, MessageListener{
- //Pic
- int AllPic[] = {1265, 1267, 1269, 1271, 1273, 1275, 14099, 14107, 15259, 15261};
- //Rock
- int Tin_ID[] = {2094, 2095, 3038, 3245, 5776, 5777, 5778, 9714, 9716, 11933, 11934, 11935, 11957, 11958, 11959, 14902, 14903, 21293, 21294, 21295} ;
- int Copper_ID[] = {2090, 2091, 2097, 3027, 3229, 5779, 5780, 5781, 9708, 9709, 9710, 11936, 11937, 11938, 11960, 11961, 11962, 14906, 14907, 21284, 21285, 21286};
- int Iron_ID[] = {2092, 2093, 5773, 5774, 5775, 9717, 9718, 9719, 11954, 11955, 11956, 14099, 14107, 14913, 14914, 21281, 21282, 21283, 37307, 37308, 37309 };
- int Silver_ID[] = {2311, 11186, 11187, 11188, 11948, 11949, 11950, 15580, 15581, 29224, 29225, 29226, 32444, 32445, 32446, 37304, 37305, 37306};
- int Coal_ID[] = {2096, 2097, 3032, 3233, 5770, 5771, 5772, 10948, 11930, 11931, 11932, 14850, 14851, 21287, 21288, 21289, 29215, 29216, 29217, 32426, 32427, 32428};
- int Gold_ID[] = {5768, 5769, 9720, 9722, 10574, 10575, 10576, 11183, 11184, 11185, 11943, 15576, 15577, 15578, 32432, 32433, 32434, 45067, 45068};
- int Mithril_ID[] = {2102, 2103, 3041, 3280, 5784, 5785, 5786, 11942, 11943, 11944, 21278, 21279, 21280, 32438, 32439, 32440};
- int Adamant_ID[] = {3040, 3273, 5782, 5783, 11939, 11941, 21275, 21276, 21277, 29233, 29235, 32425, 32436, 32437};
- int Rune_ID[] = {14859, 33078, 33079, 45069, 45070};
- int Ore;
- //Mining ID
- int MiningID = 624;
- //RockVaild
- RSTile RockTile = null;
- //Banking
- int boothID = 11402;
- //GUI Stuff
- int[]RMine;
- boolean guiwait = true;
- PowerMiner_GUI q;
- boolean m1d1;
- boolean Max;
- //AntiBan&Paint
- String Status = "Starting up!";
- int OresMined;
- int ExpGained;
- String MineR;
- int StartExp;
- long StartTime;
- long Hours;
- long Minutes;
- long Seconds;
- String R = "";
- private final Color color1 = new Color(0, 255, 255);
- private final BasicStroke stroke1 = new BasicStroke(4);
- private final Font font1 = new Font("Times New Roman", 1, 16);
- private final Font font2 = new Font("Times New Roman", 1, 14);
- private final Font font3 = new Font("Times New Roman", 1, 13);
- int Clevel;
- int LVLG;
- int Slevel;
- long Millis;
- long Hour;
- long Second;
- int ExpPh;
- int OrePh;
- int ExpLvl;
- double Percent;
- double Num;
- public boolean onStart() {
- while (!game.isLoggedIn()) {
- game.login();
- sleep(2000);
- }
- java.awt.EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- q = new PowerMiner_GUI();
- q.setVisible(true);
- q.setAlwaysOnTop(true);
- }
- });
- while (guiwait) sleep (500);
- log("You are going to Mine "+R);
- StartTime = System.currentTimeMillis();
- StartExp = skills.getCurrentExp(Skills.MINING);
- Slevel = skills.getCurrentLevel(skills.MINING);
- return true;
- }
- boolean MineOres() {
- final RSObject rock = objects.getNearest(RMine);
- if (rock != null) {
- if(Max) {
- if (rock != null && calc.distanceTo(rock) <5) {
- if (rock.isOnScreen()) {
- if (rock.interact("Mine")) {
- RockTile = tiles.getTileUnderMouse();
- sleep(1000);
- while(getMyPlayer().isMoving()) {
- sleep(50);
- }
- return true;
- }
- } else {
- return walking.walkTileMM(rock.getLocation(), 1, 1);
- }
- }
- } else {
- if (rock.isOnScreen()) {
- if (rock.interact("Mine")) {
- RockTile = tiles.getTileUnderMouse();
- sleep(1000);
- while(getMyPlayer().isMoving()) {
- sleep(50);
- }
- return true;
- }
- } else {
- return walking.walkTileMM(rock.getLocation(), 1, 1);
- }
- }
- }
- return false;
- }
- boolean RockValid() {
- for (int i = 0; i < RMine.length; i++) {
- if (RockTile != null) {
- final RSObject ob = objects.getTopAt(RockTile);
- if (ob != null) {
- if (ob.getID() == RMine[i]) {
- return true;
- }
- }
- }
- }
- return false;
- }
- @Override
- public int loop() {
- if(StartExp == 0) {
- StartExp = skills.getCurrentExp(skills.getCurrentExp(Skills.MINING));
- Slevel = skills.getCurrentLevel(skills.getCurrentLevel(Skills.MINING));
- }
- if(m1d1) {
- if(inventory.contains(Ore)) {
- inventory.dropAllExcept(AllPic);
- } else {
- if (getMyPlayer().getAnimation() == -1 || !RockValid()) {
- MineOres();
- AntiBan();
- }
- }
- } else {
- if (inventory.isFull()) {
- inventory.dropAllExcept(AllPic);
- } else {
- if (getMyPlayer().getAnimation() == -1 || !RockValid()) {
- MineOres();
- AntiBan();
- }
- }
- }
- return random(750, 1000);
- }
- public void onFinish() {
- log("Thankyou for using Whipz_man PowerMiner!");
- log("You Mined "+OresMined+ " " +R);
- stopScript();
- }
- @SuppressWarnings("serial")
- class PowerMiner_GUI extends JFrame {
- public PowerMiner_GUI() {
- super();
- initComponents();
- }
- private void StartActionPerformed(ActionEvent e) {
- String MRock = Rock.getSelectedItem().toString();
- if(MRock.equals("Tin")) {
- RMine = Tin_ID;
- R = "Tin Ores";
- MineR = "Tin";
- Ore = 438;
- }else if(MRock.equals("Copper")) {
- RMine = Copper_ID;
- R = "Copper Ores";
- MineR = "Copper";
- Ore = 436;
- }else if(MRock.equals("Iron")) {
- RMine = Iron_ID;
- R = "Iron Ores";
- MineR = "Iron";
- Ore = 440;
- }else if(MRock.equals("Silver")) {
- RMine = Silver_ID;
- R = "Silver Ores";
- MineR = "Silver";
- Ore = 442;
- }else if(MRock.equals("Coal")) {
- RMine = Coal_ID;
- R = "Coal";
- MineR = "Coal";
- Ore = 453;
- }else if(MRock.equals("Gold")) {
- RMine = Gold_ID;
- R = "Gold Ores";
- MineR = "Gold";
- Ore = 444;
- }else if(MRock.equals("Mithril")) {
- RMine = Mithril_ID;
- R = "Mithril Ores";
- MineR = "Mithril";
- Ore = 447;
- }else if(MRock.equals("Adamant")) {
- RMine = Adamant_ID;
- R = "Adamant Ores";
- MineR = "Adamant";
- Ore = 449;
- }else {
- RMine = Rune_ID;
- R = "Runite Ores";
- MineR = "Rune";
- Ore = 451;
- }
- if(M1D1.isSelected()) {
- m1d1 = true;
- log("We are going to M1D1");
- } else {
- m1d1 = false;
- log("We are going to mine a full invent then drop");
- }
- if(MaxDistance.isSelected()) {
- Max = true;
- log("We arent going to far away from where we are!");
- } else {
- Max = false;
- log("Mining all "+R+" on Mini Map!");
- }
- guiwait = false;
- q.dispose();
- }
- private void initComponents() {
- label1 = new JLabel();
- label2 = new JLabel();
- Rock = new JComboBox();
- Start = new JButton();
- M1D1 = new JRadioButton();
- MaxDistance = new JRadioButton();
- Container contentPane = getContentPane();
- //---- label1 ----
- label1.setText("Whipz_man PowerMiner");
- label1.setFont(new Font("Times New Roman", Font.BOLD, 18));
- label1.setForeground(Color.red);
- //---- label2 ----
- label2.setText("What would you like to mine?");
- label2.setForeground(Color.red);
- label2.setFont(new Font("Times New Roman", Font.BOLD, 12));
- //---- Rock ----
- Rock.setModel(new DefaultComboBoxModel(new String[] {
- "Tin",
- "Copper",
- "Iron",
- "Silver",
- "Coal",
- "Gold",
- "Mithril",
- "Adamant",
- "Rune"
- }));
- Rock.setForeground(Color.red);
- Rock.setFont(new Font("Times New Roman", Font.BOLD, 12));
- //---- Start ----
- Start.setText("Start");
- Start.setForeground(Color.red);
- Start.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- StartActionPerformed(e);
- }
- });
- //---- M1D1 ----
- M1D1.setText("M1D1");
- M1D1.setFont(new Font("Times New Roman", Font.BOLD, 11));
- M1D1.setForeground(Color.red);
- //---- MaxDistance ----
- MaxDistance.setText("Max Distance Set");
- MaxDistance.setForeground(Color.red);
- MaxDistance.setFont(new Font("Times New Roman", Font.BOLD, 11));
- GroupLayout contentPaneLayout = new GroupLayout(contentPane);
- contentPane.setLayout(contentPaneLayout);
- contentPaneLayout.setHorizontalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
- .addContainerGap(182, Short.MAX_VALUE)
- .addComponent(Start)
- .addContainerGap())
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(22, 22, 22)
- .addComponent(label1, GroupLayout.PREFERRED_SIZE, 202, GroupLayout.PREFERRED_SIZE)
- .addContainerGap(25, Short.MAX_VALUE))
- .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
- .addContainerGap(47, Short.MAX_VALUE)
- .addComponent(label2, GroupLayout.PREFERRED_SIZE, 166, GroupLayout.PREFERRED_SIZE)
- .addGap(36, 36, 36))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(76, 76, 76)
- .addGroup(contentPaneLayout.createParallelGroup()
- .addComponent(Rock, GroupLayout.PREFERRED_SIZE, 83, GroupLayout.PREFERRED_SIZE)
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(10, 10, 10)
- .addGroup(contentPaneLayout.createParallelGroup()
- .addComponent(MaxDistance)
- .addComponent(M1D1))))
- .addContainerGap(48, Short.MAX_VALUE))
- );
- contentPaneLayout.setVerticalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(label1)
- .addGap(1, 1, 1)
- .addComponent(label2, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(Rock, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(M1D1)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(MaxDistance)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 32, Short.MAX_VALUE)
- .addComponent(Start)
- .addContainerGap())
- );
- pack();
- setLocationRelativeTo(getOwner());
- }
- private JLabel label1;
- private JLabel label2;
- private JComboBox Rock;
- private JButton Start;
- private JRadioButton M1D1;
- private JRadioButton MaxDistance;
- }
- private int AntiBan() {
- Status = "Performing AntiBan";
- int random = random(1, 12);
- switch (random) {
- case 1:
- mouse.moveSlightly();
- sleep(500,600);
- break;
- case 2:
- mouse.moveRandomly(10, 50);
- break;
- case 3:
- mouse.moveOffScreen();
- break;
- case 4:
- camera.moveRandomly(random(250, 1500));
- break;
- case 6:
- if (random(0, 18) == 3) {
- game.openTab(Tab.STATS);
- skills.doHover(Skills.INTERFACE_MINING);
- sleep(random(2000, 2400));
- }
- break;
- case 8:
- if (random(0, 13) == 2) {
- camera.setAngle(random(30, 70));
- sleep(400, 1200);
- }
- break;
- }
- return random(1000, 5000);
- }
- public void messageReceived(MessageEvent e) {
- String msg = e.getMessage();
- if (msg.contains("manage to mine two")) {
- OresMined += 2;
- } else if (msg.contains("manage to")) {
- OresMined++;
- }
- }
- @Override
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- g.setFont(font1);
- g.setColor(color1);
- g.drawString("Whipz_man's PowerMiner", 336, 197);
- g.setFont(font2);
- g.drawString("The Ultimate PowerMiner", 345, 211);
- g.setFont(font3);
- g.drawString("Runtime:", 345, 228);
- g.drawString("Exp Gained:", 345, 243);
- g.drawString("Exp p/h:", 345, 258);
- g.drawString("Ores Mined:", 345, 273);
- g.drawString("Ores p/h:", 345, 288);
- g.drawString("Lvls Gained:", 345, 303);
- g.drawString("Ore being Mined:", 345, 318);
- g.setStroke(stroke1);
- g.drawRoundRect(331, 179, 184, 157, 16, 16);
- g.drawString(""+OresMined, 448, 273);
- g.drawString(""+ExpGained, 448, 243);
- g.drawString(""+OrePh, 448, 288);
- g.drawString(""+ExpPh, 448, 258);
- g.drawString(""+Hour+":"+Minutes+":"+Seconds, 448, 228);
- g.drawString(""+LVLG, 448, 303);
- g.drawString(""+R, 448, 318);
- ExpGained = skills.getCurrentExp(Skills.MINING) - StartExp;
- java.text.DecimalFormat df = new java.text.DecimalFormat("##.##");
- Clevel = skills.getCurrentLevel(Skills.MINING);
- LVLG = Clevel - Slevel;
- ExpGained = skills.getCurrentExp(Skills.MINING) - StartExp;
- Millis = System.currentTimeMillis() - StartTime;
- Num = ((3600000.0 / (double) Millis));
- ExpPh = (int) (Num * ExpGained);
- OrePh = (int) (Num * OresMined);
- Hour = Millis / (1000 * 60 * 60);
- Millis -= Hour * (1000 * 60 * 60);
- Minutes = Millis / (1000 * 60);
- Millis -= Minutes * (1000 * 60);
- Seconds = Millis / 1000;
- }
- }import java.awt.BasicStroke;
- import java.awt.Color;
- import java.awt.Container;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.DefaultComboBoxModel;
- import javax.swing.GroupLayout;
- import javax.swing.JButton;
- import javax.swing.JComboBox;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JRadioButton;
- import javax.swing.LayoutStyle;
- import com.rarebot.event.events.MessageEvent;
- import com.rarebot.event.listeners.MessageListener;
- import com.rarebot.event.listeners.PaintListener;
- import com.rarebot.script.Script;
- import com.rarebot.script.ScriptManifest;
- import com.rarebot.script.methods.Game.Tab;
- import com.rarebot.script.methods.Skills;
- import com.rarebot.script.wrappers.RSObject;
- import com.rarebot.script.wrappers.RSTile;
- @ScriptManifest(
- authors = {"Whipz_man"},
- version = 1.1,
- description = "The Ultimate in PowerMining V1.3",
- name = "Whipz_PowerMiner"
- )
- public class Whipz_PowerMiner extends Script implements PaintListener, MessageListener{
- //Pic
- int AllPic[] = {1265, 1267, 1269, 1271, 1273, 1275, 14099, 14107, 15259, 15261};
- //Rock
- int Tin_ID[] = {2094, 2095, 3038, 3245, 5776, 5777, 5778, 9714, 9716, 11933, 11934, 11935, 11957, 11958, 11959, 14902, 14903, 21293, 21294, 21295} ;
- int Copper_ID[] = {2090, 2091, 2097, 3027, 3229, 5779, 5780, 5781, 9708, 9709, 9710, 11936, 11937, 11938, 11960, 11961, 11962, 14906, 14907, 21284, 21285, 21286};
- int Iron_ID[] = {2092, 2093, 5773, 5774, 5775, 9717, 9718, 9719, 11954, 11955, 11956, 14099, 14107, 14913, 14914, 21281, 21282, 21283, 37307, 37308, 37309 };
- int Silver_ID[] = {2311, 11186, 11187, 11188, 11948, 11949, 11950, 15580, 15581, 29224, 29225, 29226, 32444, 32445, 32446, 37304, 37305, 37306};
- int Coal_ID[] = {2096, 2097, 3032, 3233, 5770, 5771, 5772, 10948, 11930, 11931, 11932, 14850, 14851, 21287, 21288, 21289, 29215, 29216, 29217, 32426, 32427, 32428};
- int Gold_ID[] = {5768, 5769, 9720, 9722, 10574, 10575, 10576, 11183, 11184, 11185, 11943, 15576, 15577, 15578, 32432, 32433, 32434, 45067, 45068};
- int Mithril_ID[] = {2102, 2103, 3041, 3280, 5784, 5785, 5786, 11942, 11943, 11944, 21278, 21279, 21280, 32438, 32439, 32440};
- int Adamant_ID[] = {3040, 3273, 5782, 5783, 11939, 11941, 21275, 21276, 21277, 29233, 29235, 32425, 32436, 32437};
- int Rune_ID[] = {14859, 33078, 33079, 45069, 45070};
- int Ore;
- //Mining ID
- int MiningID = 624;
- //RockVaild
- RSTile RockTile = null;
- //Banking
- int boothID = 11402;
- //GUI Stuff
- int[]RMine;
- boolean guiwait = true;
- PowerMiner_GUI q;
- boolean m1d1;
- boolean Max;
- //AntiBan&Paint
- String Status = "Starting up!";
- int OresMined;
- int ExpGained;
- String MineR;
- int StartExp;
- long StartTime;
- long Hours;
- long Minutes;
- long Seconds;
- String R = "";
- private final Color color1 = new Color(0, 255, 255);
- private final BasicStroke stroke1 = new BasicStroke(4);
- private final Font font1 = new Font("Times New Roman", 1, 16);
- private final Font font2 = new Font("Times New Roman", 1, 14);
- private final Font font3 = new Font("Times New Roman", 1, 13);
- int Clevel;
- int LVLG;
- int Slevel;
- long Millis;
- long Hour;
- long Second;
- int ExpPh;
- int OrePh;
- int ExpLvl;
- double Percent;
- double Num;
- public boolean onStart() {
- while (!game.isLoggedIn()) {
- game.login();
- sleep(2000);
- }
- java.awt.EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- q = new PowerMiner_GUI();
- q.setVisible(true);
- q.setAlwaysOnTop(true);
- }
- });
- while (guiwait) sleep (500);
- log("You are going to Mine "+R);
- StartTime = System.currentTimeMillis();
- StartExp = skills.getCurrentExp(Skills.MINING);
- Slevel = skills.getCurrentLevel(skills.MINING);
- return true;
- }
- boolean MineOres() {
- final RSObject rock = objects.getNearest(RMine);
- if (rock != null) {
- if(Max) {
- if (rock != null && calc.distanceTo(rock) <5) {
- if (rock.isOnScreen()) {
- if (rock.interact("Mine")) {
- RockTile = tiles.getTileUnderMouse();
- sleep(1000);
- while(getMyPlayer().isMoving()) {
- sleep(50);
- }
- return true;
- }
- } else {
- return walking.walkTileMM(rock.getLocation(), 1, 1);
- }
- }
- } else {
- if (rock.isOnScreen()) {
- if (rock.interact("Mine")) {
- RockTile = tiles.getTileUnderMouse();
- sleep(1000);
- while(getMyPlayer().isMoving()) {
- sleep(50);
- }
- return true;
- }
- } else {
- return walking.walkTileMM(rock.getLocation(), 1, 1);
- }
- }
- }
- return false;
- }
- boolean RockValid() {
- for (int i = 0; i < RMine.length; i++) {
- if (RockTile != null) {
- final RSObject ob = objects.getTopAt(RockTile);
- if (ob != null) {
- if (ob.getID() == RMine[i]) {
- return true;
- }
- }
- }
- }
- return false;
- }
- @Override
- public int loop() {
- if(StartExp == 0) {
- StartExp = skills.getCurrentExp(skills.getCurrentExp(Skills.MINING));
- Slevel = skills.getCurrentLevel(skills.getCurrentLevel(Skills.MINING));
- }
- if(m1d1) {
- if(inventory.contains(Ore)) {
- inventory.dropAllExcept(AllPic);
- } else {
- if (getMyPlayer().getAnimation() == -1 || !RockValid()) {
- MineOres();
- AntiBan();
- }
- }
- } else {
- if (inventory.isFull()) {
- inventory.dropAllExcept(AllPic);
- } else {
- if (getMyPlayer().getAnimation() == -1 || !RockValid()) {
- MineOres();
- AntiBan();
- }
- }
- }
- return random(750, 1000);
- }
- public void onFinish() {
- log("Thankyou for using Whipz_man PowerMiner!");
- log("You Mined "+OresMined+ " " +R);
- stopScript();
- }
- @SuppressWarnings("serial")
- class PowerMiner_GUI extends JFrame {
- public PowerMiner_GUI() {
- super();
- initComponents();
- }
- private void StartActionPerformed(ActionEvent e) {
- String MRock = Rock.getSelectedItem().toString();
- if(MRock.equals("Tin")) {
- RMine = Tin_ID;
- R = "Tin Ores";
- MineR = "Tin";
- Ore = 438;
- }else if(MRock.equals("Copper")) {
- RMine = Copper_ID;
- R = "Copper Ores";
- MineR = "Copper";
- Ore = 436;
- }else if(MRock.equals("Iron")) {
- RMine = Iron_ID;
- R = "Iron Ores";
- MineR = "Iron";
- Ore = 440;
- }else if(MRock.equals("Silver")) {
- RMine = Silver_ID;
- R = "Silver Ores";
- MineR = "Silver";
- Ore = 442;
- }else if(MRock.equals("Coal")) {
- RMine = Coal_ID;
- R = "Coal";
- MineR = "Coal";
- Ore = 453;
- }else if(MRock.equals("Gold")) {
- RMine = Gold_ID;
- R = "Gold Ores";
- MineR = "Gold";
- Ore = 444;
- }else if(MRock.equals("Mithril")) {
- RMine = Mithril_ID;
- R = "Mithril Ores";
- MineR = "Mithril";
- Ore = 447;
- }else if(MRock.equals("Adamant")) {
- RMine = Adamant_ID;
- R = "Adamant Ores";
- MineR = "Adamant";
- Ore = 449;
- }else {
- RMine = Rune_ID;
- R = "Runite Ores";
- MineR = "Rune";
- Ore = 451;
- }
- if(M1D1.isSelected()) {
- m1d1 = true;
- log("We are going to M1D1");
- } else {
- m1d1 = false;
- log("We are going to mine a full invent then drop");
- }
- if(MaxDistance.isSelected()) {
- Max = true;
- log("We arent going to far away from where we are!");
- } else {
- Max = false;
- log("Mining all "+R+" on Mini Map!");
- }
- guiwait = false;
- q.dispose();
- }
- private void initComponents() {
- label1 = new JLabel();
- label2 = new JLabel();
- Rock = new JComboBox();
- Start = new JButton();
- M1D1 = new JRadioButton();
- MaxDistance = new JRadioButton();
- Container contentPane = getContentPane();
- //---- label1 ----
- label1.setText("Whipz_man PowerMiner");
- label1.setFont(new Font("Times New Roman", Font.BOLD, 18));
- label1.setForeground(Color.red);
- //---- label2 ----
- label2.setText("What would you like to mine?");
- label2.setForeground(Color.red);
- label2.setFont(new Font("Times New Roman", Font.BOLD, 12));
- //---- Rock ----
- Rock.setModel(new DefaultComboBoxModel(new String[] {
- "Tin",
- "Copper",
- "Iron",
- "Silver",
- "Coal",
- "Gold",
- "Mithril",
- "Adamant",
- "Rune"
- }));
- Rock.setForeground(Color.red);
- Rock.setFont(new Font("Times New Roman", Font.BOLD, 12));
- //---- Start ----
- Start.setText("Start");
- Start.setForeground(Color.red);
- Start.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- StartActionPerformed(e);
- }
- });
- //---- M1D1 ----
- M1D1.setText("M1D1");
- M1D1.setFont(new Font("Times New Roman", Font.BOLD, 11));
- M1D1.setForeground(Color.red);
- //---- MaxDistance ----
- MaxDistance.setText("Max Distance Set");
- MaxDistance.setForeground(Color.red);
- MaxDistance.setFont(new Font("Times New Roman", Font.BOLD, 11));
- GroupLayout contentPaneLayout = new GroupLayout(contentPane);
- contentPane.setLayout(contentPaneLayout);
- contentPaneLayout.setHorizontalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
- .addContainerGap(182, Short.MAX_VALUE)
- .addComponent(Start)
- .addContainerGap())
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(22, 22, 22)
- .addComponent(label1, GroupLayout.PREFERRED_SIZE, 202, GroupLayout.PREFERRED_SIZE)
- .addContainerGap(25, Short.MAX_VALUE))
- .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
- .addContainerGap(47, Short.MAX_VALUE)
- .addComponent(label2, GroupLayout.PREFERRED_SIZE, 166, GroupLayout.PREFERRED_SIZE)
- .addGap(36, 36, 36))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(76, 76, 76)
- .addGroup(contentPaneLayout.createParallelGroup()
- .addComponent(Rock, GroupLayout.PREFERRED_SIZE, 83, GroupLayout.PREFERRED_SIZE)
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(10, 10, 10)
- .addGroup(contentPaneLayout.createParallelGroup()
- .addComponent(MaxDistance)
- .addComponent(M1D1))))
- .addContainerGap(48, Short.MAX_VALUE))
- );
- contentPaneLayout.setVerticalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(label1)
- .addGap(1, 1, 1)
- .addComponent(label2, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(Rock, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(M1D1)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(MaxDistance)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 32, Short.MAX_VALUE)
- .addComponent(Start)
- .addContainerGap())
- );
- pack();
- setLocationRelativeTo(getOwner());
- }
- private JLabel label1;
- private JLabel label2;
- private JComboBox Rock;
- private JButton Start;
- private JRadioButton M1D1;
- private JRadioButton MaxDistance;
- }
- private int AntiBan() {
- Status = "Performing AntiBan";
- int random = random(1, 12);
- switch (random) {
- case 1:
- mouse.moveSlightly();
- sleep(500,600);
- break;
- case 2:
- mouse.moveRandomly(10, 50);
- break;
- case 3:
- mouse.moveOffScreen();
- break;
- case 4:
- camera.moveRandomly(random(250, 1500));
- break;
- case 6:
- if (random(0, 18) == 3) {
- game.openTab(Tab.STATS);
- skills.doHover(Skills.INTERFACE_MINING);
- sleep(random(2000, 2400));
- }
- break;
- case 8:
- if (random(0, 13) == 2) {
- camera.setAngle(random(30, 70));
- sleep(400, 1200);
- }
- break;
- }
- return random(1000, 5000);
- }
- public void messageReceived(MessageEvent e) {
- String msg = e.getMessage();
- if (msg.contains("manage to mine two")) {
- OresMined += 2;
- } else if (msg.contains("manage to")) {
- OresMined++;
- }
- }
- @Override
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- g.setFont(font1);
- g.setColor(color1);
- g.drawString("Whipz_man's PowerMiner", 336, 197);
- g.setFont(font2);
- g.drawString("The Ultimate PowerMiner", 345, 211);
- g.setFont(font3);
- g.drawString("Runtime:", 345, 228);
- g.drawString("Exp Gained:", 345, 243);
- g.drawString("Exp p/h:", 345, 258);
- g.drawString("Ores Mined:", 345, 273);
- g.drawString("Ores p/h:", 345, 288);
- g.drawString("Lvls Gained:", 345, 303);
- g.drawString("Ore being Mined:", 345, 318);
- g.setStroke(stroke1);
- g.drawRoundRect(331, 179, 184, 157, 16, 16);
- g.drawString(""+OresMined, 448, 273);
- g.drawString(""+ExpGained, 448, 243);
- g.drawString(""+OrePh, 448, 288);
- g.drawString(""+ExpPh, 448, 258);
- g.drawString(""+Hour+":"+Minutes+":"+Seconds, 448, 228);
- g.drawString(""+LVLG, 448, 303);
- g.drawString(""+R, 448, 318);
- ExpGained = skills.getCurrentExp(Skills.MINING) - StartExp;
- java.text.DecimalFormat df = new java.text.DecimalFormat("##.##");
- Clevel = skills.getCurrentLevel(Skills.MINING);
- LVLG = Clevel - Slevel;
- ExpGained = skills.getCurrentExp(Skills.MINING) - StartExp;
- Millis = System.currentTimeMillis() - StartTime;
- Num = ((3600000.0 / (double) Millis));
- ExpPh = (int) (Num * ExpGained);
- OrePh = (int) (Num * OresMined);
- Hour = Millis / (1000 * 60 * 60);
- Millis -= Hour * (1000 * 60 * 60);
- Minutes = Millis / (1000 * 60);
- Millis -= Minutes * (1000 * 60);
- Seconds = Millis / 1000;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment