Thread: PolarsPowerMiner

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 PolarsPowerMiner 
    なぜこのテキストは日本語で書かれている ?

    Kenneh's Avatar
    Join Date
    Dec 2009
    Age
    30
    Posts
    2,753
    Thanks given
    63
    Thanks received
    296
    Rep Power
    478
    NOTE: This is an iron powerminer

    Added rimmington and east varrock support
    added pickaxe failsafe
    added support for all pickaxes
    added paint



    Code:
    import org.rsbot.script.*;
    import org.rsbot.script.methods.*;
    import org.rsbot.script.wrappers.*;
    import org.rsbot.script.methods.Skills;
    import org.rsbot.event.events.MessageEvent;
    import org.rsbot.event.listeners.PaintListener;
    import org.rsbot.event.listeners.MessageListener;
    
    import java.awt.*;
    import java.net.URL;
    import javax.imageio.ImageIO;
    import java.awt.image.BufferedImage;
    
    @ScriptManifest(authors = "TehPolarBear", keywords = "Mining", name = "PolarsPowerMiner", description = "Polar's first public script edited by Kenneh from Rune-Server", version = 0.2)
    
    public class PolarsPowerMiner extends Script implements PaintListener, MessageListener {
        int [] ironRockID = {11954, 11955, 11956, 9717, 9718, 9179};
        int [] stuffToKeep = {1265, 1267, 1269, 1273, 1271, 1275, 15259, 15532, 15533};
        int [] pickaxe = {1265, 1267, 1269, 1273, 1271, 1275, 15259};
        int [] strangeRocks = {15532, 15533};
        
        @Override
        public boolean onStart() {
            log("Welcome to PolarsPowerMiner");
            loadImages();
            checkPickaxe();
            startTime = System.currentTimeMillis();
            mining = skills.MINING;
            startExp = skills.getCurrentExp(mining);
            startLevel = skills.getCurrentLevel(mining);
            if (pickaxePresent == 1) {
                return true;
            } else {
                log.severe("ERROR: You do not have a pickaxe!");
                stopScript();
                return false;
            }
        }
    
        private void checkPickaxe() {
            if (inventory.containsOneOf(pickaxe)) {
                pickaxePresent = 1;
                log("Pickaxe is in inventory");
            } else if (equipment.containsOneOf(pickaxe)) {
                pickaxePresent = 1;
                log("Pickaxe is wielded");
            } else
            pickaxePresent = 0;
        }
    
        public int loop() {
            if (!inventory.isFull()) {
                if (players.getMyPlayer().getAnimation() == -1) {
                    RSObject rock = objects.getNearest(ironRockID);
                    status = "searching for rock";
                    if (rock != null) {
                        rock.doAction("Mine");
                        status = "mining rock";
                    }
                }
            }
            if (inventory.isFull()){
                inventory.dropAllExcept(stuffToKeep);
                status = "Dropping ores";
            }
            return random(500, 1500);
        }
    
        @Override
        public void onFinish() {
            log("Thank-you for using PolarsPowerMiner!");
        }
        
        /* PAINT */
        
        public void onRepaint(Graphics g1) {
            // default stuff
            Graphics2D g = (Graphics2D)g1;
            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;
            currLevel = skills.getCurrentLevel(mining);
            expGained = skills.getCurrentExp(mining) - startExp;
            lvlsGained = currLevel - startLevel;
            expHour = (int) ((expGained) * 3600000D / (System.currentTimeMillis() - startTime));
            oresHour = (int) ((oresMined) * 3600000D / (System.currentTimeMillis() - startTime));
            final int percent = skills.getPercentToNextLevel(mining);
            int ironOreExp = 35;
            oresTilLevel = skills.getExpToNextLevel(mining) / ironOreExp;
            
            // Actual drawing of the paint
            g.drawImage(banner, 4, 200, null);
            g.drawString("Runtime: " + hours +":"+ minutes + ":" + seconds, 7, 265);
            g.drawString("Gems Found: " + gemCount, 7, 285);
            g.drawString("Strange Rocks: " + strangeRockCount, 7, 305);
            g.drawString("Ores mined: " + oresMined, 7, 325);
            g.drawString("Ores/hour: " + oresHour, 144, 265);
            g.drawString("Ores TNL: " + oresTilLevel, 144, 285);
            g.drawString("Exp gained: " + expGained, 144, 305);
            g.drawString("Exp/hour: " + expHour, 144, 325);
            g.drawString("Exp TNL: " + skills.getExpToNextLevel(mining), 272, 265);
            g.drawString("Status: " + status, 272, 325);
            g.drawString("Current lvl: " + currLevel + " (" + lvlsGained + ")", 272, 285);
            g.drawString("Percent TNL: " + percent + "%", 272, 305);
            drawMouse(g1);
        }
        
        public void drawMouse(final Graphics g) { // Mouse
            final double mouseX = mouse.getLocation().getX() - 8,
            mouseY = mouse.getLocation().getY() - 8;
            final double mousePressX = mouse.getPressLocation().getX() - 8,
            mousePressY = mouse.getPressLocation().getY() - 8;
            if (System.currentTimeMillis() - mouse.getPressTime() < 400) {
                g.drawImage(clicked, (int) mousePressX, (int) mousePressY, null);
            }
            g.drawImage(normal, (int) mouseX, (int) mouseY, null);
        }
        
        public void messageReceived(MessageEvent e) {
            String x = e.getMessage().toLowerCase();
            if (x.contains("you manage to mine")) {
                oresMined++;
            }
            if (x.contains("just found")) {
                gemCount++;
            }
            if (x.contains("strange rock.")) {
                strangeRockCount++;
            }
        }
        
        public void loadImages() {
            try {
                normal = ImageIO.read(new URL("http://i54.tinypic.com/2unwz85.png"));
                clicked = ImageIO.read(new URL("http://i51.tinypic.com/24y1lxe.png"));
                banner = ImageIO.read(new URL("http://dl.dropbox.com/u/9359719/minerlogo.png"));
            } catch (final java.io.IOException e) {
                e.printStackTrace();
            }
        }
        
        public int pickaxePresent;
        public String status = "";
        public int oresMined = 0, lvlsGained = 0, startExp = 0, expGained = 0, expHour = 0,
        oresHour = 0,  last = 0, gemCount = 0, strangeRockCount = 0, oresTilLevel = 0;
        public long startTime = 0, millis = 0, hours = 0, minutes = 0, seconds = 0;
        public int mining, startLevel, currLevel;
        BufferedImage normal = null;
        BufferedImage clicked = null;
        BufferedImage banner = null;
    }


    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Dec 2006
    Age
    29
    Posts
    3,076
    Thanks given
    3
    Thanks received
    23
    Rep Power
    738
    Nice paint :] Is it flawless?
    Skanking whilst playing RuneScape >...


    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Jan 2009
    Age
    31
    Posts
    2,661
    Thanks given
    66
    Thanks received
    207
    Rep Power
    0
    edit: nevermind figured it out =D
    Reply With Quote  
     

  4. #4  
    なぜこのテキストは日本語で書かれている ?

    Kenneh's Avatar
    Join Date
    Dec 2009
    Age
    30
    Posts
    2,753
    Thanks given
    63
    Thanks received
    296
    Rep Power
    478
    Quote Originally Posted by Hooligan View Post
    Nice paint :] Is it flawless?


    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Sep 2009
    Posts
    3,245
    Thanks given
    195
    Thanks received
    255
    Rep Power
    0
    Is making scripts actually that simple? =L
    Reply With Quote  
     

  6. #6  
    なぜこのテキストは日本語で書かれている ?

    Kenneh's Avatar
    Join Date
    Dec 2009
    Age
    30
    Posts
    2,753
    Thanks given
    63
    Thanks received
    296
    Rep Power
    478
    Quote Originally Posted by Fresh View Post
    Is making scripts actually that simple? =L
    Yep.

    lolruntime



    Reply With Quote  
     

  7. #7  
    Registered Member techtimetut's Avatar
    Join Date
    Jul 2011
    Posts
    16
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    I should start using this, hahha xd
    I'm a new donator to Rune-Server. Currently working on a blank server. If you need any help with your RSPS, pm me! :-)

    Reply With Quote  
     

  8. #8  
    Registered Member

    Join Date
    Aug 2011
    Posts
    766
    Thanks given
    105
    Thanks received
    59
    Rep Power
    114
    How do I use it?
    Spoiler for vouches:

    Quote Originally Posted by TheMrClassic View Post
    Vouch for Insidia X. Fast and friendly.
    Quote Originally Posted by Vernorexia View Post
    Vouch for insidia x added clipped following and a timer on my gates. I paid first was fast work. I highly recommend using him!
    Quote Originally Posted by Matts B ring View Post
    Bought 5b ikov, vouch
    Quote Originally Posted by InsinuateRS View Post
    Vouch for me lad, bought 3b

    Reply With Quote  
     

  9. #9  
    Registered Member


    Join Date
    Sep 2010
    Posts
    1,213
    Thanks given
    87
    Thanks received
    159
    Rep Power
    726
    Nice.
    "“La vida es un suspiro, basta verla diferente para que ya sea mejor”
    -Canserbero


    圣地亚哥

    "You can't buy class, class comes by itself"
    -Zlatan Ibrahimović
    Reply With Quote  
     

  10. #10  
    Registered Member ZeroCoder's Avatar
    Join Date
    Mar 2012
    Posts
    85
    Thanks given
    0
    Thanks received
    2
    Rep Power
    53
    Laught my ass when i read this Added rimmington and east varrock support

    it is an Powerminer it Does Support Every Location that Contains the ROCK ID
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •