Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Made by PureFloy
- /* Copyright 2010
- /* All right reserved.
- */
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.methods.Game;
- import org.rsbot.script.methods.Keyboard;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.event.listeners.ServerMessageListener;
- import java.awt.*;
- import javax.swing.*;
- @ScriptManifest(authors = "PureFloy", keywords = "powermining, easy, flawless", name = "mineIT", version = 0.1, description = "Powermining.")
- public class mineIT extends Script implements PaintListener, ServerMessageListener {
- private String status;
- int[] pickID = {1267, 1265, 1271, 1269, 1275, 1273};
- int[] ironRock = {2093, 2093, 2092, 9717, 9719, 9717, 9718, 11956, 11955, 11954, 37307, 37309, 31072, 31073, 31071, 37308};
- int[] copperRock = {11938, 11936, 11963, 11937, 9709, 9708, 9710, 11960, 11962, 11961, 31080, 31082};
- int[] tinRock = {11935, 11934, 11933, 11959, 11957, 11959, 11958, 9714, 9716, 31079, 31077, 31078};
- int[] clayRock = {9711, 9713};
- int[] silverRock = {11949, 11950, 37306, 37304, 2311, 37305, 9714, 9716, 9713, 11950};
- int[] goldRock = {37312, 37310, 9722, 9720, 15505, 15503, 11185, 11184, 11183, 9720, 9722, 37313, 31065, 31066};
- public long startTime = System.currentTimeMillis();
- public int mineLevelStart = 0;
- public int mineExpStart = 0;
- public int mineLevelGained;
- public int mineExpGained = 0;
- public int minedOres;
- public int invCount;
- int remainingXP = skills.getExpToNextLevel(skills.MINING);
- int rockID;
- gui mineITGUI;
- public boolean guiWait = true;
- public boolean onStart() {
- status = "Starting Up..";
- gui = new mineITGUI();
- gui.setVisible(true);
- while (guiwait) {
- sleep(100);
- }
- log("Happy Powermining!");
- minedOres = 0;
- mineLevelGained = 0;
- mineExpGained = 0;
- invCount = 0;
- return true;
- }
- public void onFinish() {
- log("Thanks for using mineIT. Please donate if you liked it.");
- log("Ores Mined:" + minedOres);
- }
- public void dropOre() {
- status = "Dropping Ores..";
- inventory.dropAllExcept(pickID);
- invCount ++;
- }
- private void mine() {
- status = "Mining..";
- RSObject ores = objects.getNearest(rockID);
- if (ores != null && getMyPlayer().getAnimation() == -1) {
- if (ores.isOnScreen()) {
- ores.doAction("Mine");
- }
- }
- }
- private void antiBan() {
- status = "Antiban..";
- switch (random(0, 30)) {
- case 1:
- camera.setAngle(random(0, 140));
- camera.setPitch(random(140, 335));
- break;
- case 7:
- game.openTab(Game.TAB_STATS);
- sleep(random(800,2000));
- game.openTab(Game.TAB_INVENTORY);
- break;
- case 11:
- sleep(random(400,1000));
- break;
- case 15:
- camera.setAngle(random(0, 145));
- camera.setPitch(random(145, 360));
- game.openTab(Game.TAB_STATS);
- sleep(random(850,1650));
- game.openTab(Game.TAB_INVENTORY);
- case 18:
- camera.setAngle(random(0, 180));
- camera.setPitch(random(180, 360));
- break;
- default:
- }
- }
- public void serverMessageRecieved(ServerMessageEvent e) {
- final String word = e.getMessage().toLowerCase();
- String svrmsg = e.getMessage();
- if (svrmsg.contains("manage to mine")) {
- minedOres = minedOres + 1;
- }
- if (word.contains("tin")) {
- mineExpGained = mineExpGained + 18;
- }
- if (word.contains("copper")) {
- mineExpGained = mineExpGained + 18;
- }
- if (word.contains("clay")) {
- mineExpGained = mineExpGained + 5;
- }
- if (word.contains("iron")) {
- mineExpGained = mineExpGained + 35;
- }
- if (word.contains("silver")) {
- mineExpGained = mineExpGained + 40;
- }
- if (word.contains("coal")) {
- mineExpGained = mineExpGained + 50;
- }
- if (word.contains("gold")) {
- mineExpGained = mineExpGained + 65;
- }
- if (word.contains("advanced")) {
- mineLevelGained++;
- }
- if (word.contains("died")) {
- log("You have died! Stopping script..");
- log("Ores Mined:" + minedOres);
- stopScript();
- }
- }
- private final Color color1 = new Color(0, 0, 0, 130);
- private final Color color2 = new Color(0, 0, 0);
- private final Color color3 = new Color(0, 204, 255);
- private final Color color4 = new Color(0, 0, 0, 205);
- private final Color color5 = new Color(0, 0, 0, 144);
- private final BasicStroke stroke1 = new BasicStroke(1);
- private final Font font1 = new Font("Arial", 1, 25);
- private final Font font2 = new Font("Arial", 0, 15);
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- long runTime = 0;
- long seconds = 0;
- long minutes = 0;
- long hours = 0;
- runTime = System.currentTimeMillis() - startTime;
- seconds = runTime / 1000;
- if ( seconds >= 60 ) {
- minutes = seconds / 60;
- seconds -= (minutes * 60);
- }
- if ( minutes >= 60 ) {
- hours = minutes / 60;
- minutes -= (hours * 60);
- }
- g.setColor(color1);
- g.fillRect(547, 207, 190, 212);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(547, 207, 190, 212);
- g.setFont(font1);
- g.setColor(color3);
- g.drawString("mineIT", 598, 242);
- g.setFont(font2);
- g.drawString("Run Time: " + hours + "." + minutes + "." + seconds, 550, 275);
- g.drawString("Ores Mined: " + minedOres, 550, 300);
- g.drawString("Levels Gained: " + mineLevelGained, 550, 325);
- g.drawString("Exp To Lvl: " + remainingXP, 550, 350);
- g.drawString("Exp Gained: " + mineExpGained, 550, 375);
- g.drawString("Inventories Dropped: " + invCount, 550, 400);
- g.setColor(color4);
- g.fillRect(9, 457, 152, 15);
- g.setColor(color2);
- g.drawRect(9, 457, 152, 15);
- g.setColor(color3);
- g.drawString("Status:" + status, 10, 470);
- g.setColor(color5);
- g.fillRect(3, 3, 107, 20);
- g.setColor(color2);
- g.drawRect(3, 3, 107, 20);
- g.setColor(color3);
- g.drawString("by PureFloy", 6, 18);
- }
- public int loop() {
- if(random(1, 500) > 425) {
- antiBan();
- }
- if (inventory.isFull()) {
- dropOre();
- } else if (!inventory.isFull()) {
- if (getMyPlayer().isIdle()) {
- mine();
- }
- }
- return random(300, 600);
- }
- public class mineITGUI extends JPanel {
- public mineITGUI() {
- initComponents();
- }
- private void initComponents() {
- // Generated using JFormDesigner Evaluation license - RuleZ.
- dialog1 = new JDialog();
- startscript = new JButton();
- title = new JLabel();
- oreselect = new JComboBox();
- selectore = new JLabel();
- //======== dialog1 ========
- {
- dialog1.setResizable(false);
- dialog1.setTitle("mineIT GUI");
- Container dialog1ContentPane = dialog1.getContentPane();
- dialog1ContentPane.setLayout(null);
- //---- startscript ----
- startscript.setText("Start");
- startscript.setSelectedIcon(null);
- dialog1ContentPane.add(startscript);
- startscript.setBounds(75, 95, 85, 25);
- startscript.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- startActionPerformed(e);
- }
- });
- //---- title ----
- title.setText("mineIT");
- title.setFont(new Font("Tahoma", Font.PLAIN, 48));
- dialog1ContentPane.add(title);
- title.setBounds(10, 5, 155, 45);
- //---- oreselect ----
- oreselect.setModel(new DefaultComboBoxModel(new String[] {
- "Clay",
- "Tin",
- "Copper",
- "Iron",
- "Silver",
- "Gold"
- }));
- dialog1ContentPane.add(oreselect);
- oreselect.setBounds(75, 65, 85, 25);
- //---- selectore ----
- selectore.setText("Select Ore:");
- dialog1ContentPane.add(selectore);
- selectore.setBounds(5, 65, 70, 26);
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for(int i = 0; i < dialog1ContentPane.getComponentCount(); i++) {
- Rectangle bounds = dialog1ContentPane.getComponent(i).getBounds();
- preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
- preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
- }
- Insets insets = dialog1ContentPane.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- dialog1ContentPane.setMinimumSize(preferredSize);
- dialog1ContentPane.setPreferredSize(preferredSize);
- }
- dialog1.pack();
- dialog1.setLocationRelativeTo(dialog1.getOwner());
- }
- }
- public void startActionPerformed(ActionEvent e) {
- if (selectore.getSelectedItem().equals("Clay")) {
- rockID = clayRock;
- } else if (selectore.getSelectedItem().equals("Tin")) {
- rockID = int[] tinRock;
- } else if (selectore.getSelectedItem().equals("Copper")) {
- rockID = int[] copperRock;
- } else if (selectore.getSelectedItem().equals("Iron")) {
- rockID = int[] ironRock;
- } else if (selectore.getSelectedItem().equals("Silver")) {
- rockID = int[] silverRock;
- } else if (selectore.getSelectedItem().equals("Gold")) {
- rockID = int[] goldRock;
- }
- }
- // Generated using JFormDesigner Evaluation license - RuleZ.
- private JDialog dialog1;
- private JButton startscript;
- private JLabel title;
- private JComboBox oreselect;
- private JLabel selectore;
- }
- }
Add Comment
Please, Sign In to add comment