- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- import javax.swing.GroupLayout;
- import javax.swing.LayoutStyle;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.methods.Skills;
- @ScriptManifest(authors = "<HTML><b><font color='red'>FootJam/Inevitable</font></HTML>", name = "iMinerPro", version = 2.1, description = "AIO Power Mines/Setting in Gui")
- public class iMinerPro extends Script implements PaintListener {
- String status = "Starting up";
- int[] PickaxeID = {1265, 1267, 1269, 1273, 1271, 1275, 15259};
- // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
- // Generated using JFormDesigner Evaluation license - collin dawg
- private JLabel label1;
- private JLabel label2;
- private JLabel label3;
- private JComboBox oresSelected;
- private JButton button1;
- // JFormDesigner - End of variables declaration //GEN-END:variables
- private final static int[] Coal_ID = {2096, 2097};
- private final static int[] Iron_ID = {2093, 2092};
- private final static int[] Copper_ID = {11937, 11938, 9710, 9708, 9709};
- private final static int[] Tin_ID = {11933, 11934, 11935, 11957, 11958, 11959, 9714, 9716};
- private final static int[] Silver_ID = {37306, 37304, 37305, 11950, 11949, 11948};
- private final static int[] Gold_ID = {37312, 37310, 9720, 9722};
- private final static int[] Mithral_ID = {5784, 5786, 5785};
- private final static int[] Adamantite_ID = {32435, 32436, 32437};
- private final static int[] Runite_ID = {33079, 33078};
- private static final int Coal = 453;
- private static final int Iron = 440;
- private static final int Copper = 436;
- private static final int Tin = 438;
- private static final int Silver = 442;
- private static final int Gold = 444;
- private static final int Mithral = 447;
- private static final int Adamantite = 449;
- private static final int Runite = 451;
- private int[] oresToMine;
- private int oreID = 0;
- private int startExp;
- public int expGained = 0;
- public int startLevel;
- public int lvlGain;
- long secondsTNL = 0;
- long hoursTNL = 0;
- long minutesTNL = 0;
- public long startTime = 0;
- public int currLevel;
- public int expHour = 0;
- private final Color color1 = new Color(0, 0, 0, 218);
- private final Color color2 = new Color(0, 0, 0);
- private final Color color3 = new Color(255, 255, 255);
- private final BasicStroke stroke1 = new BasicStroke(1);
- private final Font font1 = new Font("Arial", 1, 10);
- private final Font font2 = new Font("Arial", 1, 20);
- public void onRepaint(Graphics g1) {
- //Time TNL
- long secondsTNL = (skills.getExpToNextLevel(skills.MINING));
- long hoursTNL = secondsTNL / (60 * 60);
- secondsTNL -= hoursTNL * (60 * 60);
- long minutesTNL = secondsTNL / 60;
- secondsTNL -= minutesTNL * 60;
- expGained = skills.getCurrentExp(skills.MINING) - startExp;
- lvlGain = skills.getCurrentLevel(Skills.MINING) - startLevel;
- int toNextLvl = skills.getExpToNextLevel(Skills.MINING);
- currLevel = skills.getCurrentLevel(Skills.MINING);
- long millis = System.currentTimeMillis() - startTime;
- Graphics2D g = (Graphics2D) g1;
- g.setColor(color1);
- g.fillRect(3, 3, 169, 186);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(3, 3, 169, 186);
- g.setFont(font1);
- g.setColor(color3);
- g.drawString("Run Time: " + org.rsbot.script.util.Timer.format(millis) + ".", 7, 66);
- g.drawString("Time TNL: " + hoursTNL + ":" + minutesTNL + ":" + secondsTNL, 8, 90);
- g.drawString("Exp Gained: " + expGained, 8, 110);
- g.drawString("Exp TNL: " + skills.getExpToNextLevel(skills.MINING), 8, 133);
- g.drawString("Level(s) Gained: " + currLevel + " (" + lvlGain + ")", 8, 154);
- g.drawString("Status: " + status, 8, 173);
- g.setFont(font2);
- g.drawString("iMinerPro", 39, 29);
- g.setFont(font1);
- g.drawString("V: 2.1", 67, 42);
- // Mouse
- g.setColor(Color.green);
- g.drawLine(0, (int) (mouse.getLocation().getY()), 800, (int) (mouse.getLocation().getY()));
- g.drawLine((int) (mouse.getLocation().getX()), 0, (int) (mouse.getLocation().getX()), 800);
- g.setColor(Color.green);
- g.drawLine(0, (int) (mouse.getLocation().getY()), 800, (int) (mouse.getLocation().getY()));
- g.drawLine((int) (mouse.getLocation().getX()), 0, (int) (mouse.getLocation().getX()), 800);
- }
- // AntiBan
- public void antiban() {
- int b = random(0, 10);
- switch (b) {
- case 1:
- if (random(0, 10) == 5) {
- log("[Antiban] move mouse");
- status = "Move mouse...";
- mouse.moveSlightly();
- sleep(200, 600);
- mouse.moveRandomly(150, 350);
- }
- break;
- case 2:
- if (random(0, 13) == 2) {
- log("[Antiban] Turn screen");
- status = "Turn screen...";
- camera.setAngle(random(30, 70));
- sleep(400, 1200);
- }
- break;
- case 3:
- if (random(0, 24) == 6) {
- log("[Antiban] mouse off screen");
- status = "Mouse off screen...";
- mouse.moveOffScreen();
- sleep(random(600, random(1200, 2000)));
- }
- break;
- case 4:
- if (random(0, 18) == 3) {
- log("[Antiban] Checking Xp.");
- status = "Checking Xp...";
- game.openTab(1);
- skills.doHover(skills.INTERFACE_MINING);
- sleep(random(2100, 3400));
- }
- break;
- default:
- break;
- }
- }
- private boolean guiWait = true;
- gui g = new gui();
- public boolean onStart() {
- log("Welcome to iMinerPro.");
- startExp = skills.getCurrentExp(Skills.MINING);
- startLevel = skills.getCurrentLevel(Skills.MINING);
- startTime = System.currentTimeMillis();
- g.setVisible(true);
- while (guiWait) {
- sleep(500);
- }
- return true;
- }
- private void mineOre() {
- RSObject Rock = objects.getNearest(oresToMine);
- if (Rock != null) {
- if (Rock.isOnScreen()) {
- if (getMyPlayer().getAnimation() < 0) {
- Rock.doAction("Mine");
- }
- sleep(250, 750);
- }
- }
- }
- private void dropOre() {
- inventory.dropAllExcept(PickaxeID);
- mouse.setSpeed(random(3, 4));
- }
- public void onFinish() {
- log("Thank you for useing iMinerPro, Hope you liked it.");
- }
- public int loop() {
- if (inventory.isFull()) {
- dropOre();
- status = "Dropping Ore...";
- antiban();
- } else if (!inventory.isFull()) {
- mineOre();
- status = "Mining Ore...";
- antiban();
- }
- return 1000;
- }
- class gui extends JFrame {
- public gui() {
- initComponents();
- }
- private void button1ActionPerformed(ActionEvent e) {
- String chosen = oresSelected.getSelectedItem().toString();
- if (chosen.equals("Coal")) {
- oreID = Coal;
- oresToMine = Coal_ID;
- } else if (chosen.equals("Iron")) {
- oreID = Iron;
- oresToMine = Iron_ID;
- } else if (chosen.equals("Copper")) {
- oreID = Copper;
- oresToMine = Copper_ID;
- } else if (chosen.equals("Tin")) {
- oreID = Tin;
- oresToMine = Tin_ID;
- } else if (chosen.equals("Silver")) {
- oreID = Silver;
- oresToMine = Silver_ID;
- } else if (chosen.equals("Gold")) {
- oreID = Gold;
- oresToMine = Gold_ID;
- } else if (chosen.equals("Mithral")) {
- oreID = Mithral;
- oresToMine = Mithral_ID;
- } else if (chosen.equals("Adamantite")) {
- oreID = Adamantite;
- oresToMine = Adamantite_ID;
- } else if (chosen.equals("Runite")) {
- oreID = Runite;
- oresToMine = Runite_ID;
- }
- guiWait = false;
- dispose();
- }
- private void initComponents() {
- // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
- // Generated using JFormDesigner Evaluation license - collin dawg
- label1 = new JLabel();
- label2 = new JLabel();
- label3 = new JLabel();
- oresSelected = new JComboBox();
- button1 = new JButton();
- //======== this ========
- Container contentPane = getContentPane();
- //---- label1 ----
- label1.setText("iMinerPro");
- label1.setFont(new Font("Trebuchet MS", Font.BOLD, 25));
- //---- label2 ----
- label2.setText("Ores to Mine:");
- label2.setFont(new Font("Trebuchet MS", Font.BOLD, 14));
- //---- label3 ----
- label3.setText("Credit to - Inevitable");
- label3.setFont(new Font("Trebuchet MS", Font.PLAIN, 12));
- //---- oresSelected ----
- oresSelected.setModel(new DefaultComboBoxModel(new String[]{
- "Copper",
- "Tin",
- "Iron",
- "Silver",
- "Coal",
- "Gold",
- "Mithral",
- "Adamantite",
- "Runite"}));
- //---- button1 ----
- button1.setText("Start Script");
- button1.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- button1ActionPerformed(e);
- }
- });
- GroupLayout contentPaneLayout = new GroupLayout(contentPane);
- contentPane.setLayout(contentPaneLayout);
- contentPaneLayout.setHorizontalGroup(
- contentPaneLayout.createParallelGroup().addGroup(contentPaneLayout.createSequentialGroup().addGap(10, 10, 10).addComponent(label2).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(oresSelected, 0, 74, Short.MAX_VALUE).addContainerGap(38, Short.MAX_VALUE)).addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup().addContainerGap(45, Short.MAX_VALUE).addComponent(button1, GroupLayout.PREFERRED_SIZE, 131, GroupLayout.PREFERRED_SIZE).addGap(43, 43, 43)).addGroup(contentPaneLayout.createSequentialGroup().addGap(51, 51, 51).addGroup(contentPaneLayout.createParallelGroup().addComponent(label3, GroupLayout.PREFERRED_SIZE, 124, GroupLayout.PREFERRED_SIZE).addComponent(label1)).addContainerGap(44, Short.MAX_VALUE)));
- contentPaneLayout.setVerticalGroup(
- contentPaneLayout.createParallelGroup().addGroup(contentPaneLayout.createSequentialGroup().addContainerGap().addComponent(label1).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(label3).addGap(18, 18, 18).addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(label2).addComponent(oresSelected, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE).addComponent(button1)));
- pack();
- setLocationRelativeTo(getOwner());
- // JFormDesigner - End of component initialization //GEN-END:initComponents
- }
- }
- }