Skip to content

Instantly share code, notes, and snippets.

@TheBatScripts
Created May 24, 2012 08:05
Show Gist options
  • Save TheBatScripts/2780128 to your computer and use it in GitHub Desktop.
Save TheBatScripts/2780128 to your computer and use it in GitHub Desktop.
BatNatureRunes
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import org.runedream.api.Script;
import org.runedream.api.ScriptManifest;
import org.runedream.api.methods.Bank;
import org.runedream.api.methods.Camera;
import org.runedream.api.methods.Game;
import org.runedream.api.methods.Inventory;
import org.runedream.api.methods.Mouse;
import org.runedream.api.methods.OCR;
import org.runedream.api.methods.Skills.Skill;
import org.runedream.api.methods.Tabs;
import org.runedream.api.util.Random;
import org.runedream.api.util.Time;
import org.runedream.api.wrappers.Menu;
import org.runedream.api.wrappers.Tab;
@ScriptManifest(
authors = { "TheBat"},
name = "BatNatureRunes",
version = 1.0,
description = "Crafts Natures by doing shit",
keywords = {},
language = { true, true, true, true })
public class BatNatureRunes extends Script implements MouseListener{
final private static Rectangle MINIMAP = new Rectangle(548,6,156,156);
final private static Rectangle VIEWPORT = new Rectangle(4,4,513,335);
final private static Rectangle INVENTORY = new Rectangle(550,207,183,253);
Rectangle hideR = new Rectangle(450,300,50,20);
//dtm for spirit graahk
Point[] SPIRIT_GR_DTM_PTS = { new Point( 580, 231), new Point( 582, 219), new Point( 589, 235), new Point( 575, 233)};
Color[] SPIRIT_GR_DTM_RGB = { new Color( 193, 111, 59), new Color( 193, 188, 167), new Color( 174, 169, 150), new Color( 195, 190, 168)};
DTemp dtmSpiritGraahk1 = new DTemp(SPIRIT_GR_DTM_PTS, SPIRIT_GR_DTM_RGB);
//dtm for ring of duelling
Point[] RING_OF_DUELLING_DTM_PTS = { new Point( 93, 112), new Point( 103, 109), new Point( 92, 103), new Point( 104, 101)};
Color[] RING_OF_DUELLING_DTM_RGB = { new Color( 192, 165, 27), new Color( 124, 107, 17), new Color( 111, 95, 15), new Color( 17, 121, 20)};
DTemp dtmRing1 = new DTemp(RING_OF_DUELLING_DTM_PTS, RING_OF_DUELLING_DTM_RGB);
//dtm for swords
Point[] SWORDS1_DTM_PTS = { new Point( 337, 158), new Point( 347, 155), new Point( 339, 170)};
Color[] SWORDS1_DTM_RGB = { new Color( 253, 250, 36), new Color( 253, 218, 36), new Color( 231, 229, 33)};
DTemp dtmSwords1 = new DTemp(SWORDS1_DTM_PTS, SWORDS1_DTM_RGB);
Point[] SWORDS2_DTM_PTS = { new Point( 330, 164), new Point( 331, 173), new Point( 341, 157)};
Color[] SWORDS2_DTM_RGB = { new Color( 247, 245, 36), new Color( 237, 235, 34), new Color( 220, 190, 32)};
DTemp dtmSwords2 = new DTemp(SWORDS2_DTM_PTS, SWORDS2_DTM_RGB);
//dtm for bank symbol
Point[] BANK_SYM_DTM_PTS = { new Point( 634, 86), new Point( 634, 94)};
Color[] BANK_SYM_DTM_RGB = { new Color( 239, 226, 172), new Color( 238, 210, 36)};
DTemp dtmBankSym1 = new DTemp(BANK_SYM_DTM_PTS, BANK_SYM_DTM_RGB);
//dtm for obelisk symbol
Point[] OBE_SYM_DTM_PTS = { new Point( 612, 87), new Point( 613, 81), new Point( 618, 86), new Point( 608, 86)};
Color[] OBE_SYM_DTM_RGB = { new Color( 225, 227, 225), new Color( 225, 227, 225), new Color( 192, 192, 192), new Color( 192, 192, 192)};
DTemp dtmObeSym1 = new DTemp(OBE_SYM_DTM_PTS, OBE_SYM_DTM_RGB);
//dtm for RC symbol
Point[] RC_DTM1_PTS = { new Point( 691, 97), new Point( 688, 94), new Point( 694, 101)};
Color[] RC_DTM1_RGB = { new Color( 246, 183, 1), new Color( 247, 16, 3), new Color( 246, 183, 1)};
DTemp dtmRCSym1 = new DTemp(RC_DTM1_PTS, RC_DTM1_RGB);
Point[] RC_DTM2_PTS = { new Point( 626, 75), new Point( 622, 65), new Point( 618, 73)};
Color[] RC_DTM2_RGB = { new Color( 247, 16, 3), new Color( 116, 100, 88), new Color( 42, 45, 36)};
DTemp dtmRCSym2 = new DTemp(RC_DTM2_PTS, RC_DTM2_RGB);
//dtm for Trans symbol
Point[] TRANS_SYM_DTM_PTS = { new Point( 613, 92), new Point( 608, 96), new Point( 620, 96)};
Color[] TRANS_SYM_DTM_RGB = { new Color( 233, 106, 24), new Color( 233, 106, 24), new Color( 233, 106, 24)};
DTemp dtmTransSym1 = new DTemp(TRANS_SYM_DTM_PTS, TRANS_SYM_DTM_RGB);
Point[] TRANS_SYM2_DTM_PTS = { new Point( 616, 85), new Point( 616, 95), new Point( 609, 90)};
Color[] TRANS_SYM2_DTM_RGB = { new Color( 233, 106, 24), new Color( 233, 106, 24), new Color( 233, 106, 24)};
DTemp dtmTransSym2 = new DTemp(TRANS_SYM2_DTM_PTS, TRANS_SYM2_DTM_RGB);
//dtm for ruins
Point[] RUINS_DTM_PTS = { new Point( 297, 230)};
Color[] RUINS_DTM_RGB = { new Color( 149, 253, 76)};
DTemp dtmRuins1 = new DTemp(RUINS_DTM_PTS, RUINS_DTM_RGB);
//dtm for obelisk
Point[] OBE_DTM_PTS = { new Point( 379, 124), new Point( 372, 137)};
Color[] OBE_DTM_RGB = { new Color( 206, 189, 114), new Color( 210, 192, 116)};
DTemp dtmObe1 = new DTemp(OBE_DTM_PTS, OBE_DTM_RGB);
//dtm for equippment
Point[] EQUIP_DTM_PTS = { new Point( 496, 330), new Point( 23, 11), new Point( 486, 20)};
Color[] EQUIP_DTM_RGB = { new Color( 147, 147, 147), new Color( 210, 210, 210), new Color( 252, 176, 44)};
DTemp dtmEquip = new DTemp(EQUIP_DTM_PTS, EQUIP_DTM_RGB);
//dtm for nature rune
Point[] NAT_DTM_PTS = { new Point( 701, 226), new Point( 706, 226), new Point( 703, 243), new Point( 692, 236), new Point( 716, 236)};
Color[] NAT_DTM_RGB = { new Color( 18, 127, 21), new Color( 18, 127, 21), new Color( 0, 0, 2), new Color( 0, 0, 2), new Color( 0, 0, 2)};
DTemp dtmNat1 = new DTemp(NAT_DTM_PTS, NAT_DTM_RGB);
//dtm for Pouches
Point[] MED_DTM_PTS = { new Point( 578, 224), new Point( 578, 219), new Point( 584, 240), new Point( 585, 229), new Point( 571, 239)};
Color[] MED_DTM_RGB = { new Color( 103, 102, 99), new Color( 43, 34, 19), new Color( 0, 0, 2), new Color( 0, 0, 2), new Color( 0, 0, 2)};
DTemp dtmMedPouch1 = new DTemp(MED_DTM_PTS, MED_DTM_RGB);
Point[] LARGE_DTM_PTS = { new Point( 621, 220), new Point( 621, 225), new Point( 621, 242), new Point( 631, 236), new Point( 611, 240)};
Color[] LARGE_DTM_RGB = { new Color( 40, 32, 17), new Color( 84, 83, 80), new Color( 0, 0, 2), new Color( 0, 0, 2), new Color( 0, 0, 2)};
DTemp dtmLargePouch1 = new DTemp(LARGE_DTM_PTS, LARGE_DTM_RGB);
Point[] GIANT_DTM_PTS = { new Point( 664, 218), new Point( 663, 224), new Point( 663, 244), new Point( 677, 236), new Point( 651, 242)};
Color[] GIANT_DTM_RGB = { new Color( 43, 34, 19), new Color( 101, 100, 97), new Color( 0, 0, 2), new Color( 0, 0, 2), new Color( 0, 0, 2)};
DTemp dtmGiantPouch1 = new DTemp(GIANT_DTM_PTS, GIANT_DTM_RGB);
private static long TIME = 0;
private String status = "Finding bank";
private boolean needNewRing = false, needNewPouch = false;
public static boolean stopAtOb = false;
public static boolean staminaFull = true;
public static int walkmod = 1;
private Menu menu;
private int remainingCharges = 0;
private SummoningChecker sumChk = new SummoningChecker();
private int crafted = 0;
private String version = "1.0";
private int exp = 9;
private boolean showPaint = true;
private int totUsed = 0;
private StaminaChecker staminaCheck = new StaminaChecker();
private int trys = 0;
private int startEXP = -1;
private int levelsGained = -1;
private int templvl = 200;
private boolean usePouches = false;
private static boolean rest = false;
public boolean onStart(){
sumChk.start();
staminaCheck .start();
status = "Getting start experience";
if(!Tabs.getOpenTab().equals(Tab.STATS)){
Mouse.click(597,187);
}
while(startEXP < 0){
try{
startEXP = Skill.RUNECRAFTING.getExperience();
}catch(Exception e){
startEXP = -1;
}
}
status = "Checking for equiped ring";
if(!Tabs.getOpenTab().equals(Tab.EQUIPMENT)){
Mouse.click(687,187);
}
Time.sleep(400);
if(!dtmRing1.findDTMS(20, INVENTORY)){
needNewRing = true;
}
status = "Finding bank";
Time.sleep(400);
if(!Tabs.getOpenTab().equals(Tab.INVENTORY)){
Mouse.click(660,185);
}
Game.clickCompass();
Camera.pitchUp(3000);
TIME = System.currentTimeMillis();
return true;
}
public void onStop(){
staminaCheck.interrupt();
sumChk.interrupt();
}
/**********************************************************************************/
/******************************* LOOP *********************************************/
/**********************************************************************************/
public int loop() {
Mouse.setSpeed(Random.random(2,6));
if(dtmEquip.findDTMS(20)){
Mouse.click(486,20);
}
try{
if(Integer.parseInt(OCR.findString(new Rectangle(735,103,25,18), null, true)) >= 50 && !checkColor(new Color(217,180,58), new Point(723,105), 10) && !rest){
Mouse.click(725,100);
}
}catch(Exception e){}
if(status.equals("Finding bank")){
if(trys >= 6){
trys = 0;
status = "Teleporting via ring";
return 100;
}
if(!Bank.isOpen()){
if(dtmSwords1.findDTMS(20, VIEWPORT)){
int i = Random.random(0,dtmSwords1.getList().size()-1);
Point bankPt = dtmSwords1.getDTM(i);
if(!Bank.isOpen()) Mouse.click(bankPt.x-35,bankPt.y);
Time.sleep(1000);
}else if(dtmSwords2.findDTMS(20, VIEWPORT)){
int i = Random.random(0,dtmSwords2.getList().size()-1);
Point bankPt = dtmSwords2.getDTM(i);
if(!Bank.isOpen())Mouse.click(bankPt.x-35,bankPt.y);
Time.sleep(1000);
}else if(dtmBankSym1.findDTMS(20, MINIMAP)){
int i = Random.random(0,dtmBankSym1.getList().size()-1);
Point SymPt = dtmBankSym1.getDTM(i);
Time.sleep(400);
if(!Bank.isOpen())Mouse.click(SymPt);
else {
status = "Banking";
return 100;
}
Time.sleep(3500);
}else{
trys ++;
}
}
if(Bank.isOpen()){
status = "Banking";
}
return 100;
}
if(status.equals("Banking")){
if(Bank.isOpen()){
if(usePouches)pouchDeposit();
else Bank.depositAll();
}
Time.sleep(600);
if(needNewRing){
if(dtmRing1.findDTMS(20, VIEWPORT)){
int i = Random.random(0,dtmRing1.getList().size()-1);
Point ringPt = dtmRing1.getDTM(i);
Mouse.click(ringPt);
}
int k = 0;
while(k <= 15 && !dtmRing1.findDTMS(20, Inventory.getSlotAt(0).getBounds())){
Time.sleep(100);
k++;
}
Time.sleep(800);
if(k < 15){
int i = Random.random(0,dtmRing1.getList().size()-1);
Point ringPt = dtmRing1.getDTM(i);
Mouse.click(ringPt,false);
Time.sleep(400);
Mouse.click(ringPt.x,ringPt.y+40);
needNewRing = false;
}
Time.sleep(500);
return 100;
}
if(needNewPouch){
if(dtmSpiritGraahk1.findDTMS(20, VIEWPORT)){
int i = Random.random(0,dtmSpiritGraahk1.getList().size()-1);
Point pouchPt = dtmSpiritGraahk1.getDTM(i);
Mouse.click(pouchPt);
}
int k = 0;
while(k <= 15 && !dtmSpiritGraahk1.findDTMS(20, Inventory.getSlotAt(0).getBounds())){
Time.sleep(100);
k++;
}
Time.sleep(800);
if(k < 15){
Mouse.click(489,30);
Time.sleep(800);
if(!Bank.isOpen()){
int i = Random.random(0,dtmSpiritGraahk1.getList().size()-1);
Point pouchPt = dtmSpiritGraahk1.getDTM(i);
Mouse.click(pouchPt,false);
Time.sleep(400);
Mouse.click(pouchPt.x,pouchPt.y+43);
status = "Finding bank";
needNewPouch = false;
}
}
Time.sleep(500);
return 100;
}
Mouse.move(55,110);
Time.sleep(500);
withdrawAll();
if(usePouches)fillPouches();
Time.sleep(500);
Mouse.click(489,30);
status = "Teleporting via Graahk";
return 100;
}
if(status.equals("Teleporting via Graahk")){
sumChk.interrupt();
Mouse.click(710,145,false);
Time.sleep(300);
try{
menu = Menu.find();
menu.getActions();
String [] lol = menu.getActionStrings();
boolean test = false;
for(int i = 0; i < lol.length; i++){
if(lol[i].contains("nterac")){
test = true;
break;
}
}
if(test)Menu.interact("nterac");
else{
needNewPouch = true;
status = "Finding bank";
return 100;
}
}catch(NullPointerException e){
needNewPouch = true;
status = "Finding bank";
return 100;
}
sumChk = new SummoningChecker();
sumChk.start();
Time.sleep(1000);
if(checkColor(new Color(11,17,19),new Point(26,351),20)) Mouse.click(255,434);
else return 100;
int k = 0;
while(k <= 30 && !dtmTransSym1.findDTMS(20, MINIMAP)){
Time.sleep(100);
k++;
}
status = "Running to ruins";
return 100;
}
if(status.equals("Running to ruins")){
Time.sleep(300);
if(stopAtOb){
int k = 0;
while(k <= 35 && !dtmObeSym1.findDTMS(20, MINIMAP)){
try{
if(Integer.parseInt(OCR.findString(new Rectangle(735,103,25,18), null, true)) >= 50 && !checkColor(new Color(217,180,58), new Point(723,105), 10) && !rest){
Mouse.click(725,100);
}
}catch(Exception e){}
if(rest){
Mouse.click(725,100,false);
Time.sleep(400);
Mouse.click(725,140);
Time.sleep(400);
try{
while(Integer.parseInt(OCR.findString(new Rectangle(735,103,25,18), null, true)) != 100){
Time.sleep(100);
}
}catch(Exception e){}
rest = false;
}
Time.sleep(2400);
Mouse.click(680,70);
k++;
}
if(k < 36){
Mouse.click(dtmObeSym1.getDTM(0));
k = 0;
while(k <= 50 && !dtmObe1.findDTMS(20, VIEWPORT)){
try{
if(Integer.parseInt(OCR.findString(new Rectangle(735,103,25,18), null, true)) >= 50 && !checkColor(new Color(217,180,58), new Point(723,105), 10) && !rest){
Mouse.click(725,100);
}
}catch(Exception e){}
if(rest){
Mouse.click(725,100,false);
Time.sleep(400);
Mouse.click(725,140);
Time.sleep(400);
try{
while(Integer.parseInt(OCR.findString(new Rectangle(735,103,25,18), null, true)) != 100){
Time.sleep(100);
}
}catch(Exception e){}
rest = false;
}
Time.sleep(100);
k++;
}
if(k < 50){
int temp1 = Integer.parseInt(OCR.findString(new Rectangle(721,141,20,14), null, true));
while(Integer.parseInt(OCR.findString(new Rectangle(721,141,20,14), null, true)) == temp1){
dtmObe1.findDTMS(20, VIEWPORT);
Mouse.click(dtmObe1.getDTM(0));
int temp2 = Integer.parseInt(OCR.findString(new Rectangle(721,141,20,14), null, true));
k = 0;
while(k <= 5 && Integer.parseInt(OCR.findString(new Rectangle(721,141,20,14), null, true)) == temp2){
Time.sleep(100);
}
if(k < 5){
stopAtOb = false;
return 100;
}
}
}
}
return 100;
}
int k = 0;
dtmRCSym1.getList().clear();
dtmRCSym2.getList().clear();
while(k <= 50 && !(dtmRCSym1.findDTMS(20, MINIMAP)||dtmRCSym2.findDTMS(20, MINIMAP))){
try{
if(Integer.parseInt(OCR.findString(new Rectangle(735,103,25,18), null, true)) >= 50 && !checkColor(new Color(217,180,58), new Point(723,105), 10) && !rest){
Mouse.click(725,100);
}
}catch(Exception e){}
if(rest){
Mouse.click(725,100,false);
Time.sleep(400);
Mouse.click(725,140);
Time.sleep(400);
try{
while(Integer.parseInt(OCR.findString(new Rectangle(735,103,25,18), null, true)) != 100){
Time.sleep(100);
}
}catch(Exception e){}
Mouse.click(725,100);
rest = false;
}
Time.sleep(600);
Mouse.click(690,80);
k++;
}
DTemp use;
if(dtmRCSym1.getList().size() > dtmRCSym2.getList().size())use = dtmRCSym1;
else use = dtmRCSym2;
if(k < 50){
Mouse.click(use.getDTM(0).x, use.getDTM(0).y + 15);
k = 0;
while(k <= 40 && !dtmRuins1.findDTMS(20, VIEWPORT)){
Time.sleep(100);
k++;
}
if(k <= 40){
Mouse.click(dtmRuins1.getDTM(0));
status = "Crafting runes";
}else{
if(dtmRCSym1.findDTMS(20, MINIMAP)){
Mouse.click(dtmRCSym1.getDTM(0));
}
}
}
return 100;
}
if(status.equals("Crafting runes")){
try{
if(!Tabs.getOpenTab().equals(Tab.INVENTORY)){
Mouse.click(660,185);
}
}catch(NullPointerException e){
if(dtmEquip.findDTMS(20)){
Mouse.click(486,20);
}
Mouse.click(660,185);
}
int k = 0;
while(k <= 70 && !(dtmTransSym1.findDTMS(20, MINIMAP)||dtmTransSym2.findDTMS(20, MINIMAP))){
Time.sleep(100);
k++;
}
if(k > 70){
status = "Running to ruins";
if(dtmRuins1.findDTMS(20, VIEWPORT)){
Mouse.click(dtmRuins1.getDTM(0));
status = "Crafting runes";
}
return 100;
}
if(usePouches)pouchCraft();
else Mouse.click(Random.random(240, 270),Random.random(4, 12));
k = 0;
while(k <= 30 && !dtmNat1.findDTMS(20, Inventory.getSlotAt(0).getBounds())){
Time.sleep(100);
k++;
}
try{
crafted += Integer.parseInt(OCR.findString(new Rectangle(558,208,29,16), null, true));
totUsed += 28;
}catch(Exception e){}
status = "Teleporting via ring";
return 100;
}
if(status.equals("Teleporting via ring")){
if(!Tabs.getOpenTab().equals(Tab.EQUIPMENT)){
Mouse.click(687,187);
}
Time.sleep(400);
Mouse.click(696,385,false);
Time.sleep(400);
menu = Menu.find();
menu.getActions();
String lol [] = menu.getActionStrings();
String getNum = "";
try{
getNum = lol [1];
}catch(ArrayIndexOutOfBoundsException e){
Mouse.click(687,187);
return 100;
}
try{
remainingCharges = Integer.parseInt(getNum.charAt(getNum.length()-1) + "");
}catch(StringIndexOutOfBoundsException e){
Mouse.click(696,385,false);
Time.sleep(400);
remainingCharges = Integer.parseInt(getNum.charAt(getNum.length()-1) + "");
}
if(remainingCharges == 1)needNewRing = true;
Menu.interact("Castle Wars");
Time.sleep(400);
if(!Tabs.getOpenTab().equals(Tab.INVENTORY)){
Mouse.click(660,185);
}
if(dtmEquip.findDTMS(20)){
Mouse.click(486,20);
}
int k = 0;
while(k <= 30 && !dtmBankSym1.findDTMS(20, MINIMAP)){
Time.sleep(100);
k++;
}
status = "Finding bank";
return 100;
}
return 100;
}
private void pouchDeposit() {
}
private void pouchCraft() {
}
private void fillPouches() {
}
/**********************************************************************************/
/******************************* END LOOP *****************************************/
/**********************************************************************************/
private void withdrawAll(){
Mouse.click(false);
Time.sleep(400);
Mouse.click(Mouse.getLocation().x, (Mouse.getLocation().y + Random.random(102,114)));
}
/**
* Returns whether the given point is a certain color.
* Accounts for the variable colors that runescape produces whenever you log in.
* @param col
* - Color to check for.
* @param p
* - Point to check at.
* @return
*/
private static boolean checkColor(Color col, Point p, int tol){
if(Math.abs(col.getRed() - Game.getColorAt(p).getRed()) < tol)
if(Math.abs(col.getGreen() - Game.getColorAt(p).getGreen()) < tol)
if(Math.abs(col.getBlue() - Game.getColorAt(p).getBlue()) < tol)
return true;
return false;
}
public void onRepaint(Graphics g){
final Color OPAQUE_BLACK = new Color(0, 0, 0, 180);
final Color GREEN = new Color(Color.GREEN.getRed(), Color.GREEN.getGreen(), Color.GREEN.getBlue(), 175).darker();
final int CUR_XP = startEXP + (exp * totUsed);
final int CUR_LVL = convertToLevel(CUR_XP);
if(templvl < CUR_LVL) levelsGained++;
templvl = CUR_LVL;
final double percentage = (double)(CUR_XP-expAtNextLevel(CUR_LVL-1))/(double)(getTotExpToNext(CUR_LVL));
if(showPaint){
g.setColor(new Color(0,0,0,175));
g.fill3DRect(1, 215, 515, 123, true);
g.setColor(Color.WHITE);
g.drawRect(hideR.x, hideR.y, hideR.width, hideR.height);
g.drawString("Hide",hideR.x+13,hideR.y+15);
int idx = 213;
g.drawString("Time Running: " + Time.toElapsedString(System.currentTimeMillis() - TIME), 5, idx+=20);
g.setColor(Color.GREEN);
g.drawString("BatNatureRunes", 270,idx);
g.setColor(Color.WHITE);
g.drawString("Bat", 270,idx);
g.drawString("TotalCrafted: " + crafted, 5, idx+=20);
g.drawString(" Version " + version, 270,idx);
try{
g.drawString("Crafted/Hour: " + (3600000*(long)crafted)/(System.currentTimeMillis() - TIME), 5, idx+=20);
g.drawString("Exp./Hour: " + (int)(exp *(3600000*(long)totUsed)/(System.currentTimeMillis() - TIME)), 5, idx+=20);
}catch(Exception e){}
g.drawString("Status: " + status, 5, idx+=20);
g.setColor(OPAQUE_BLACK);
g.fill3DRect(5, idx+=5, 270, 17, true);
g.setColor(GREEN);
g.fillRect(6, idx+1, (int) (268 * percentage), 15);
g.setColor(Color.WHITE);
try{
g.drawString("Current Level: " + CUR_LVL + "(+" + levelsGained + ") | " + (int)(100*percentage) +"% to " + (CUR_LVL+1) + " | TTL: " + Time.toElapsedString((System.currentTimeMillis() - TIME)*(expAtNextLevel(CUR_LVL) - CUR_XP)/(long)(exp *totUsed)),8,idx+=13);
}catch(Exception e){
g.drawString("Current Level: " + CUR_LVL + "(+" + levelsGained + ") | " + (int)(100*percentage) +"% to " + (CUR_LVL+1) + " | TTL: " + Time.toElapsedString(0),8,idx+=13);
}
}else{
g.setColor(Color.BLACK);
g.drawRect(hideR.x, hideR.y, hideR.width, hideR.height);
g.drawString("Show",hideR.x+10,hideR.y+15);
}
g.setColor(GREEN);
g.drawLine(Mouse.getLocation().x-1,0,Mouse.getLocation().x,2100);
g.drawLine(0,Mouse.getLocation().y-1,2100,Mouse.getLocation().y);
g.drawLine(Mouse.getLocation().x+1,0,Mouse.getLocation().x,2100);
g.drawLine(0,Mouse.getLocation().y+1,2100,Mouse.getLocation().y);
g.setColor(Color.WHITE);
g.drawLine(Mouse.getLocation().x,0,Mouse.getLocation().x,2100);
g.drawLine(0,Mouse.getLocation().y,2100,Mouse.getLocation().y);
}
private int expAtNextLevel(int CUR_LVL) {
if(CUR_LVL >1)return (int) (.25*(int)(CUR_LVL + 300.0 * Math.pow(2.0, (double)CUR_LVL/7.0)) + expAtNextLevel(--CUR_LVL));
return 0;
}
private int convertToLevel(int xp) {
double q = Math.pow(2, (double)(1.0/7.0));
double eq = ((q-1.0)/75.0) * xp + 1;
return (int)(7.0*((Math.log(eq))/(Math.log(2))));
}
private int getTotExpToNext(int level){
return (int)(((double)level/4.0) + 75.0 * Math.pow(2.0, (double)level/7.0));
}
class SummoningChecker extends Thread implements Runnable {
private Rectangle readIn = new Rectangle(721,141,20,14);
private int test = 300;
public SummoningChecker() {
this.setPriority(MIN_PRIORITY);
}
@Override
public void run() {
try{
while (!Thread.interrupted()) {
sleep(1000);
try{
test = Integer.parseInt(OCR.findString(readIn, null, true));
}catch(NumberFormatException e){
test = 300;
}
if (test <= 10){
BatNatureRunes.stopAtOb = true;
}
if(Thread.interrupted()) return;
}
} catch (InterruptedException e) {
} finally{}
}
}
class StaminaChecker extends Thread implements Runnable {
private Rectangle readIn = new Rectangle(735,103,25,18);
private int test = 300;
public StaminaChecker() {
this.setPriority(MIN_PRIORITY);
}
@Override
public void run() {
try{
while (!Thread.interrupted()) {
sleep(1000);
try{
test = Integer.parseInt(OCR.findString(readIn, null, true));
}catch(NumberFormatException e){
test = 300;
}
if (test <= 1){
BatNatureRunes.rest = true;
}
if(Thread.interrupted()) return;
}
} catch (InterruptedException e) {
} finally{}
}
}
public void mouseClicked(MouseEvent e){
if(hideR.contains(e.getPoint()))showPaint = !showPaint;
}
public void mouseEntered(MouseEvent arg0) {}
public void mouseExited(MouseEvent arg0) {}
public void mousePressed(MouseEvent arg0) {}
public void mouseReleased(MouseEvent arg0) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment