Welcome to JMINER SCRIPTING! SOON TO BE AIO MINING
Credits:
Xerion
Me
COMMENT SUGGESTIONS - BANKING AND OTHER ORES/LOCATIONS ARE IN WORKS COMMENT!!!!!!!!!!
Known Bugs:
Only mines Tin
Versions
1.0 = Only powermines Tin in east varrock and east lumby... Other ones don't drop = adding in next version
1.1 = Added new locations, new antiban, drops all ores, and working amounts, still doesn't mine
all ore = drops all ore.. can have pickaxe in inventory! ONLY DROPS ORES!! CAN HAVE OTHER OBJs in inv
1.6 = Banking in some locations, some ores, new antiban! Integrated Dropping, for faster.. Not Released
Updates to come:
All location support - All ores support - Banking - New Paint
Any suggestions will be taken into consideration!!!!
Instructions:
Copy and Paste code into notepad and save as JMINER.groovy
Code - V1.1:
import java.awt.*
import org.osbot.script.Script
import org.osbot.script.ScriptManifest
import org.osbot.script.mouse.*
import org.osbot.script.rs2.*
import org.osbot.script.rs2.map.Position
import org.osbot.script.rs2.model.GroundItem
import org.osbot.script.rs2.model.Item
import org.osbot.script.rs2.model.PrimaryObject
import org.osbot.script.rs2.model.RS2Object
import org.osbot.script.rs2.ui.*
@ScriptManifest(name = "JJH3OWNS' Powerminer", author="JJH3OWNS", version = 1.0D, info = "Powermines Iron, Copper, and Tin! TIN IS ONLY ONE WORKING, ONLY AT VARROCK EAST AND LUMBRIDGE EAST. It will mine other ores just won't drop ~ which ever is closest!!!!")
class IronPowerminer extends Script {
enum State {
START, IDLE, MINING, DROP, BANK, BANKING
}
private final Color color1 = new Color(0.1f, 0.1f, 0.1f, 0.7f);
private final Color color2 = new Color(255, 0, 0);
private final Font font1 = new Font("Calisto MT", 0, 16);
private final Font font2 = new Font("Calisto MT", 0, 11);
int[] pickhandle = [480,482,484,486,488,490];
int[] iron = [ 11955, 11956, 11954,2092,2093,5773,5774,5775,6943,6944,9717,9718,9719,14856,14857,14858,14913,14914,19000,19001,19002,21281,21282,21283,29222,29223,29221,32441,32442,32443,32451,32452,37307,37308,37309];
int[] copper = [ 11936, 11937, 11960];
int[] tin = [ 11934, 11935, 11933, 11957, 11958];
int[] items = [480,482,484,486,488,490,1265 , 1267, 1269, 1271,1273,1275,1617,1619,1621,1623]
def timeout = null;
def starttime = null;
def Newantiban = null;
def Minedtin = 0;
def Minedcopper = 0;
def Minediron = 0;
boolean Antibans = true
State state = State.START;
PrimaryObject currentRock = null;
@Override
void onStart() {
starttime = System.currentTimeMillis();
Newantiban = System.currentTimeMillis() + random(10000, 20000);
def th = Thread.start {
antiban()
}
if (client.getInventory().isFull()){
state = State.DROP;
}
else { state = State.IDLE; }
}
@Override
int onLoop() {
if (!randoms()){
switch(state) {
case State.IDLE:
return mine();
case State.MINING:
return check();
case State.DROP:
return drop();
}
}
return 1000 + gRandom(400, 800);
}
int mine() {
currentRock = closestObject(iron);
currentRock = closestObject(11936);
currentRock = closestObject(11937);
currentRock = closestObject(11960);
currentRock = closestObject(tin);
if (currentRock != null) {
if (selectEntityOption(currentRock,false,"Mine")) {
timeout = Calendar.instance.timeInMillis / 1000
state = State.MINING;
}
}
return 100;
}
int check(){
if (!currentRock.exists() || timeout + 15 < Calendar.instance.timeInMillis / 1000){
if (!client.getInventory().isFull()){
state = State.IDLE;
return 500 + random(100, 1000)
}
else {
if (currentTab() != Tab.INVENTORY){
openTab(Tab.INVENTORY);
}
else{state = State.DROP;
return 500 + random(100, 1000)}
}
}
return 100
}
boolean randoms(){
//Losing Pickhandle
if (closestGroundItem(pickhandle) != null){
selectEntityOption(closestGroundItem(pickhandle),"Take")
return true
}
return false
}
int drop(){
if (client.getInventory().contains(438)){
selectInventoryOption(client.getInventory().getSlotForId(438),"drop");
selectInventoryOption(client.getInventory().getSlotForId(436),"drop");
selectInventoryOption(client.getInventory().getSlotForId(440),"drop");
} else {
state = State.IDLE;
}
return 1000 + random(500,800)
}
void onMessage(String message){
if ("You manage to mine some tin." == message){
Minedtin++
}
else if (message == "This rock contains tin." || message == "There is no ore currently available in this rock."){
state = State.IDLE;
}
}
@Override
void onExit(){
Antibans = false
}
@Override
void onPaint(Graphics g) {
g.setColor(color1);
g.fillRect(1, 51, 209, 94);
g.setFont(font1);
g.setColor(color2);
g.drawString("JJH3OWNS' Powerminer", 7, 70);
g.setFont(font2);
g.drawString("Time: " + format(System.currentTimeMillis() - starttime), 7, 130);
g.drawString("tin: (${Minedtin})", 7, 80);
g.drawString("iron: (${Minediron})", 7, 90);
g.drawString("copper: (${Minedcopper})", 7, 100);
g.drawString("State: ${state}", 7, 115);
}
String format(final long time) {
final StringBuilder t = new StringBuilder();
final long total_secs = time / 1000;
final long total_mins = total_secs / 60;
final long total_hrs = total_mins / 60;
final int secs = (int) total_secs % 60;
final int mins = (int) total_mins % 60;
final int hrs = (int) total_hrs % 24;
if (hrs < 10) {
t.append("0");
}
t.append(hrs);
t.append(":");
if (mins < 10) {
t.append("0");
}
t.append(mins);
t.append(":");
if (secs < 10) {
t.append("0");
}
if (secs < 0){
t.append("0")
}
else{
t.append(secs);
}
return t.toString();
}
void antiban(){
while(Antibans){
if (state == State.MINING && Newantiban < System.currentTimeMillis()){
int Anti = random(0 , 3)
switch(Anti){
case 0:
log("Antiban: Move mouse")
moveMouseOutsideScreen()
Newantiban = System.currentTimeMillis() + random(40000, 120000)
break;
case 1:
log("Antiban: Move camera")
client.moveCameraToEntity(currentRock)
Newantiban = System.currentTimeMillis() + random(40000, 120000)
break;
case 2:
log("Antiban: Open Skills tab")
if (currentTab() != Tab.SKILLS){
openTab(Tab.SKILLS);
}
Newantiban = System.currentTimeMillis() + random(40000, 120000)
break;
case 3:
log("Antiban: Open Friends tab")
if (currentTab() != Tab.FRIENDS){
openTab(Tab.FRIENDS);
}
Newantiban = System.currentTimeMillis() + random(40000, 120000)
break;
}
}
Thread.sleep(1000)
}
}
}