Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Map;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSObject;import org.rsbot.event.listeners.PaintListener;
- import java.awt.*;
- import javax.imageio.ImageIO;
- import java.io.IOException;
- import java.net.URL;
- @ScriptManifest(authors = "gpianist", name = "SSMiner", version = 1.0, description = "Test")
- public class SSMiner extends Script implements PaintListener {
- int[] OreID = { 9711, 9713 };
- int[] pickID = { 1265, 1267, 1269, 1271, 1273, 1275 };
- private String status = "";
- public long startTime = System.currentTimeMillis();
- public int startexp;
- public boolean onStart() {
- log("Welcome to Test.");
- mouse.setSpeed(9);
- return true;
- }
- public void antiban() {
- int b = random(0, 10);
- switch (b) {
- case 1:
- if (random(0, 10) == 5) {
- log("Antiban- move mouse");
- status = "Moving Mouse";
- mouse.moveSlightly();
- sleep(200, 600);
- mouse.moveRandomly(150, 350);
- }
- break;
- case 2:
- if (random(0, 13) == 2) {
- log("Antiban- Turn screen");
- status = "Turning Screen";
- camera.setAngle(random(30, 70));
- sleep(400, 1200);
- }
- break;
- case 3:
- if (random(0, 24) == 6) {
- log("Antiban- mouse off screen");
- mouse.moveOffScreen();
- status = "Moving off screen";
- sleep(random(600, random(1200, 2000)));
- }
- break;
- case 4:
- if (random(0, 18) == 3) {
- log("Antiban- Checking Xp.");
- game.openTab(1);
- status = "Doing rangdom stuff";
- skills.doHover(skills.INTERFACE_MINING);
- sleep(random(2100, 3400));
- }
- break;
- default:
- break;
- }
- }
- private Image getImage(String url) {
- try {
- return ImageIO.read(new URL(url));
- } catch(IOException e) {
- return null;
- }
- }
- private final Color color1 = new Color(204, 0, 0, 140);
- private final Color color2 = new Color(0, 0, 0);
- private final Color color3 = new Color(255, 255, 255);
- private final BasicStroke stroke5 = new BasicStroke(5);
- private final Font font1 = new Font("Arial", 0, 13);
- public void onRepaint(Graphics g) {
- if (isLoggedIn()) {
- int xpGained = 0;
- if ( startexp == 0) {
- startexp = skills.getCurrentSkillExp(STAT_MINING);
- }
- xpGained = skills.getCurrentSkillExp(STAT_MINING) - startexp;
- long millis = System.currentTimeMillis() - startTime;
- long hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- long minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- long seconds = millis / 1000;
- Graphics2D g = (Graphics2D)g;
- float xpsec = 0;
- if ((minutes > 0 || hours > 0 || seconds > 0) && exp > 0) {
- xpsec = ((float) exp)/(float)(seconds + (minutes*60) + (hours*60*60));
- }
- float xpmin = xpsec * 60;
- float xphour = xpmin * 60;
- }
- g.setColor(color1);
- g.fillRoundRect(553, 287, 179, 173, 16, 16);
- g.setColor(color2);
- g.setStroke(stroke5);
- g.drawRoundRect(553, 287, 179, 173, 16, 16);
- g.setFont(font1);
- g.setColor(color3);
- g.drawString("GPianists's SSMiner!" , 563, 305);
- g.drawString("Time Running:" + hours + ": " + minutes + ": " + seconds, 562, 346);
- g.drawString("Status: " + status, 563, 383);
- g.drawString("XP Gained: " + xpGained, 563, 410);
- g.drawString("Approximatly: " + (int)xphour + "Gained An Hour.", 563, 430);
- g.setColor(color2);
- g.fillRoundRect(6, 458, 90, 18, 16, 16);
- g.drawRoundRect(6, 458, 90, 18, 16, 16);
- g.drawLine(mouse.getLocation().x - 6, mouse.getLocation().y,
- mouse.getLocation().x + 6, mouse.getLocation().y);
- g.drawLine(mouse.getLocation
- ().x, mouse.getLocation().y - 6,
- mouse.getLocation().x, mouse.getLocation().y + 6);
- }
- private void mineOre() {
- RSObject Ore = objects.getNearest(OreID);
- if (Ore != null && getMyPlayer().getAnimation() == -1) {
- Ore.doAction("Mine");
- }
- }
- private void dropOre() {
- inventory.dropAllExcept(pickID);
- }
- public void onFinish() {
- log("Goodbye.");
- }
- public int loop() {
- if (inventory.isFull()) {
- dropOre();
- } else if (!inventory.isFull()) {
- mineOre();
- }
- return (random(650, 950));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement