//created my p00d
//use at own risk
//there are still a few bugs to be solved.
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.util.Map;
import org.rsbot.event.listeners.PaintListener;
import org.rsbot.script.Constants;
import org.rsbot.script.Script;
import org.rsbot.script.ScriptManifest;
import org.rsbot.script.wrappers.RSObject; //imports
import org.rsbot.script.wrappers.RSTile;
import org.rsbot.script.Constants;
@ScriptManifest(authors = { "p00d" }, category = "Mining", name = "p00d's power miner", version = 1.0, description =
"<html>Start in rimmington at iron ores, this is my first script<head>" +
"</head><br> Bot at your own risk </br> <br>Script Made by p00d</br><body>" +
"</head></body>")
public class PoodPowerMiner extends Script implements PaintListener{
//**Variables**//
public int pickaxes[] = { 1275, 1265, 1273, 1267, 1271 };
public int iron[] = { 9718, 9717};
public int miningAnimation = 624;
//Paint Variables//
private String status = "Online";
public int startexp;
public int exp;
public int expGained;
public float expsec;
public float expmin;
public float exphour;
public long timeRunning = 0, secounds = 0 ,minutes = 0, hours = 0;
public long startTime = System.currentTimeMillis();
final ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class); //stupid st00f
//startup
public boolean onStart( Map<String,String> args ) {
startTime = System.currentTimeMillis();
return true;
}
//antiban working on adding things such as random emotes
public void antiBan(){
if (random(1, 12) == 1) {
status = "Moving Screen";
setCameraRotation(random(1,360));
}
if (random(1, 11) == 1) {
status = "Moving Mouse";
int x = (int) getMouseLocation().getX();
int y = (int) getMouseLocation().getY();
moveMouse(x + random(-125, 125), y + random(-80, 80));
}
if(random(1, 60) == 1) {
status = "Checking Exp";
openTab(TAB_STATS);
moveMouse(random(661, 712), random(230, 261));
wait(random(2000, 3000));
openTab(TAB_INVENTORY);
}
}
//loop
public int loop() {
antiBan();
if(getMyPlayer().getAnimation() != -1) {
status = "Mining";
return random(1000, 1250);
}
if(getMyPlayer().isMoving()){
return random(1000, 1250);
}
if(isInventoryFull()){
status = "Dropping Ores";
dropAllExcept(pickaxes);
}
RSObject rock = findObject(iron);
status = "Searching For Rocks";
if(rock == null)
return random(200, 500);
atObject(rock, "Mine");
return random(1000, 1500);
}
//paint start
public void onRepaint(Graphics g) {
if (isLoggedIn()) {
if ( startexp == 0) {
startexp = skills.getCurrentSkillExp(Constants.STAT_MINING);
}
expGained = skills.getCurrentSkillExp(Constants.STAT_MINING) - startexp;
timeRunning = System.currentTimeMillis() - startTime;
secounds = timeRunning / 1000;
if (secounds >= 60) {
minutes = secounds / 60;
secounds -= minutes * 60;
}
if (minutes >= 60) {
hours = minutes / 60;
minutes -= hours * 60;
}
if ((minutes > 0 || hours > 0 || secounds > 0) && expGained > 0) {
expsec = ((float) expGained)/(float)(secounds + (minutes*60) + (hours*60*60));
}
exphour = expmin * 60;
expmin = expsec * 60;
}
//paint, font
g.setColor(Color.red);
g.setFont(new Font("Times", Font.PLAIN, 12));
g.drawString("Time Running: " + hours + ":" + minutes + ":" + secounds, 9, 285);
g.drawString("XP Gained: " + expGained, 9, 300);
g.drawString("XP Per hour: " + (int)exphour, 9, 315);
g.drawString("Status: " + status , 9, 330);
g.setColor(Color.green);
g.setFont(new Font("Times", Font.PLAIN, 12));
g.drawString("Time Running: " + hours + ":" + minutes + ":" + secounds, 9 - 1, 285 - 1);
g.drawString("XP Gained: " + expGained, 9 - 1, 300 - 1);
g.drawString("XP Per hour: " + (int)exphour, 9 - 1, 315 - 1);
g.drawString("Status: " + status , 9 - 1, 330 - 1);
final int percent = skills.getPercentToNextLevel(Constants.STAT_MINING);
g.drawString("Percent till next level: ", 270, 355 + 5);
g.setColor(Color.red);
g.fillRoundRect(386, 350, 100, 10, 15, 15); //these must be on same cordinates
g.setColor(Color.green);
g.fillRoundRect(386, 350, percent, 10, 15, 15); //these must be on same cordinates
g.setColor(Color.black);
g.drawString("" + percent, 428, 360); //this must be in the center of the bar
g.drawRoundRect(386, 350, 100, 10, 15, 15); //these must be on same cordinates
if (isLoggedIn()) {
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;
long minutes2 = minutes + (hours * 60);
g.setColor(Color.green);
g.drawString("P00d's Power Miner" , 400, 330);
}
}
}