Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.63 KB | None | 0 0
  1. import java.util.Map;
  2. import org.rsbot.script.Script;
  3. import org.rsbot.script.ScriptManifest;
  4. import org.rsbot.script.wrappers.RSObject;import org.rsbot.event.listeners.PaintListener;
  5. import java.awt.*;
  6. import javax.imageio.ImageIO;
  7. import java.io.IOException;
  8. import java.net.URL;
  9.  
  10. @ScriptManifest(authors = "gpianist", name = "SSMiner", version = 1.0, description = "Test")
  11. public class SSMiner extends Script implements PaintListener {
  12.  
  13.     int[] OreID = { 9711, 9713 };
  14.     int[] pickID = { 1265, 1267, 1269, 1271, 1273, 1275 };
  15.     private String status = "";
  16.     public long startTime = System.currentTimeMillis();
  17.     public int startexp;
  18.  
  19.     public boolean onStart() {
  20.         log("Welcome to Test.");
  21.         mouse.setSpeed(9);
  22.         return true;
  23.  
  24.     }
  25.  
  26.     public void antiban() {
  27.          
  28.         int b = random(0, 10);
  29.              switch (b) {
  30.              case 1:
  31.                  if (random(0, 10) == 5) {
  32.                      log("Antiban- move mouse");
  33.                      status = "Moving Mouse";
  34.                      mouse.moveSlightly();
  35.                      sleep(200, 600);
  36.                      mouse.moveRandomly(150, 350);
  37.                  }
  38.                  break;
  39.              case 2:
  40.                  if (random(0, 13) == 2) {
  41.                      
  42.                      log("Antiban- Turn screen");
  43.                      status = "Turning Screen";
  44.                      camera.setAngle(random(30, 70));
  45.                      sleep(400, 1200);                
  46.                    
  47.                  }            
  48.                  break;
  49.              case 3:
  50.                  if (random(0, 24) == 6) {
  51.                  
  52.                      log("Antiban- mouse off screen");
  53.                      mouse.moveOffScreen();
  54.                      status = "Moving off screen";
  55.                      sleep(random(600, random(1200, 2000)));
  56.                  }
  57.                  break;
  58.              case 4:
  59.                  if (random(0, 18) == 3) {
  60.                      
  61.                      log("Antiban- Checking Xp.");
  62.                      game.openTab(1);
  63.                      status = "Doing rangdom stuff";
  64.                      skills.doHover(skills.INTERFACE_MINING);                
  65.                      sleep(random(2100, 3400));
  66.                  }
  67.                  break;
  68.            default:
  69.                  break;
  70.              }
  71.          }
  72.  
  73.     private Image getImage(String url) {
  74.         try {
  75.             return ImageIO.read(new URL(url));
  76.         } catch(IOException e) {
  77.             return null;
  78.         }
  79.     }
  80.  
  81.     private final Color color1 = new Color(204, 0, 0, 140);
  82.     private final Color color2 = new Color(0, 0, 0);
  83.     private final Color color3 = new Color(255, 255, 255);
  84.  
  85.     private final BasicStroke stroke5 = new BasicStroke(5);
  86.  
  87.     private final Font font1 = new Font("Arial", 0, 13);
  88.  
  89.     public void onRepaint(Graphics g) {
  90.         if (isLoggedIn()) {
  91.     int xpGained = 0;
  92.     if ( startexp == 0) {
  93.         startexp = skills.getCurrentSkillExp(STAT_MINING);
  94.     }
  95.     xpGained = skills.getCurrentSkillExp(STAT_MINING) - startexp;
  96.         long millis = System.currentTimeMillis() - startTime;
  97.         long hours = millis / (1000 * 60 * 60);
  98.         millis -= hours * (1000 * 60 * 60);
  99.         long minutes = millis / (1000 * 60);
  100.         millis -= minutes * (1000 * 60);
  101.         long seconds = millis / 1000;
  102.         Graphics2D g = (Graphics2D)g;
  103.     float xpsec = 0;
  104.     if ((minutes > 0 || hours > 0 || seconds > 0) && exp > 0) {
  105.     xpsec = ((float) exp)/(float)(seconds + (minutes*60) + (hours*60*60));
  106.     }
  107.     float xpmin = xpsec * 60;
  108.     float xphour = xpmin * 60;
  109.     }
  110.        
  111.        
  112.        
  113.         g.setColor(color1);
  114.         g.fillRoundRect(553, 287, 179, 173, 16, 16);
  115.         g.setColor(color2);
  116.         g.setStroke(stroke5);
  117.         g.drawRoundRect(553, 287, 179, 173, 16, 16);
  118.         g.setFont(font1);
  119.         g.setColor(color3);
  120.         g.drawString("GPianists's SSMiner!" , 563, 305);
  121.         g.drawString("Time Running:" + hours + ": " + minutes + ": " + seconds, 562, 346);
  122.         g.drawString("Status: " + status, 563, 383);
  123.     g.drawString("XP Gained: " + xpGained, 563, 410);
  124.     g.drawString("Approximatly: " + (int)xphour + "Gained An Hour.", 563, 430);
  125.         g.setColor(color2);
  126.         g.fillRoundRect(6, 458, 90, 18, 16, 16);
  127.         g.drawRoundRect(6, 458, 90, 18, 16, 16);
  128.    
  129.         g.drawLine(mouse.getLocation().x - 6, mouse.getLocation().y,
  130.                 mouse.getLocation().x + 6, mouse.getLocation().y);
  131.                 g.drawLine(mouse.getLocation
  132.  
  133.                 ().x, mouse.getLocation().y - 6,
  134.                                
  135.  
  136.                 mouse.getLocation().x, mouse.getLocation().y + 6);
  137.    
  138.     }
  139.  
  140.     private void mineOre() {
  141.         RSObject Ore = objects.getNearest(OreID);
  142.         if (Ore != null && getMyPlayer().getAnimation() == -1) {
  143.             Ore.doAction("Mine");
  144.         }
  145.     }
  146.  
  147.     private void dropOre() {
  148.         inventory.dropAllExcept(pickID);
  149.     }
  150.  
  151.     public void onFinish() {
  152.         log("Goodbye.");
  153.     }
  154.  
  155.     public int loop() {
  156.         if (inventory.isFull()) {
  157.             dropOre();
  158.         } else if (!inventory.isFull()) {
  159.             mineOre();
  160.         }
  161.         return (random(650, 950));
  162.  
  163.     }
  164. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement