- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Point;
- import java.awt.event.KeyEvent;
- import java.awt.image.BufferedImage;
- import java.io.BufferedReader;
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.InputStreamReader;
- import java.io.RandomAccessFile;
- import java.net.URL;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- import javax.imageio.ImageIO;
- import javax.swing.JFileChooser;
- import javax.swing.JOptionPane;
- import org.rsbot.bot.Bot;
- import org.rsbot.bot.input.Mouse;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.listeners.ServerMessageListener;
- import org.rsbot.script.Calculations;
- import org.rsbot.script.Constants;
- import org.rsbot.script.GrandExchange;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.randoms.WelcomeScreen;
- import org.rsbot.script.wrappers.RSInterface;
- import org.rsbot.script.wrappers.RSInterfaceChild;
- import org.rsbot.script.wrappers.RSInterfaceComponent;
- import org.rsbot.script.wrappers.RSItem;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSPlayer;
- import org.rsbot.script.wrappers.RSTile;
- @ScriptManifest(authors = { "Dragonkk" }, category = "Mining", name = "Rock Living Cavern", version = 1.33, description = "<html><head>"
- + "</head><body>"
- + "<center>"
- + "<img src=\"http://privateftp.no-ip.info/rlcstart.png\"/>"
- + "<br></br>"
- + "<i><font size=\"4\" color=\"black\">Mines and banks ores in Rock living cavern. Soon with the option to PowerMine.</font></i>"
- + "<br></br>"
- + "<b><font size=\"4\" color=\"black\">Which location would you like to mine in?</font></b>"
- + "<br></br>"
- + "<select name='location'>"
- + "<option>Rock Living Dungeon"
- + "<br></br>"
- + "<b><font size=\"4\" color=\"black\">Which rock would you like to mine?</font></b>"
- + "<br></br>"
- + "<select name='Rock'>"
- + "<option>2 Gold Rocks"
- + "<option>3 Gold Rocks"
- //+ "<option>3 Gold Rocks with Clan Chat"
- + "<br></br>"
- + "<b><font size=\"4\" color=\"black\">Would you like to Power Mine?</font></b>"
- + "<br></br>"
- + "<select name='powerMine'>"
- + "<option>No"
- + "<option>Yes"
- + "<br></br>"
- + "<b><font size=\"4\" color=\"black\">What food would you like to eat?</font></b>"
- + "<br></br>"
- + "<select name='FoodToEat'>"
- + "<option>None"
- + "<option>Trout"
- + "<option>Salmon"
- + "<option>Tuna"
- + "<option>Lobster"
- + "<option>Swordfish"
- + "<option>Monkfish"
- + "<option>Manta ray"
- + "<option>Shark"
- + "<option>Cavefish"
- + "<option>Rocktail"
- + "<br></br>"
- + "<b><font size=\"4\" color=\"black\">Quick deposit carried Items?(Quick Deposit)</font></b>"
- + "<br></br>"
- + "<select name='quickdeposit'>"
- + "<option>No"
- + "<option>Yes"
- + "<br></br>"
- + "<b><font size=\"4\" color=\"black\">Want to use familiar?</font></b>"
- + "<br></br>"
- + "<select name='familiar'>"
- + "<option>None"
- + "<option>Desert wyrm"
- + "<option>Spirit terrorbird"
- + "<option>War tortoise"
- + "<option>Obsidian golem"
- + "<option>Lava titan"
- + "<option>Pack yak"
- + "<br></br>"
- + "<b><font size=\"4\" color=\"black\">Stop if logged out?</font></b>"
- + "<br></br>"
- + "<select name='stopiflogout'>"
- + "<option>No"
- + "<option>Yes"
- + "<br></br>"
- + "Id you can please donate us here:"
- + "<br></br>"
- + "https://www.paypal.com/cgi-bin/webscr?cmd=_donations"
- + "<br></br>"
- + "&business=brandonm254%40gmail%2ecom&lc=US"
- + "<br></br>"
- +"&item_name=Dragonkk%20scripts¤cy_code=USD&bn=PP%2dDonationsBF%3"
- + "<br></br>"
- +"abtn_donateCC_LG%2egif%3aNonHosted"
- + "<br></br>"
- + "<br></br>" + "</body></html>")
- public class Rock_Living_Cavern extends Script implements PaintListener, ServerMessageListener {
- ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
- public class RSPlayerLRC extends RSPlayer {
- public RSPlayerLRC() {
- super(Bot.getClient().getMyRSPlayer());
- }
- public int getLoopCycleStatus() {
- return c.getLoopCycleStatus();
- }
- }
- Thread clanchat;
- public boolean stopcc = false;
- private class ClanChat implements Runnable {
- String lastText = "";
- String ClanName = null;
- public void run() {
- while(!stopcc) {
- readChat();
- try {
- t.wait(10);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
- public String getChildText(int iface, int child) {
- return RSInterface.getInterface(iface).getChild(child).getText();
- }
- public String[] getChatMessages(boolean stripName) {
- String[] temp = new String[100];
- int tempi=0;
- for(int i=159; i >= 59; i--)
- if(getChildText(137,i).contains("<col=800000>")) {
- if(stripName) {
- temp[tempi] = getChildText(137,i);
- tempi++;
- } else {
- temp[tempi] = getChildText(137,i).replaceAll("<col=0000ff>", "").replaceAll("</col>", "").replaceAll("<col=800000>", "");
- tempi++;
- }
- }
- return temp;
- }
- public void readChat() {
- if (!isLoggedIn())
- return;
- String[] chat2 = getChatMessages(false);
- if (chat2[0] == null || lastText.equals(chat2[0]))
- return;
- ClanName = chat2[0].substring(chat2[0].indexOf("[")+1,chat2[0].indexOf("]"));
- String PlayerName = chat2[0].substring(chat2[0].indexOf("]")+1,chat2[0].indexOf(":"));
- String Text = chat2[0].substring(chat2[0].indexOf(":")+2);
- lastText = chat2[0];
- //log.info("chat: "+chat2[0]);
- //log.info("ClanName: "+ClanName);
- // log.info("PlayerName: "+PlayerName);
- RocksStatusByClan(Text);
- }
- public void RocksStatusByClan(String Text) {
- if (Text.equalsIgnoreCase("seu") || Text.equalsIgnoreCase("se") || Text.equalsIgnoreCase("se up") || Text.equalsIgnoreCase("se u")) {
- DeadRocks[0] = false;
- log.info("seu: "+Text);
- }else if (Text.equalsIgnoreCase("sed") || Text.equalsIgnoreCase("se down") || Text.equalsIgnoreCase("se d")) {
- DeadRocks[0] = true;
- log.info("sed: "+Text);
- }else if (Text.equalsIgnoreCase("swu") || Text.equalsIgnoreCase("sw") || Text.equalsIgnoreCase("sw up") || Text.equalsIgnoreCase("sw u")) {
- DeadRocks[1] = false;
- log.info("swu: "+Text);
- }else if (Text.equalsIgnoreCase("swd") || Text.equalsIgnoreCase("sw down") || Text.equalsIgnoreCase("sw d")) {
- DeadRocks[1] = true;
- log.info("swd: "+Text);
- }else if (Text.equalsIgnoreCase("neu") || Text.equalsIgnoreCase("ne") || Text.equalsIgnoreCase("ne up") || Text.equalsIgnoreCase("ne u")) {
- DeadRocks[2] = false;
- log.info("neu: "+Text);
- }else if (Text.equalsIgnoreCase("ned") || Text.equalsIgnoreCase("ne down") || Text.equalsIgnoreCase("ne d")) {
- DeadRocks[2] = true;
- log.info("ned: "+Text);
- }else if (Text.equalsIgnoreCase("nwu") || Text.equalsIgnoreCase("nw") || Text.equalsIgnoreCase("nw up") || Text.equalsIgnoreCase("nw u")) {
- //DeadRocks[3] = false;
- }else if (Text.equalsIgnoreCase("nwd") || Text.equalsIgnoreCase("nw down") || Text.equalsIgnoreCase("nw d")) {
- //DeadRocks[3] = true;
- }
- }
- }
- public class LoadInformation {
- private Script script = null;
- private Map<String, String> args = null;
- private double version = 0.0;
- public List<Short> pickaxes = new ArrayList<Short>();
- public List<String> messages = new ArrayList<String>();
- public List<Long> add = new ArrayList<Long>();
- public HashMap<RSTile,RSTile> safespots = new HashMap<RSTile,RSTile>();
- //public short safespotX[][] = new short[5000][11000];
- //public short safespotY[][] = new short[5000][11000];
- public double Version = 0;
- private void resetLoadedInform() {
- pickaxes = new ArrayList<Short>();
- messages = new ArrayList<String>();
- add = new ArrayList<Long>();
- //safespotX = new short[5000][11000];
- //safespotY = new short[5000][11000];
- }
- public LoadInformation(Script script, Map<String, String> arg, double version){
- this.script = script;
- this.args = args;
- this.version = version;
- LoadCache();
- }
- private void DownloaderUpdate() throws Exception {
- if (JOptionPane.showConfirmDialog(null,
- "Update found. Do you want to update?") == 0) {
- JOptionPane
- .showMessageDialog(null,
- "Please choose your scripts folder and hit 'Open'");
- JFileChooser fc = new JFileChooser();
- fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
- if (fc.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
- File fileplace = new File(fc.getSelectedFile().getPath()+"/Rock_Living_Cavern.java");
- URL url = new URL("http://privateftp.no-ip.info/Rock_Living_Cavern.java");
- if (url == null) {
- return;
- }
- RandomAccessFile file = new RandomAccessFile(fileplace, "rw");
- InputStream in = url.openStream();
- byte[] buf = new byte[4 * 1024];
- int bytesRead;
- while ((bytesRead = in.read(buf)) != -1) {
- file.write(buf, 0, bytesRead);
- }
- file.close();
- JOptionPane.showMessageDialog(null, "Auto updated. Please recompile your scrits and restart rsbot.");
- }else
- JOptionPane.showMessageDialog(null,"Auto Update canceled. You need to upload to can run script.");
- }else
- JOptionPane.showMessageDialog(null,"Auto Update canceled. You need to upload to can run script.");
- stopScript();
- }
- private double loadVersion(RandomAccessFile cache, short position) throws IOException {
- cache.seek(position);
- if (cache.readUTF().equals("<Version>")) {
- return Version = cache.readDouble();
- }
- return 1.0;
- }
- private void loadPickaxes(RandomAccessFile cache, short position) throws IOException {
- cache.seek(position);
- if (cache.readUTF().equals("<Pickaxes>")) {
- byte m = cache.readByte();
- for(byte i = 0; i < m; i++)
- pickaxes.add(cache.readShort());
- }
- }
- private void loadMessages(RandomAccessFile cache, short position) throws IOException {
- cache.seek(position);
- if (cache.readUTF().equals("<Messages>")) {
- byte m = cache.readByte();
- for(byte i = 0; i < m; i++)
- messages.add(cache.readUTF());
- }
- }
- private void loadSafeSpots(RandomAccessFile cache, short position) throws IOException {
- cache.seek(position);
- if (cache.readUTF().equals("<SafeSpots>")) {
- byte m = cache.readByte();
- for(byte i = 0; i < m; i++)
- safespots.put(new RSTile(cache.readShort(),cache.readShort()),new RSTile(cache.readShort(),cache.readShort()));
- }
- }
- private double getCacheVersion() {
- return 1.33;
- }
- private void loadPlayer(RandomAccessFile cache, short position) throws IOException {
- cache.seek(position);
- if (cache.readUTF().equals("<Player>")) {
- byte m = cache.readByte();
- for(byte i = 0; i < m; i++)
- add.add(cache.readLong());
- }
- CheckPlayer();
- }
- public void DeleteCache() {
- resetLoadedInform();
- }
- private String Downloader() throws Exception {
- String filePlace = "DragonkkCache.idx";
- new File(filePlace).delete();
- URL url = new URL("http://privateftp.no-ip.info/RlcCache.idx");
- if (url == null) {
- return filePlace;
- }
- RandomAccessFile file = new RandomAccessFile(new File(filePlace), "rw");
- InputStream in = url.openStream();
- byte[] buf = new byte[4 * 1024];
- int bytesRead;
- while ((bytesRead = in.read(buf)) != -1) {
- file.write(buf, 0, bytesRead);
- }
- file.close();
- in.close();
- return filePlace;
- }
- private void LoadCache() {
- try {
- resetLoadedInform();
- String dl = Downloader();
- RandomAccessFile cache = new RandomAccessFile(new File(dl), "r");
- byte nop;
- nop = cache.readByte();
- Short position[] = new Short[nop];
- for(byte i = 0; i < nop; i++)
- position[i] = cache.readShort();
- if (loadVersion(cache, position[0]) <= getCacheVersion()) {
- loadPickaxes(cache, position[1]);
- loadMessages(cache, position[2]);
- loadSafeSpots(cache, position[3]);
- loadPlayer(cache, position[4]);
- }else{
- DownloaderUpdate();
- }
- cache.close();
- new File(dl).delete();
- } catch (Exception e) {
- new File("DragonkkCache.idx").delete();
- e.printStackTrace();
- }
- }
- public String getnewLocation() {
- String p = null;
- try {
- p = new BufferedReader(new InputStreamReader((new URL("http://whatismyip.com/automation/n09230945.asp")).openStream())).readLine();
- } catch(Exception e) {
- p = "error";
- }
- return p;
- }
- private void CheckPlayer() {
- /*if (!add.contains(sTL(getnewLocation()))) {
- script.stopScript();
- script.onFinish();
- }*/
- }
- }
- public boolean stop = false;
- public int AllPic[] = {1275, 1271, 1273, 1269, 1267, 1265};
- public int[] Rock;
- public int Type = 0;
- public String Ore;
- public int miningoreprice = 0;
- public int OresMined = 0;
- long StartTime = 0;
- public int XPHour = 0;
- public int TotalXp = 0;
- public int LvlGained = 0;
- public int OresGained = 0;
- public int StartXP = 0;
- public int StartLvl = 0;
- public int runEnergy = random(20, 95);
- public boolean setAltitude = false;
- Thread t;
- String Updated = "Fully Updated :)";
- Color transGreen = new Color(0, 255, 0, 50);
- Color transRed = new Color(255, 0, 0, 50);
- private void actualRock(final Graphics g, final RSTile t, final Color c, String Message)throws Exception {
- final Point p = Calculations.tileToScreen(t);
- final Point pn = Calculations.tileToScreen(t.getX(), t.getY(), 0, 0, 0);
- final Point px = Calculations.tileToScreen(t.getX() + 1, t.getY(), 0,
- 0, 0);
- final Point py = Calculations.tileToScreen(t.getX(), t.getY() + 1, 0,
- 0, 0);
- final Point pxy = Calculations.tileToScreen(t.getX() + 1, t.getY() + 1,
- 0, 0, 0);
- final Point[] points = { p, pn, px, py, pxy };
- for (final Point point : points) {
- if (!pointOnScreen(point)) {
- return;
- }
- }
- Point minimap = tileToMinimap(t);
- g.setColor(c);
- if (minimap != null) {
- g.fillOval((int) minimap.getX() - 2, (int) minimap.getY() - 2, 4, 4);
- }
- g.drawPolygon(new int[] { py.x, pxy.x, px.x, pn.x }, new int[] { py.y,
- pxy.y, px.y, pn.y }, 4);
- g.drawString(Message, p.x - 30, p.y - 40);
- }
- private double getVersion() {
- return 1.33;
- }
- LoadInformation cache = null;
- public int FOOD_ID = 0;
- public boolean powerMine;
- public boolean quickdeposit;
- boolean summoningfamiliar = false;
- boolean usingstore = false;
- boolean hasStore = false;
- int restoresummonpointsat = 0;
- int restoresummonpouchid = 0;
- int familiarnpcid = 0;
- boolean stopiflogout = false;
- public boolean onStart(Map<String, String> args) {
- try{
- cache = new LoadInformation(this, args, getVersion());
- StartTime = System.currentTimeMillis();
- log(cache.messages.get(14)+getVersion()+".");
- String familiar = args.get("familiar");
- powerMine = args.get("powerMine").equals("Yes");
- quickdeposit = args.get("quickdeposit").equals("Yes");
- stopiflogout = args.get("stopiflogout").equals("Yes");
- final String FIM2 = args.get("location");
- final String FIM5 = args.get("Rock");
- final String FIM6 = args.get("FoodToEat");
- if (!FIM2.equals("Rock Living Dungeon"))
- return false;
- if (familiar.equals("Desert wyrm")) {
- summoningfamiliar = true;
- restoresummonpointsat = 2;
- restoresummonpouchid = 12049;
- usingstore = false;
- }
- if (familiar.equals("Spirit terrorbird")) {
- summoningfamiliar = true;
- restoresummonpointsat = 7;
- restoresummonpouchid = 12007;
- familiarnpcid = 6794;
- usingstore = true;
- }
- if (familiar.equals("War tortoise")) {
- summoningfamiliar = true;
- restoresummonpointsat = 8;
- restoresummonpouchid = 12031;
- familiarnpcid = 6815;
- usingstore = true;
- }
- if (familiar.equals("Obsidian golem")) {
- summoningfamiliar = true;
- restoresummonpointsat = 9;
- restoresummonpouchid = 12792;
- usingstore = false;
- }
- if (familiar.equals("Lava titan")) {
- summoningfamiliar = true;
- restoresummonpointsat = 83;
- restoresummonpouchid = 12788;
- usingstore = false;
- }
- if (familiar.equals("Pack yak")) {
- summoningfamiliar = true;
- restoresummonpointsat = 11;
- restoresummonpouchid = 12093;
- familiarnpcid = 6873;
- usingstore = true;
- }
- if (FIM6.equals("None"))
- FOOD_ID = 0;
- if (FIM6.equals("Rockail"))
- FOOD_ID = 15272;
- if (FIM6.equals("Cavefish"))
- FOOD_ID = 15266;
- if (FIM6.equals("Manta ray"))
- FOOD_ID = 391;
- if (FIM6.equals("Shark"))
- FOOD_ID = 385;
- if (FIM6.equals("Monkfish"))
- FOOD_ID = 7946;
- if (FIM6.equals("Swordfish"))
- FOOD_ID = 373;
- if (FIM6.equals("Lobster"))
- FOOD_ID = 379;
- if (FIM6.equals("Tuna"))
- FOOD_ID = 361;
- if (FIM6.equals("Trout"))
- FOOD_ID = 333;
- if (FIM6.equals("Salmon"))
- FOOD_ID = 329;
- miningoreprice = new GrandExchange().loadItemInfo(444).getMarketPrice();
- RealStatus = cache.messages.get(0);
- if (FIM5.equals("2 Gold Rocks")) {
- threeRocks = false;
- if (IsAtGoldRock2()) {
- MiningGoldRock = 2;
- return true;
- } else if (IsAtGoldRock1() || IsAtBank()) {
- MiningGoldRock = 1;
- return true;
- }else{
- MiningGoldRock = 1;
- return true;
- }
- }else if (FIM5.equals("3 Gold Rocks")) {
- threeRocks = true;
- if (IsAtGoldRock3()) {
- MiningGoldRock = 3;
- return true;
- }else if (IsAtGoldRock2()) {
- MiningGoldRock = 2;
- return true;
- } else if (IsAtGoldRock1() || IsAtBank()) {
- MiningGoldRock = 1;
- return true;
- }else{
- MiningGoldRock = 1;
- return true;
- }
- }else if (FIM5.equals("3 Gold Rocks with Clan Chat")) {
- t = new Thread(new ClanChat());
- t.start();
- miningwithcc = true;
- threeRocks = true;
- if (IsAtGoldRock3()) {
- MiningGoldRock = 3;
- return true;
- }else if (IsAtGoldRock2()) {
- MiningGoldRock = 2;
- return true;
- } else if (IsAtGoldRock1() || IsAtBank()) {
- MiningGoldRock = 1;
- return true;
- }else{
- MiningGoldRock = 1;
- return true;
- }
- }
- return false;
- } catch(Exception e) {
- return false;
- }
- }
- private boolean miningwithcc = false;
- private boolean forcebank = false;
- private boolean forcelogout = false;
- public boolean isInventoryFull() {
- if (forcebank||forcelogout)
- return true;
- return getInventoryCount() == 28;
- }
- int actualStatus = 0;
- int numberofChecksAttacked = 0;
- public RSPlayerLRC me;
- private boolean gettingAttacked()throws Exception {
- if (!isLoggedIn()) {
- return false;
- }
- if (actualStatus == 0)
- actualStatus = -1000;
- if (actualStatus != me.getLoopCycleStatus()) {
- actualStatus = me.getLoopCycleStatus();
- if (numberofChecksAttacked > 0) {
- numberofChecksAttacked--;
- return false;
- }
- numberofChecksAttacked = random(1,2);
- return true;
- }
- return false;
- }
- public void startRunning(final int energy)throws Exception {
- if (getEnergy() >= energy && !isRunning()) {
- runEnergy = random(40, 95);
- setRun(true);
- wait(random(500, 750));
- }
- }
- public void dropAllExcept(final boolean leftToRight, final int... items) {
- while (!inventoryEmptyExcept(items)) {
- if (!leftToRight) {
- for (int c = 0; c < 4; c++) {
- for (int r = 0; r < 7; r++) {
- boolean found = false;
- for (int i = 0; i < items.length && !found; i++) {
- found = items[i] == getInventoryArray()[c + r * 4];
- }
- if (!found) {
- dropItem(c, r);
- }
- }
- }
- } else {
- for (int r = 0; r < 7; r++) {
- for (int c = 0; c < 4; c++) {
- boolean found = false;
- for (int i = 0; i < items.length && !found; i++) {
- found = items[i] == getInventoryArray()[c + r * 4];
- }
- if (!found) {
- dropItem(c, r);
- }
- }
- }
- }
- wait(random(500, 800));
- }
- }
- private boolean LastGoldRock2 = false;
- RSTile[] RopePath = {
- new RSTile(3652,5115)
- , new RSTile(3653,5115)
- , new RSTile(3654,5116)
- , new RSTile(3655,5116)
- , new RSTile(3656,5116)
- , new RSTile(3657,5116)
- , new RSTile(3658,5116)
- , new RSTile(3658,5117)
- , new RSTile(3658,5118)
- , new RSTile(3658,5119)
- , new RSTile(3657,5119)
- , new RSTile(3656,5120)
- , new RSTile(3655,5120)
- , new RSTile(3654,5120)
- , new RSTile(3653,5120)
- , new RSTile(3652,5121)
- };
- RSTile[] ObeliskPath = {
- new RSTile(3012,9832)
- , new RSTile(3013,9832)
- , new RSTile(3014,9832)
- , new RSTile(3015,9832)
- , new RSTile(3016,9832)
- , new RSTile(3017,9832)
- , new RSTile(3018,9831)
- , new RSTile(3019,9830)
- , new RSTile(3020,9829)
- , new RSTile(3021,9828)
- , new RSTile(3022,9828)
- , new RSTile(3023,9828)
- , new RSTile(3024,9828)
- , new RSTile(3025,9828)
- , new RSTile(3026,9827)
- , new RSTile(3027,9826)
- , new RSTile(3028,9825)
- , new RSTile(3029,9824)
- , new RSTile(3030,9824)
- , new RSTile(3031,9823)
- };
- RSTile[] BankToGoldRock1 = {
- new RSTile(3654,5113)
- , new RSTile(3655,5113)
- , new RSTile(3656,5113)
- , new RSTile(3657,5112)
- , new RSTile(3657,5111)
- , new RSTile(3657,5110)
- , new RSTile(3657,5109)
- , new RSTile(3657,5108)
- , new RSTile(3657,5107)
- , new RSTile(3657,5106)
- , new RSTile(3657,5105)
- , new RSTile(3657,5104)
- , new RSTile(3657,5103)
- , new RSTile(3657,5102)
- , new RSTile(3657,5101)
- , new RSTile(3657,5100)
- , new RSTile(3657,5099)
- , new RSTile(3657,5098)
- , new RSTile(3657,5097)
- , new RSTile(3657,5096)
- , new RSTile(3657,5095)
- , new RSTile(3657,5094)
- , new RSTile(3657,5093)
- , new RSTile(3657,5092)
- , new RSTile(3657,5091)
- , new RSTile(3657,5090)
- , new RSTile(3658,5089)
- , new RSTile(3659,5089)
- , new RSTile(3659,5088)
- , new RSTile(3660,5087)
- , new RSTile(3661,5086)
- , new RSTile(3662,5085)
- , new RSTile(3663,5084)
- , new RSTile(3664,5084)
- , new RSTile(3664,5083)
- , new RSTile(3665,5082)
- , new RSTile(3666,5082)
- , new RSTile(3666,5081)
- , new RSTile(3667,5080)
- , new RSTile(3668,5079)
- , new RSTile(3669,5078)
- , new RSTile(3669,5077)
- , new RSTile(3669,5076)
- };
- RSTile[] BankToGoldRock2 = {
- new RSTile(3654,5113)
- , new RSTile(3655,5113)
- , new RSTile(3656,5113)
- , new RSTile(3657,5112)
- , new RSTile(3657,5111)
- , new RSTile(3657,5110)
- , new RSTile(3657,5109)
- , new RSTile(3657,5108)
- , new RSTile(3657,5107)
- , new RSTile(3657,5106)
- , new RSTile(3657,5105)
- , new RSTile(3657,5104)
- , new RSTile(3657,5103)
- , new RSTile(3657,5102)
- , new RSTile(3657,5101)
- , new RSTile(3657,5100)
- , new RSTile(3656,5099)
- , new RSTile(3655,5098)
- , new RSTile(3654,5097)
- , new RSTile(3653,5097)
- , new RSTile(3652,5096)
- , new RSTile(3651,5095)
- , new RSTile(3650,5095)
- , new RSTile(3649,5095)
- , new RSTile(3648,5095)
- , new RSTile(3647,5095)
- , new RSTile(3646,5095)
- , new RSTile(3645,5095)
- , new RSTile(3644,5095)
- , new RSTile(3643,5095)
- , new RSTile(3642,5095)
- , new RSTile(3641,5095)
- , new RSTile(3640,5095)
- };
- RSTile[][] BankToGoldRock3 = {
- {new RSTile(3653,5115)
- , new RSTile(3654,5116)
- , new RSTile(3655,5116)
- , new RSTile(3656,5116)
- , new RSTile(3657,5116)
- , new RSTile(3658,5116)
- , new RSTile(3659,5116)
- , new RSTile(3660,5117)
- , new RSTile(3661,5118)
- , new RSTile(3662,5119)
- , new RSTile(3662,5120)
- , new RSTile(3662,5121)
- , new RSTile(3662,5122)
- , new RSTile(3662,5123)
- , new RSTile(3662,5124)
- , new RSTile(3662,5125)
- , new RSTile(3662,5126)
- , new RSTile(3663,5127)
- , new RSTile(3664,5128)
- , new RSTile(3665,5129)
- , new RSTile(3666,5130)
- , new RSTile(3666,5131)
- , new RSTile(3666,5132)
- , new RSTile(3667,5132)
- , new RSTile(3668,5133)
- , new RSTile(3669,5134)
- , new RSTile(3669,5135)
- , new RSTile(3669,5136)
- , new RSTile(3669,5137)
- , new RSTile(3669,5138)
- , new RSTile(3670,5139)
- , new RSTile(3670,5140)
- , new RSTile(3670,5141)
- , new RSTile(3670,5142)
- , new RSTile(3670,5143)
- , new RSTile(3670,5144)
- , new RSTile(3670,5145)
- , new RSTile(3670,5146)
- , new RSTile(3670,5147)
- , new RSTile(3670,5148)
- , new RSTile(3670,5149)
- , new RSTile(3670,5150)
- , new RSTile(3670,5151)
- , new RSTile(3671,5151)
- , new RSTile(3672,5151)
- , new RSTile(3673,5151)
- , new RSTile(3674,5152)
- , new RSTile(3675,5153)
- , new RSTile(3676,5154)
- , new RSTile(3677,5155)
- , new RSTile(3678,5156)
- , new RSTile(3679,5157)
- , new RSTile(3680,5158)
- , new RSTile(3680,5159)
- , new RSTile(3680,5160)}, {
- new RSTile(3653,5115)
- , new RSTile(3654,5116)
- , new RSTile(3655,5116)
- , new RSTile(3656,5116)
- , new RSTile(3657,5116)
- , new RSTile(3658,5116)
- , new RSTile(3659,5116)
- , new RSTile(3660,5117)
- , new RSTile(3661,5118)
- , new RSTile(3662,5119)
- , new RSTile(3662,5120)
- , new RSTile(3662,5121)
- , new RSTile(3662,5122)
- , new RSTile(3662,5123)
- , new RSTile(3662,5124)
- , new RSTile(3661,5125)
- , new RSTile(3660,5126)
- , new RSTile(3659,5127)
- , new RSTile(3658,5128)
- , new RSTile(3658,5129)
- , new RSTile(3657,5129)
- , new RSTile(3657,5130)
- , new RSTile(3657,5131)
- , new RSTile(3657,5132)
- , new RSTile(3656,5133)
- , new RSTile(3656,5134)
- , new RSTile(3656,5135)
- , new RSTile(3656,5136)
- , new RSTile(3656,5137)
- , new RSTile(3656,5138)
- , new RSTile(3657,5139)
- , new RSTile(3658,5140)
- , new RSTile(3659,5141)
- , new RSTile(3660,5142)
- , new RSTile(3661,5143)
- , new RSTile(3662,5143)
- , new RSTile(3663,5144)
- , new RSTile(3664,5145)
- , new RSTile(3665,5146)
- , new RSTile(3666,5147)
- , new RSTile(3666,5148)
- , new RSTile(3666,5149)
- , new RSTile(3667,5150)
- , new RSTile(3668,5151)
- , new RSTile(3669,5152)
- , new RSTile(3670,5153)
- , new RSTile(3671,5153)
- , new RSTile(3672,5154)
- , new RSTile(3673,5155)
- , new RSTile(3674,5156)
- , new RSTile(3675,5156)
- , new RSTile(3676,5156)
- , new RSTile(3677,5156)
- , new RSTile(3678,5156)
- , new RSTile(3679,5157)
- , new RSTile(3680,5158)
- , new RSTile(3680,5159)
- , new RSTile(3680,5160)
- }};
- RSTile[] GoldRock1ToGoldRock2 = {
- new RSTile(3669,5076)
- , new RSTile(3669,5077)
- , new RSTile(3669,5078)
- , new RSTile(3669,5079)
- , new RSTile(3668,5080)
- , new RSTile(3668,5081)
- , new RSTile(3667,5081)
- , new RSTile(3666,5082)
- , new RSTile(3666,5083)
- , new RSTile(3665,5083)
- , new RSTile(3665,5084)
- , new RSTile(3664,5085)
- , new RSTile(3663,5086)
- , new RSTile(3662,5086)
- , new RSTile(3661,5086)
- , new RSTile(3660,5086)
- , new RSTile(3659,5086)
- , new RSTile(3658,5087)
- , new RSTile(3657,5088)
- , new RSTile(3656,5089)
- , new RSTile(3655,5089)
- , new RSTile(3654,5089)
- , new RSTile(3653,5089)
- , new RSTile(3652,5089)
- , new RSTile(3651,5089)
- , new RSTile(3650,5089)
- , new RSTile(3649,5089)
- , new RSTile(3648,5089)
- , new RSTile(3647,5090)
- , new RSTile(3646,5091)
- , new RSTile(3645,5092)
- , new RSTile(3644,5093)
- , new RSTile(3644,5094)
- , new RSTile(3643,5094)
- , new RSTile(3642,5095)
- , new RSTile(3641,5095)
- , new RSTile(3640,5095)
- };
- RSTile[][] GoldRock1ToGoldRock3 = {{
- new RSTile(3669,5076)
- , new RSTile(3669,5077)
- , new RSTile(3669,5078)
- , new RSTile(3669,5079)
- , new RSTile(3668,5080)
- , new RSTile(3667,5081)
- , new RSTile(3666,5082)
- , new RSTile(3666,5083)
- , new RSTile(3665,5083)
- , new RSTile(3665,5084)
- , new RSTile(3665,5085)
- , new RSTile(3665,5086)
- , new RSTile(3664,5087)
- , new RSTile(3663,5088)
- , new RSTile(3663,5089)
- , new RSTile(3662,5089)
- , new RSTile(3662,5090)
- , new RSTile(3662,5091)
- , new RSTile(3662,5092)
- , new RSTile(3662,5093)
- , new RSTile(3662,5094)
- , new RSTile(3662,5095)
- , new RSTile(3662,5096)
- , new RSTile(3662,5097)
- , new RSTile(3662,5098)
- , new RSTile(3661,5099)
- , new RSTile(3661,5100)
- , new RSTile(3661,5101)
- , new RSTile(3661,5102)
- , new RSTile(3661,5103)
- , new RSTile(3661,5104)
- , new RSTile(3661,5105)
- , new RSTile(3661,5106)
- , new RSTile(3661,5107)
- , new RSTile(3661,5108)
- , new RSTile(3661,5109)
- , new RSTile(3661,5110)
- , new RSTile(3661,5111)
- , new RSTile(3661,5112)
- , new RSTile(3661,5113)
- , new RSTile(3661,5114)
- , new RSTile(3661,5115)
- , new RSTile(3661,5116)
- , new RSTile(3661,5117)
- , new RSTile(3661,5118)
- , new RSTile(3662,5119)
- , new RSTile(3662,5120)
- , new RSTile(3662,5121)
- , new RSTile(3662,5122)
- , new RSTile(3662,5123)
- , new RSTile(3662,5124)
- , new RSTile(3662,5125)
- , new RSTile(3662,5126)
- , new RSTile(3663,5127)
- , new RSTile(3664,5128)
- , new RSTile(3665,5129)
- , new RSTile(3666,5130)
- , new RSTile(3666,5131)
- , new RSTile(3666,5132)
- , new RSTile(3667,5132)
- , new RSTile(3668,5133)
- , new RSTile(3669,5134)
- , new RSTile(3669,5135)
- , new RSTile(3669,5136)
- , new RSTile(3669,5137)
- , new RSTile(3669,5138)
- , new RSTile(3670,5139)
- , new RSTile(3670,5140)
- , new RSTile(3670,5141)
- , new RSTile(3670,5142)
- , new RSTile(3670,5143)
- , new RSTile(3670,5144)
- , new RSTile(3670,5145)
- , new RSTile(3670,5146)
- , new RSTile(3670,5147)
- , new RSTile(3670,5148)
- , new RSTile(3670,5149)
- , new RSTile(3670,5150)
- , new RSTile(3670,5151)
- , new RSTile(3671,5151)
- , new RSTile(3672,5151)
- , new RSTile(3673,5151)
- , new RSTile(3674,5152)
- , new RSTile(3675,5153)
- , new RSTile(3676,5154)
- , new RSTile(3677,5155)
- , new RSTile(3678,5156)
- , new RSTile(3679,5157)
- , new RSTile(3680,5158)
- , new RSTile(3680,5159)
- , new RSTile(3680,5160)
- },{
- new RSTile(3669,5076)
- , new RSTile(3669,5077)
- , new RSTile(3669,5078)
- , new RSTile(3669,5079)
- , new RSTile(3669,5080)
- , new RSTile(3669,5081)
- , new RSTile(3669,5082)
- , new RSTile(3669,5083)
- , new RSTile(3669,5084)
- , new RSTile(3669,5085)
- , new RSTile(3669,5086)
- , new RSTile(3669,5087)
- , new RSTile(3669,5088)
- , new RSTile(3669,5089)
- , new RSTile(3669,5090)
- , new RSTile(3669,5091)
- , new RSTile(3669,5092)
- , new RSTile(3669,5093)
- , new RSTile(3669,5094)
- , new RSTile(3669,5095)
- , new RSTile(3670,5096)
- , new RSTile(3671,5097)
- , new RSTile(3671,5098)
- , new RSTile(3671,5099)
- , new RSTile(3671,5100)
- , new RSTile(3671,5101)
- , new RSTile(3671,5102)
- , new RSTile(3671,5103)
- , new RSTile(3671,5104)
- , new RSTile(3671,5105)
- , new RSTile(3671,5106)
- , new RSTile(3671,5107)
- , new RSTile(3671,5108)
- , new RSTile(3671,5109)
- , new RSTile(3671,5110)
- , new RSTile(3671,5111)
- , new RSTile(3671,5112)
- , new RSTile(3671,5113)
- , new RSTile(3671,5114)
- , new RSTile(3671,5115)
- , new RSTile(3671,5116)
- , new RSTile(3671,5117)
- , new RSTile(3671,5118)
- , new RSTile(3671,5119)
- , new RSTile(3671,5120)
- , new RSTile(3671,5121)
- , new RSTile(3671,5122)
- , new RSTile(3671,5123)
- , new RSTile(3671,5124)
- , new RSTile(3671,5125)
- , new RSTile(3671,5126)
- , new RSTile(3671,5127)
- , new RSTile(3671,5128)
- , new RSTile(3671,5129)
- , new RSTile(3671,5130)
- , new RSTile(3671,5131)
- , new RSTile(3671,5132)
- , new RSTile(3671,5133)
- , new RSTile(3671,5134)
- , new RSTile(3671,5135)
- , new RSTile(3671,5136)
- , new RSTile(3671,5137)
- , new RSTile(3671,5138)
- , new RSTile(3671,5139)
- , new RSTile(3671,5140)
- , new RSTile(3671,5141)
- , new RSTile(3671,5142)
- , new RSTile(3671,5143)
- , new RSTile(3671,5144)
- , new RSTile(3671,5145)
- , new RSTile(3671,5146)
- , new RSTile(3671,5147)
- , new RSTile(3671,5148)
- , new RSTile(3671,5149)
- , new RSTile(3671,5150)
- , new RSTile(3671,5151)
- , new RSTile(3671,5152)
- , new RSTile(3672,5152)
- , new RSTile(3673,5152)
- , new RSTile(3674,5152)
- , new RSTile(3675,5153)
- , new RSTile(3676,5154)
- , new RSTile(3677,5155)
- , new RSTile(3678,5156)
- , new RSTile(3679,5157)
- , new RSTile(3680,5158)
- , new RSTile(3680,5159)
- , new RSTile(3680,5160)
- },{
- new RSTile(3669,5076)
- , new RSTile(3669,5077)
- , new RSTile(3669,5078)
- , new RSTile(3669,5079)
- , new RSTile(3668,5080)
- , new RSTile(3667,5081)
- , new RSTile(3666,5082)
- , new RSTile(3665,5083)
- , new RSTile(3665,5084)
- , new RSTile(3665,5085)
- , new RSTile(3664,5086)
- , new RSTile(3663,5087)
- , new RSTile(3662,5088)
- , new RSTile(3662,5089)
- , new RSTile(3662,5090)
- , new RSTile(3662,5091)
- , new RSTile(3662,5092)
- , new RSTile(3662,5093)
- , new RSTile(3662,5094)
- , new RSTile(3662,5095)
- , new RSTile(3662,5096)
- , new RSTile(3662,5097)
- , new RSTile(3662,5098)
- , new RSTile(3661,5099)
- , new RSTile(3661,5100)
- , new RSTile(3661,5101)
- , new RSTile(3661,5102)
- , new RSTile(3661,5103)
- , new RSTile(3661,5104)
- , new RSTile(3661,5105)
- , new RSTile(3661,5106)
- , new RSTile(3661,5107)
- , new RSTile(3661,5108)
- , new RSTile(3661,5109)
- , new RSTile(3661,5110)
- , new RSTile(3661,5111)
- , new RSTile(3661,5112)
- , new RSTile(3661,5113)
- , new RSTile(3661,5114)
- , new RSTile(3661,5115)
- , new RSTile(3661,5116)
- , new RSTile(3661,5117)
- , new RSTile(3661,5118)
- , new RSTile(3662,5119)
- , new RSTile(3662,5120)
- , new RSTile(3662,5121)
- , new RSTile(3662,5122)
- , new RSTile(3662,5123)
- , new RSTile(3662,5124)
- , new RSTile(3661,5125)
- , new RSTile(3660,5126)
- , new RSTile(3659,5127)
- , new RSTile(3658,5128)
- , new RSTile(3658,5129)
- , new RSTile(3657,5129)
- , new RSTile(3657,5130)
- , new RSTile(3657,5131)
- , new RSTile(3657,5132)
- , new RSTile(3656,5133)
- , new RSTile(3656,5134)
- , new RSTile(3656,5135)
- , new RSTile(3656,5136)
- , new RSTile(3656,5137)
- , new RSTile(3656,5138)
- , new RSTile(3657,5139)
- , new RSTile(3658,5140)
- , new RSTile(3659,5141)
- , new RSTile(3660,5142)
- , new RSTile(3661,5143)
- , new RSTile(3662,5143)
- , new RSTile(3663,5144)
- , new RSTile(3664,5145)
- , new RSTile(3664,5146)
- , new RSTile(3664,5147)
- , new RSTile(3665,5148)
- , new RSTile(3665,5149)
- , new RSTile(3666,5150)
- , new RSTile(3666,5151)
- , new RSTile(3667,5152)
- , new RSTile(3668,5153)
- , new RSTile(3669,5154)
- , new RSTile(3670,5155)
- , new RSTile(3671,5155)
- , new RSTile(3672,5155)
- , new RSTile(3673,5155)
- , new RSTile(3674,5155)
- , new RSTile(3675,5155)
- , new RSTile(3676,5155)
- , new RSTile(3677,5155)
- , new RSTile(3678,5156)
- , new RSTile(3679,5157)
- , new RSTile(3680,5158)
- , new RSTile(3680,5159)
- , new RSTile(3680,5160)
- }};
- RSTile[][] GoldRock2ToGoldRock3 = {{new RSTile(3638,5096)
- , new RSTile(3639,5096)
- , new RSTile(3640,5096)
- , new RSTile(3641,5096)
- , new RSTile(3642,5096)
- , new RSTile(3643,5096)
- , new RSTile(3644,5096)
- , new RSTile(3645,5096)
- , new RSTile(3646,5096)
- , new RSTile(3647,5096)
- , new RSTile(3648,5096)
- , new RSTile(3649,5095)
- , new RSTile(3650,5095)
- , new RSTile(3651,5095)
- , new RSTile(3652,5095)
- , new RSTile(3653,5096)
- , new RSTile(3654,5097)
- , new RSTile(3654,5098)
- , new RSTile(3655,5099)
- , new RSTile(3656,5100)
- , new RSTile(3657,5101)
- , new RSTile(3657,5102)
- , new RSTile(3657,5103)
- , new RSTile(3657,5104)
- , new RSTile(3657,5105)
- , new RSTile(3657,5106)
- , new RSTile(3657,5107)
- , new RSTile(3657,5108)
- , new RSTile(3657,5109)
- , new RSTile(3657,5110)
- , new RSTile(3657,5111)
- , new RSTile(3657,5112)
- , new RSTile(3657,5113)
- , new RSTile(3658,5114)
- , new RSTile(3658,5115)
- , new RSTile(3659,5116)
- , new RSTile(3660,5117)
- , new RSTile(3661,5118)
- , new RSTile(3662,5119)
- , new RSTile(3662,5120)
- , new RSTile(3662,5121)
- , new RSTile(3662,5122)
- , new RSTile(3662,5123)
- , new RSTile(3662,5124)
- , new RSTile(3662,5125)
- , new RSTile(3662,5126)
- , new RSTile(3663,5127)
- , new RSTile(3664,5128)
- , new RSTile(3665,5129)
- , new RSTile(3666,5130)
- , new RSTile(3666,5131)
- , new RSTile(3666,5132)
- , new RSTile(3667,5132)
- , new RSTile(3668,5133)
- , new RSTile(3669,5134)
- , new RSTile(3669,5135)
- , new RSTile(3669,5136)
- , new RSTile(3669,5137)
- , new RSTile(3669,5138)
- , new RSTile(3670,5139)
- , new RSTile(3670,5140)
- , new RSTile(3670,5141)
- , new RSTile(3670,5142)
- , new RSTile(3670,5143)
- , new RSTile(3670,5144)
- , new RSTile(3670,5145)
- , new RSTile(3670,5146)
- , new RSTile(3670,5147)
- , new RSTile(3670,5148)
- , new RSTile(3670,5149)
- , new RSTile(3670,5150)
- , new RSTile(3670,5151)
- , new RSTile(3671,5152)
- , new RSTile(3672,5152)
- , new RSTile(3673,5152)
- , new RSTile(3674,5152)
- , new RSTile(3675,5153)
- , new RSTile(3676,5154)
- , new RSTile(3677,5155)
- , new RSTile(3678,5156)
- , new RSTile(3679,5157)
- , new RSTile(3680,5158)
- , new RSTile(3680,5159)
- , new RSTile(3680,5160)
- },{
- new RSTile(3638,5096)
- , new RSTile(3638,5097)
- , new RSTile(3638,5098)
- , new RSTile(3638,5099)
- , new RSTile(3638,5100)
- , new RSTile(3638,5101)
- , new RSTile(3638,5102)
- , new RSTile(3638,5103)
- , new RSTile(3638,5104)
- , new RSTile(3638,5105)
- , new RSTile(3638,5106)
- , new RSTile(3638,5107)
- , new RSTile(3638,5108)
- , new RSTile(3638,5109)
- , new RSTile(3638,5110)
- , new RSTile(3638,5111)
- , new RSTile(3638,5112)
- , new RSTile(3638,5113)
- , new RSTile(3638,5114)
- , new RSTile(3638,5115)
- , new RSTile(3638,5116)
- , new RSTile(3638,5117)
- , new RSTile(3638,5118)
- , new RSTile(3638,5119)
- , new RSTile(3638,5120)
- , new RSTile(3639,5121)
- , new RSTile(3639,5122)
- , new RSTile(3640,5123)
- , new RSTile(3641,5124)
- , new RSTile(3642,5125)
- , new RSTile(3643,5126)
- , new RSTile(3644,5126)
- , new RSTile(3645,5127)
- , new RSTile(3646,5128)
- , new RSTile(3647,5129)
- , new RSTile(3648,5130)
- , new RSTile(3649,5131)
- , new RSTile(3650,5132)
- , new RSTile(3651,5133)
- , new RSTile(3651,5134)
- , new RSTile(3652,5135)
- , new RSTile(3653,5136)
- , new RSTile(3654,5137)
- , new RSTile(3655,5137)
- , new RSTile(3656,5138)
- , new RSTile(3657,5139)
- , new RSTile(3658,5140)
- , new RSTile(3659,5141)
- , new RSTile(3660,5142)
- , new RSTile(3661,5143)
- , new RSTile(3662,5143)
- , new RSTile(3663,5143)
- , new RSTile(3664,5143)
- , new RSTile(3665,5143)
- , new RSTile(3666,5143)
- , new RSTile(3667,5143)
- , new RSTile(3668,5143)
- , new RSTile(3669,5144)
- , new RSTile(3670,5145)
- , new RSTile(3670,5146)
- , new RSTile(3670,5147)
- , new RSTile(3670,5148)
- , new RSTile(3671,5149)
- , new RSTile(3672,5150)
- , new RSTile(3673,5151)
- , new RSTile(3674,5152)
- , new RSTile(3675,5153)
- , new RSTile(3676,5154)
- , new RSTile(3677,5155)
- , new RSTile(3678,5156)
- , new RSTile(3679,5157)
- , new RSTile(3680,5158)
- , new RSTile(3680,5159)
- , new RSTile(3680,5160)
- }};
- RSTile GoldRock1 = new RSTile(3668, 5076);
- RSTile GoldRock2 = new RSTile(3638, 5095);
- RSTile GoldRock3 = new RSTile(3678, 5161);
- RSTile SafeSpot = null;
- public boolean IsAtDungeon()throws Exception{
- if ((getLocation().getX() >= 3600 && getLocation().getX() <= 3750 && getLocation().getY() >= 5050 && getLocation().getY() <= 5162))
- return true;
- else
- return false;
- }
- public boolean IsAtBank()throws Exception{
- if ((getLocation().getX() >= 3652 && getLocation().getX() <= 3658 && getLocation().getY() >= 5112 && getLocation().getY() <= 5116))
- return true;
- else
- return false;
- }
- public boolean IsAtGoldRock1()throws Exception{
- if ((getLocation().getX() >= 3665 && getLocation().getX() <= 3670 && getLocation().getY() >= 5073 && getLocation().getY() <= 5079))
- return true;
- else
- return false;
- }
- public boolean IsAtGoldRock2()throws Exception{
- if ((getLocation().getX() >= 3634 && getLocation().getX() <= 3641 && getLocation().getY() >= 5092 && getLocation().getY() <= 5099))
- return true;
- else
- return false;
- }
- public boolean IsAtGoldRock3()throws Exception{
- if ((getLocation().getX() >= 3674 && getLocation().getX() <= 3682 && getLocation().getY() >= 5157 && getLocation().getY() <= 5162))
- return true;
- else
- return false;
- }
- public boolean IsAtCoalRock1()throws Exception{
- if ((getLocation().getX() >= 3662 && getLocation().getX() <= 3668 && getLocation().getY() >= 5088 && getLocation().getY() <= 5093))
- return true;
- else
- return false;
- }
- public boolean IsAtCoalRock2()throws Exception{
- if ((getLocation().getX() >= 3672 && getLocation().getX() <= 3677 && getLocation().getY() >= 5097 && getLocation().getY() <= 5101))
- return true;
- else
- return false;
- }
- public boolean IsAtCoalRock3()throws Exception{
- if ((getLocation().getX() >= 3683 && getLocation().getX() <= 3690 && getLocation().getY() >= 5103 && getLocation().getY() <= 5110))
- return true;
- else
- return false;
- }
- public boolean openDeposit() {
- final RSObject deposit = getNearestObjectByID(45079);
- ActualPlace = deposit.getLocation();
- if (deposit == null) {
- return false;
- }
- if (!tileOnScreen(deposit.getLocation())) {
- wait(1);
- //turnToTile(deposit.getLocation(), 15);
- }
- return atTile(deposit.getLocation(), "Deposit");
- }
- public RSTile SafeZone() throws Exception{
- if (!RealStatus.equals(cache.messages.get(1)) && !RealStatus.contains(cache.messages.get(2)))
- return null;
- RSPlayer player = getMyPlayer();
- int x = player.getLocation().getX();
- int y = player.getLocation().getY();
- RSTile loc = player.getLocation();
- // if (cache.safespotX[x][y] != 0 && cache.safespotY[x][y] != 0)
- // return new RSTile(cache.safespotX[x][y], cache.safespotY[x][y]);
- if (cache.safespots.containsKey(loc))
- return cache.safespots.get(loc);
- if (IsAtGoldRock3()) {
- return new RSTile(3680, 5160);
- }else if (IsAtGoldRock2()) {
- return new RSTile(3638, 5096);
- }else if (IsAtGoldRock1()) {
- return new RSTile(3669,5076);
- }else if (IsAtBank()){ //Cant Happen
- return null;
- }else{ //Cant Happen unless out route etc
- return null;
- }
- }
- public boolean depositContains(final int... itemID) {
- for (final int i : itemID) {
- if (getdepositInventoryItemByID(i) == null) {
- return false;
- }
- }
- return true;
- }
- public RSItem getdepositInventoryItemByID(final int... ids) {
- final RSItem[] items = getdepositInventoryItems();
- for (final RSItem item : items) {
- for (final int id : ids) {
- if (item.getID() == id) {
- return item;
- }
- }
- }
- return null;
- }
- public RSItem[] getdepositInventoryItems() {
- final RSInterfaceChild invIface = RSInterface.getInterface(11).getChild(17);
- if (invIface != null) {
- if (invIface.getComponents().length > 0) {
- int len = 0;
- for (final RSInterfaceComponent com : invIface.getComponents()) {
- if (com.getType() == 5) {
- len++;
- }
- }
- final RSItem[] inv = new RSItem[len];
- for (int i = 0; i < len; i++) {
- try {
- final RSInterfaceComponent item = invIface
- .getComponents()[i];
- inv[item.getComponentIndex()] = new RSItem(item);
- } catch (final Exception e) {
- wait(random(500, 700));
- return getdepositInventoryItems();
- }
- }
- return inv;
- }
- }
- return new RSItem[0]; // give scripters as few nulls as possible!
- }
- public boolean atDepositItem(final int itemID, final String option)throws Exception {
- try {
- final RSInterfaceChild inventory = RSInterface.getInterface(11).getChild(17);
- if (inventory == null || inventory.getComponents() == null) {
- return false;
- }
- final java.util.List<RSInterfaceComponent> possible = new ArrayList<RSInterfaceComponent>();
- for (final RSInterfaceComponent item : inventory.getComponents()) {
- if (item != null && item.getComponentID() == itemID) {
- possible.add(item);
- }
- }
- if (possible.size() == 0) {
- return false;
- }
- final RSInterfaceComponent item = possible.get(random(0, Math.min(
- 2, possible.size())));
- return atInterface(item, option);
- } catch (final Exception e) {
- return false;
- }
- }
- private boolean Eat()throws Exception {
- if (FOOD_ID != 0) {
- atInventoryItem(FOOD_ID, "Eat");
- return true;
- }
- return false;
- }
- boolean WalkToClick(RSTile T)throws Exception {
- final Point p = Calculations.tileToScreen(T);
- final Point pn = Calculations.tileToScreen(T.getX(), T.getY(), 0, 0, 0);
- final Point px = Calculations.tileToScreen(T.getX() + 1, T.getY(), 0,
- 0, 0);
- final Point py = Calculations.tileToScreen(T.getX(), T.getY() + 1, 0,
- 0, 0);
- final Point pxy = Calculations.tileToScreen(T.getX() + 1, T.getY() + 1,
- 0, 0, 0);
- final Point[] points = {p, pn, px, py, pxy};
- for (final Point point : points) {
- if (!pointOnScreen(point)) {
- return false;
- }
- }
- clickMouse(p.x, p.y, false);
- return true;
- }
- public String RealStatus = null;
- public boolean MiningGold = false;
- public int MiningGoldRock = 0;
- public boolean []DeadRocks = new boolean[3];
- @Override
- public int loop() {
- try{
- if (!isLoggedIn() || stop == true) {
- Bot.disableRandoms = false;
- if (stopiflogout)
- stopScript();
- return -1;
- }
- if (me==null && isLoggedIn())
- me = new RSPlayerLRC();
- if (!RealStatus.equals(cache.messages.get(1)) && !RealStatus.contains(cache.messages.get(3)))
- ActualPlace = null;
- else
- ActualRoute = null;
- if (getMyPlayer().getHPPercent() <= 75) {
- Eat();
- }
- if (getMyPlayer().getHPPercent() <= 40) {
- setRun(true);
- forcelogout = true;
- }
- if (!IsAtDungeon() && Bot.disableRandoms){
- if (Bot.disableRandoms) {
- Bot.disableRandoms = false;
- log.info(cache.messages.get(12));
- }
- }else {
- if (IsAtDungeon() && !Bot.disableRandoms) {
- if (inventoryContains(14664)) {
- if (Bot.disableRandoms) {
- Bot.disableRandoms = false;
- log.info(cache.messages.get(12));
- }
- }else if (RSInterface.getInterface(WelcomeScreen.WELCOME_SCREEN_ID)
- .getChild(WelcomeScreen.WELCOME_SCREEN_BUTTON_PLAY)
- .getAbsoluteY() > 2) {
- if (Bot.disableRandoms) {
- Bot.disableRandoms = false;
- log.info(cache.messages.get(12));
- }
- }else{
- if (!Bot.disableRandoms) {
- Bot.disableRandoms = true;
- log.info(cache.messages.get(11));
- }
- }
- }
- }
- if (!Bot.disableRandoms) {
- return 100;
- }
- if (path != null) {
- walkPath(path, false);
- path = null;
- return 1;
- }
- if (gettingAttacked()) {
- RSPlayer player = getMyPlayer();
- int x = player.getLocation().getX();
- int y = player.getLocation().getY();
- setRun(true);
- RSTile safePlace = SafeZone();
- if (safePlace != null && forcebank == false && forcelogout == false) {
- if ((x == 3689 || x == 3688) && y == 5106)
- forcebank = true;
- else
- RealStatus = "CheckingRock_"+MiningGoldRock;
- if (tileOnScreen(safePlace))
- atTile(safePlace, "Walk here");
- else
- walkTileMM(safePlace);
- return random(1900, 2200);
- }
- }
- startRunning(runEnergy);
- if (getCurrentTab() == TAB_INVENTORY && needRenew == true) {
- if (inventoryContains(restoresummonpouchid)) {
- if (Integer.parseInt(getInterface(747,5).getText()) <= restoresummonpointsat) {
- if(!atInventoryItem(12140, "Drink"))
- if(!atInventoryItem(12142, "Drink"))
- if(!atInventoryItem(12144, "Drink"))
- if(!atInventoryItem(12146, "Drink")) {
- familiarnpcid = 0;
- summoningfamiliar = false;
- usingstore = false;
- hasStore = false;
- return 1;
- }
- }
- atInventoryItem(229, "Drop");
- atInterface(747, 5, "Renew Familiar");
- wait(random(600,1200));
- }else{
- familiarnpcid = 0;
- summoningfamiliar = false;
- usingstore = false;
- hasStore = false;
- }
- needRenew = false;
- }
- if (!getMyPlayer().isInCombat() && (RealStatus.equals(cache.messages.get(1))))
- if (random(0, 101) == 50)
- Antiban.run();
- if(!setAltitude) {
- setCameraAltitude(true);
- wait(random(250, 500));
- setAltitude = true;
- return random(50, 100);
- }
- if(StartXP == 0) {
- StartXP = skills.getCurrentSkillExp(skills.getStatIndex("mining"));
- StartLvl = skills.getCurrentSkillLevel(skills.getStatIndex("mining"));
- }
- if (RealStatus.equals(cache.messages.get(4))|| (!RSInterface.getInterface(Constants.INTERFACE_DEPOSITBOX).isValid() && isInventoryFull())) {
- RealStatus = cache.messages.get(4);
- if (usingstore && !forcebank && !hasStore) {
- if (gettingAttacked()) {
- hasStore = false;
- forcebank = true;
- return 1;
- }
- RSTile walkplace = null;
- if (MiningGoldRock == 1)
- walkplace = new RSTile(3672, 5078+random(0, 3));
- if (MiningGoldRock == 2)
- walkplace = new RSTile(3638+random(-1, 2), 5099);
- if (walkplace != null && walkplace!= getLocation())
- if (tileOnScreen(walkplace))
- atTile(walkplace, "Walk here");
- else
- walkTileMM(walkplace);
- wait(random(2200, 3000));
- RSNPC familiar = getNearestNPCByID(familiarnpcid);
- if (!atNPC(familiar, "Store")) {
- //if (!onTile(familiar.getLocation(), familiar.getName(), "Store", 0.5, 0, 300)) {
- hasStore = false;
- forcebank = true;
- log(cache.messages.get(13));
- }else{
- wait(random(900, 1200));
- if (RSInterface.getInterface(665).isValid()) {
- atInventoryItem(444, "Store-All");
- wait(random(900, 1200));
- atInterface(671,13,"Close");
- hasStore = true;
- RealStatus = "CheckingRock_"+MiningGoldRock;
- wait(random(1300, 2000));
- }
- return (random(900, 1200));
- }
- }
- if (powerMine == true && !forcebank) {
- dropAllExcept(random(0,2) == 0 ? true : false, cache.pickaxes.get(0),cache.pickaxes.get(1),cache.pickaxes.get(2),cache.pickaxes.get(3),cache.pickaxes.get(4),cache.pickaxes.get(5),cache.pickaxes.get(6), FOOD_ID);
- RealStatus = "CheckingRock_"+MiningGoldRock;
- return 1;
- }
- if (IsAtBank()) {
- if (RSInterface.getInterface(Constants.INTERFACE_DEPOSITBOX).isValid()) {
- if (!quickdeposit) {
- atDepositItem(444, "Deposit-All");
- atDepositItem(995, "Deposit-All");
- }else{
- atInterface(11,18,"Deposit carried items");
- }
- if (hasStore) {
- atInterface(11,22);
- hasStore = false;
- }
- forcebank = false;
- RealStatus = cache.messages.get(0);
- return (random(900, 1100));
- }else{
- openDeposit();
- return (random(600, 2000));
- }
- }else if (MiningGoldRock == 1) {
- forcebank = true;
- walkPath(BankToGoldRock1, true);
- return 1;
- }else if (MiningGoldRock == 2) {
- forcebank = true;
- walkPath(BankToGoldRock2, true);
- return 1;
- }else if (MiningGoldRock == 3) {
- forcebank = true;
- walkPath(BankToGoldRock3[random(0, BankToGoldRock3.length)], true);
- return 1;
- }
- }else{
- if (IsAtBank() || RealStatus.equals(cache.messages.get(0))) {
- if (forcelogout) {
- stopScript();
- return 1;
- }
- /*if (summoningfamiliar) {
- if (Integer.parseInt(getInterface(747,5).getText()) <= restoresummonpointsat) {
- wait(random(100, 200));
- walkPath(RopePath, false);
- wait(random(1500,2000));
- while(distanceTo(ObeliskPath[0]) > 1) {
- //clickMouse((getNearestObjectByID(45078).getLocation()), "Rope");
- atRope(getNearestObjectByID(45078), "Climb");
- //onTile(getNearestObjectByID(45078).getLocation(), "Rope", "Climb", 0.67, 0, 450);
- wait(random(200,600));
- }
- wait(random(1200, 2000));
- walkPath(ObeliskPath, false);
- wait(random(1100,1200));
- while(!atTile(new RSTile(3032, 9823), "Renew-points") || (Integer.parseInt(getInterface(747,5).getText()) <= restoresummonpointsat))
- wait(random(1000,2000));
- wait(random(600,900));
- walkPath(ObeliskPath, true);
- wait(random(600,900));
- while(distanceTo(RopePath[RopePath.length-1]) > 1) {
- atRope(getNearestObjectByID(45077), "Climb");
- //onTile(getNearestObjectByID(45077).getLocation(), "Rope", "Climb", 0.67, 0, 0);
- wait(random(200,600));
- }
- wait(random(1200, 2000));
- walkPath(RopePath, true);
- return 1;
- }
- }*/
- if (miningwithcc) {
- if (DeadRocks[0] == false) {
- RealStatus = cache.messages.get(5);
- walkPath(BankToGoldRock1, false);
- }else if (DeadRocks[1] == false){
- RealStatus = cache.messages.get(6);
- walkPath(BankToGoldRock2, false);
- }else if (DeadRocks[2] == false){
- RealStatus = cache.messages.get(7);
- walkPath(BankToGoldRock3[random(0, BankToGoldRock3.length)], false);
- }
- return random(1,200);
- }
- if (MiningGoldRock == 1) {
- walkPath(BankToGoldRock1, false);
- }else if (MiningGoldRock == 2) {
- walkPath(BankToGoldRock2, false);
- }else if (MiningGoldRock == 3) {
- walkPath(BankToGoldRock3[random(0, BankToGoldRock3.length)], false);
- }
- RealStatus = "CheckingRock_"+MiningGoldRock;
- return random(1,200);
- }else if (RealStatus.equals(cache.messages.get(5))){
- RSObject Rock = getObjectAt(GoldRock1);
- while (!tileOnScreen(Rock.getLocation()))
- wait(1);
- /*if (!tileOnScreen(Rock.getLocation()) && !getMyPlayer().isMoving())
- turnToTile(Rock.getLocation(), 15);*/
- if (!tileOnScreen(Rock.getLocation()))
- wait(1);
- if (Rock.getID() != 45075) {
- atObject(Rock, "Mine");
- antimiss = System.currentTimeMillis();
- ActualPlace = Rock.getLocation();
- RealStatus = cache.messages.get(1);
- if (!miningwithcc)
- DeadRocks = new boolean[3];
- else
- DeadRocks[0] = false;
- }else{
- DeadRocks[0] = true;
- RealStatus = Finding_new_rock();
- }
- }else if (RealStatus.equals(cache.messages.get(6))){
- RSObject Rock = getObjectAt(GoldRock2);
- while (!tileOnScreen(Rock.getLocation()))
- wait(1);
- /*if (!tileOnScreen(Rock.getLocation()) && !getMyPlayer().isMoving())
- turnToTile(Rock.getLocation(), 15);*/
- if (!tileOnScreen(Rock.getLocation()))
- wait(1);
- if (Rock.getID() != 45075) {
- atObject(Rock, "Mine");
- antimiss = System.currentTimeMillis();
- ActualPlace = Rock.getLocation();
- RealStatus = cache.messages.get(1);
- if (!miningwithcc)
- DeadRocks = new boolean[3];
- else
- DeadRocks[1] = false;
- }else{
- DeadRocks[1] = true;
- RealStatus = Finding_new_rock();
- }
- }else if (RealStatus.equals(cache.messages.get(7))){
- RSObject Rock = getObjectAt(GoldRock3);
- while (!tileOnScreen(Rock.getLocation()))
- wait(1);
- /*if (!tileOnScreen(Rock.getLocation()) && !getMyPlayer().isMoving())
- turnToTile(Rock.getLocation(), 15);*/
- if (!tileOnScreen(Rock.getLocation()))
- wait(1);
- if (Rock.getID() != 45075) {
- atObject(Rock, "Mine");
- antimiss = System.currentTimeMillis();
- ActualPlace = Rock.getLocation();
- RealStatus = cache.messages.get(1);
- if (!miningwithcc)
- DeadRocks = new boolean[3];
- else
- DeadRocks[2] = false;
- }else{
- DeadRocks[2] = true;
- RealStatus = Finding_new_rock();
- }
- }else if (RealStatus.equals(cache.messages.get(1))){
- RSObject Rock = null;
- if (MiningGoldRock == 1)
- Rock = getObjectAt(GoldRock1);
- else if (MiningGoldRock == 2)
- Rock = getObjectAt(GoldRock2);
- else if (MiningGoldRock == 3)
- Rock = getObjectAt(GoldRock3);
- if (!tileOnScreen(Rock.getLocation()))
- wait(1);
- //turnToTile(Rock.getLocation(), 15);
- if (Rock.getID() == 45076) {
- ActualPlace = Rock.getLocation();
- RealStatus = cache.messages.get(1);
- DeadRocks = new boolean[3];
- if (getMyPlayer().getAnimation() == -1) {
- if ((System.currentTimeMillis()-antimiss) > (random(3000,6000)))
- RealStatus = "CheckingRock_"+MiningGoldRock;
- }else
- antimiss = System.currentTimeMillis();
- }else{
- DeadRocks[MiningGoldRock-1] = true;
- RealStatus = Finding_new_rock();
- }
- }
- return 1;
- }
- return 1;
- } catch(Exception e) {
- return 1;
- }
- }
- public int bankedtimes;
- public long antimiss;
- public boolean threeRocks = false;
- public boolean atRope(final RSObject tree, final String action) {
- final RSTile loc1 = tree.getLocation();
- // @SuppressWarnings("unused")
- // final RSTile loc2 = new RSTile(loc1.getX() + 1, loc1.getY());
- // @SuppressWarnings("unused")
- // final RSTile loc3 = new RSTile(loc1.getX(), loc1.getY() + 1);
- final RSTile loc4 = tree.getLocation();
- final Point sloc1 = Calculations.tileToScreen(loc1.getX(), loc1.getY(),
- 90);
- final Point sloc2 = Calculations.tileToScreen(loc4.getX(), loc4.getY(),
- 90);
- /*final Point screenLoc = new Point((sloc1.x + sloc2.x) / 2,
- (sloc1.y + sloc2.y) / 2);*/
- final Point screenLoc = Calculations.tileToScreen(loc1.getX(), loc1.getY(),90);
- if (screenLoc.x == -1 || screenLoc.y == -1) {
- return false;
- }
- moveMouse(screenLoc, 3, 3);
- return atMenu(action);
- }
- public boolean onTile(RSTile tile, String search, String action, double dx, double dy, int height) {
- if (!tile.isValid()) {
- return false;
- }
- Point checkScreen = null;
- checkScreen = Calculations.tileToScreen(tile, dx, dy, height);
- if (!pointOnScreen(checkScreen)) {
- walkTileMM(tile);
- wait(random(340, 1310));
- }
- try {
- Point screenLoc = null;
- for (int i = 0; i < 30; i++) {
- screenLoc = Calculations.tileToScreen(tile, dx, dy, height);
- if (!pointOnScreen(screenLoc)) {
- return false;
- }
- if(getMenuItems().get(0).toLowerCase().contains(search.toLowerCase())) {
- break;
- }
- if (getMouseLocation().equals(screenLoc)) {
- break;
- }
- moveMouse(screenLoc);
- }
- screenLoc = Calculations.tileToScreen(tile, height);
- if (getMenuItems().size() <= 1) {
- return false;
- }
- wait(random(100, 200));
- if (getMenuItems().get(0).toLowerCase().contains(action.toLowerCase())) {
- clickMouse(true);
- return true;
- } else {
- clickMouse(false);
- return atMenu(action);
- }
- } catch (Exception e) {
- e.printStackTrace();
- return false;
- }
- }
- public String Finding_new_rock() {
- if (MiningGoldRock == 1) {
- if (threeRocks) {
- if (DeadRocks[0] == false)
- return cache.messages.get(5);
- if (DeadRocks[0] == true && DeadRocks[1] == true && DeadRocks[2] == true) {
- MiningGoldRock = 1;
- return cache.messages.get(5);
- } else if (DeadRocks[1] == false) {
- walkPath(GoldRock1ToGoldRock2, false);
- MiningGoldRock = 2;
- return cache.messages.get(6);
- }else if (DeadRocks[1] == true && DeadRocks[2] == false) {
- walkPath(GoldRock1ToGoldRock3[random(0, GoldRock1ToGoldRock3.length)], false);
- MiningGoldRock = 3;
- return cache.messages.get(7);
- }
- }else {
- if (DeadRocks[0] == false)
- return cache.messages.get(5);
- if (DeadRocks[0] == true && DeadRocks[1] == true) {
- MiningGoldRock = 1;
- return cache.messages.get(5);
- } else if (DeadRocks[1] == false) {
- walkPath(GoldRock1ToGoldRock2, false);
- MiningGoldRock = 2;
- return cache.messages.get(6);
- }
- }
- }else if (MiningGoldRock == 2) {
- if (threeRocks) {
- if (DeadRocks[0] == true && DeadRocks[1] == false)
- return cache.messages.get(6);
- if (DeadRocks[0] == true && DeadRocks[1] == true && DeadRocks[2] == true) {
- MiningGoldRock = 2;
- return cache.messages.get(6);
- }
- if (DeadRocks[0] == false) {
- walkPath(GoldRock1ToGoldRock2, true);
- MiningGoldRock = 1;
- return cache.messages.get(5);
- }else if (DeadRocks[0] == true && DeadRocks[2] == false) {
- walkPath(GoldRock2ToGoldRock3[random(0, GoldRock2ToGoldRock3.length)], false);
- MiningGoldRock = 3;
- return cache.messages.get(7);
- }
- }else{
- if (DeadRocks[0] == true && DeadRocks[1] == false)
- return cache.messages.get(6);
- if (DeadRocks[0] == true && DeadRocks[1] == true) {
- MiningGoldRock = 2;
- return cache.messages.get(6);
- }
- if (DeadRocks[0] == false) {
- walkPath(GoldRock1ToGoldRock2, true);
- MiningGoldRock = 1;
- return cache.messages.get(5);
- }
- }
- }else if (MiningGoldRock == 3) {
- if (!threeRocks)
- if (DeadRocks[0] == true && DeadRocks[1] == true && DeadRocks[2] == false)
- return cache.messages.get(7);
- if (DeadRocks[0] == false && DeadRocks[1] == true) { //shouldnt happen
- walkPath(GoldRock1ToGoldRock3[random(0, GoldRock1ToGoldRock3.length)], true);
- MiningGoldRock = 1;
- return cache.messages.get(5);
- }else if (DeadRocks[1] == false && DeadRocks[0] == true) { //shouldnt happen
- walkPath(GoldRock2ToGoldRock3[random(0, GoldRock2ToGoldRock3.length)], true);
- MiningGoldRock = 2;
- return cache.messages.get(6);
- }else{
- if (random(1,3) == 1) {
- walkPath(GoldRock1ToGoldRock3[random(0, GoldRock1ToGoldRock3.length)], true);
- MiningGoldRock = 1;
- return cache.messages.get(5);
- }else {
- walkPath(GoldRock2ToGoldRock3[random(0, GoldRock2ToGoldRock3.length)], true);
- MiningGoldRock = 2;
- return cache.messages.get(6);
- }
- }
- }
- return cache.messages.get(1);
- }
- RSTile[] path = null;
- public void walkPath(RSTile[] path, final boolean reverse) {
- path = reverse ? reversePath(path) : path;
- path = randomizePath(path, 2, 2);
- ActualRoute = path;
- try{
- while(distanceTo(path[path.length-1]) > random(4,6)) {
- if (RSInterface.getInterface(Constants.INTERFACE_DEPOSITBOX).isValid()) {
- if (depositContains(444)) {
- try {
- if (!quickdeposit) {
- atDepositItem(444, "Deposit-All");
- atDepositItem(995, "Deposit-All");
- }else{
- atInterface(11,18,"Deposit carried items");
- }
- } catch (Exception e) {
- }
- wait(random(300, 600));
- continue;
- }
- }
- if (gettingAttacked())
- setRun(true);
- startRunning(runEnergy);
- if (getMyPlayer().getHPPercent() <= 75) {
- Eat();
- }
- if (!IsAtDungeon() && Bot.disableRandoms){
- if (Bot.disableRandoms) {
- Bot.disableRandoms = false;
- log.info(cache.messages.get(12));
- }
- }else {
- if (IsAtDungeon() && !Bot.disableRandoms) {
- if (inventoryContains(14664)) {
- if (Bot.disableRandoms) {
- Bot.disableRandoms = false;
- log.info(cache.messages.get(12));
- }
- }else if (RSInterface.getInterface(WelcomeScreen.WELCOME_SCREEN_ID)
- .getChild(WelcomeScreen.WELCOME_SCREEN_BUTTON_PLAY)
- .getAbsoluteY() > 2) {
- if (Bot.disableRandoms) {
- Bot.disableRandoms = false;
- log.info(cache.messages.get(12));
- }
- }else{
- if (!Bot.disableRandoms) {
- Bot.disableRandoms = true;
- log.info(cache.messages.get(11));
- }
- }
- }
- }
- if (!Bot.disableRandoms) {
- this.path = path;
- break;
- }
- if (random(1, 11) == 5 && getCurrentTab() != Constants.TAB_INVENTORY) {
- Bot.getInputManager().pressKey((char)KeyEvent.VK_F1);
- wait(random(20,50));
- Bot.getInputManager().releaseKey((char)KeyEvent.VK_F1);
- }
- if (!getMyPlayer().isMoving() || distanceTo(getDestination()) <= random(5,7)) {
- if (!walkPathMM(path, random(14,16), 2 ,2))
- walkPathMM(path, random(10,14), 2 ,2);
- wait(random(600, 800));
- }
- wait(random(100, 200));
- }
- } catch (Exception e) {
- walkPath(path, false);
- }
- }
- public boolean needRenew = false;
- @Override
- public void serverMessageRecieved(final ServerMessageEvent arg0) {
- final String Message = arg0.getMessage();
- // log.info(Message);
- if (summoningfamiliar)
- if (Message.contains("This is not your familiar.")) {
- hasStore = false;
- forcebank = true;
- }
- if (Message.contains("before your familiar vanishes."))
- needRenew = true;
- if (Message.contains("mine some coal")){
- TotalXp = TotalXp + 50;
- OresMined++;
- }
- if (Message.contains("two pieces of coal")){
- TotalXp = TotalXp + 100;
- OresMined= OresMined+2;
- }
- if (Message.contains("two gold ores!")){
- TotalXp = TotalXp + 130;
- OresMined= OresMined+2;
- }
- if (Message.contains("Varrock Armour")){
- TotalXp = TotalXp + 65;
- OresMined++;
- }
- if (Message.contains("mine some gold")){
- TotalXp = TotalXp + 65;
- OresMined++;
- }
- }
- public BufferedImage loadImage(String ref) {
- try{
- String filePlace = "goldore.gif";
- new File(filePlace).delete();
- URL url = new URL("http://privateftp.no-ip.info/goldore.gif");
- if (url == null) {
- return null;
- }
- RandomAccessFile file = new RandomAccessFile(new File(filePlace), "rw");
- InputStream in = url.openStream();
- byte[] buf = new byte[4 * 1024];
- int bytesRead;
- while ((bytesRead = in.read(buf)) != -1) {
- file.write(buf, 0, bytesRead);
- }
- file.close();
- BufferedImage bimg = null;
- try {
- bimg = ImageIO.read(new File(filePlace));
- } catch (Exception e) {
- e.printStackTrace();
- }
- new File(filePlace).delete();
- return bimg;
- }catch (Exception E) {
- return null;
- }
- }
- BufferedImage goldOreI = loadImage("goldore");
- long startTime = System.currentTimeMillis();
- int profit = 0;
- int startLvl = 0;
- int startexp = 0;
- int xpGained = 0;
- Color gold = new Color(250,250,0,50);
- public void onRepaint(Graphics g) {
- if (!isLoggedIn())
- return;
- try{
- if (ActualRoute != null) {
- for (int i = 0; i < ActualRoute.length; i++) {
- actualRock(g, ActualRoute[i], transRed, "Step: "+i);
- }
- }
- if (ActualPlace != null)
- actualRock(g, ActualPlace, transGreen, "Actual Place: ");
- }catch(Exception e) {
- }
- int profit = miningoreprice*OresMined;
- 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;
- float profitsec = 0;
- if ((minutes > 0 || hours > 0 || seconds > 0)) {
- profitsec = ((float) profit)/(float)(seconds + (minutes*60) + (hours*60*60));
- float profitmin = profitsec * 60;
- float profithour = profitmin * 60;
- if (startexp == 0) {
- startexp = skills.getCurrentSkillExp(STAT_MINING);
- }
- xpGained = (skills.getCurrentSkillExp(STAT_MINING) - startexp);
- float xpsec = 0;
- if ((minutes > 0 || hours > 0 || seconds > 0) && xpGained > 0) {
- xpsec = ((float) xpGained)/(float)(seconds + (minutes*60) + (hours*60*60));
- }
- float xpmin = xpsec * 60;
- float xphour = xpmin * 60;
- if (startLvl == 0)startLvl = skills.getCurrentSkillLevel(STAT_MINING);
- int currentLvl = skills.getCurrentSkillLevel(STAT_MINING);
- int lvlsGained = currentLvl - startLvl;
- int percentToLvl = skills.getPercentToNextLevel(STAT_MINING);
- Mouse mouse = Bot.getClient().getMouse();
- if((mouse.x >= 481 && mouse.x < 481 + 31 && mouse.y >= 298 && mouse.y < 298 + 37) == false) {
- g.drawImage(goldOreI, 481, 304, 31, 27, null);
- g.setColor(Color.black);
- g.setFont(new Font("Copperplate Gothic Bold", Font.PLAIN, 14));
- g.drawString("" + "mined" , 484,323);
- g.setFont(new Font("Copperplate Gothic Bold", Font.PLAIN, 12));
- g.setColor(Color.white);
- g.drawString("" + "mined" , 485,323);
- }else {
- g.setColor(gold);
- g.fillRoundRect(310,135,200,200,10,10);
- g.setFont(new Font("Copperplate Gothic Bold", Font.PLAIN, 16));
- g.setColor(Color.white);
- g.drawString("Dragonkk's" , 355, 147);
- g.drawString("Living Cavern Miner" , 320, 162);
- g.setFont(new Font("Times New Roman", Font.BOLD, 14));
- g.drawString("Time running: " + hours + ":" + minutes + ":" + seconds , 312, 177);
- g.drawString("Ores Mined: " + OresMined , 312, 193);
- g.drawString("Profit: " + profit , 312, 209);
- g.drawString("Profit per hour: " + (int)profithour , 312, 225);
- /*********************************************************/
- g.drawString("Current Level: " + currentLvl , 312, 282);
- g.drawString("Levels Gained: " + lvlsGained , 312, 298);
- g.drawString("XP Gained: " + xpGained, 312, 314);
- g.drawString("XP per Hour: " + (int)xphour, 312, 330);
- g.drawRect(335,240,150,20);
- g.setColor(Color.red);
- g.fillRect(336,241,149,19);
- g.setColor(Color.green);
- double percent = 1.49*percentToLvl;
- g.fillRect(336,241,(int)percent,19);
- g.setColor(Color.white);
- g.drawString("" + percentToLvl + "%", 400, 253);
- g.setColor(Color.yellow);
- g.fillRoundRect(6,460,510,15,0,0);
- g.setColor(Color.green);
- g.setFont(new Font("Arial", Font.BOLD, 12));
- if (RealStatus.contains("CheckingRock_"))
- g.drawString("Status: Checking Rock",9,471);
- else
- g.drawString("Status: "+RealStatus,9,471);
- }
- }
- }
- RSTile ActualPlace = null;
- RSTile[] ActualRoute = null;
- long delaytimetonext = System.currentTimeMillis();
- long antibannext = System.currentTimeMillis();
- long antibannext2 = System.currentTimeMillis();
- public class antiban extends Thread {
- public void CameraAlt() {
- try {
- int key = (random(0, 2) == 0) ? KeyEvent.VK_UP : KeyEvent.VK_DOWN;
- Bot.getInputManager().pressKey((char)key);
- Thread.sleep(random(1000, 1500));
- Bot.getInputManager().releaseKey((char)key);
- } catch (final InterruptedException e) {
- }
- antimiss = System.currentTimeMillis();
- }
- public void CameraRot() {
- setCameraRotation((int) (getCameraAngle() + (Math.random() * 50 > 25 ? 1 : -1) * (30 + Math.random() * 90)));
- antimiss = System.currentTimeMillis();
- }
- public void mouseoverMM() {
- moveMouse(628 + random(-30, 30), 89 + random(-30, 30));
- antimiss = System.currentTimeMillis();
- }
- public void Lookplayers() {
- RSPlayer look = getNearestPlayerByLevel(3,139);
- if (look == null) {
- return;
- }
- final RSTile tile = look.getLocation();
- if (!tile.isValid()) {
- return;
- }
- Point screenLoc;
- for (int i = 0; i < 20; i++) {
- screenLoc = look.getScreenLocation();
- if (!look.isValid() || !pointOnScreen(screenLoc)) {
- log.info("Null player/not on screen");
- return;
- }
- if (getMouseLocation().equals(screenLoc)) {
- break;
- }
- moveMouse(screenLoc);
- }
- screenLoc = look.getScreenLocation();
- if (!getMouseLocation().equals(screenLoc)) {
- return;
- }
- final List<String> items = getMenuItems();
- if (items.size() <= 1) {
- return;
- }
- clickMouse(screenLoc, false);
- try {
- Thread.sleep((random(2000,4000)));
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- moveMouse(random(0,1000), random (0, 1000));
- antimiss = System.currentTimeMillis();
- }
- public void mouseOverMiningSkill() {
- try {
- openTab(Constants.TAB_STATS);
- // 2 interfaces, one for the pickaxe image, other for the skill text
- final RSInterfaceChild two = RSInterface.getInterface(320).getChild(7);
- moveMouse(new Point(two.getAbsoluteX()
- + random(2, two.getWidth() - 1), two.getAbsoluteY()
- + random(2, two.getHeight() - 1)));
- Thread.sleep(random(750, 1000));
- } catch (final InterruptedException e) {
- }
- antimiss = System.currentTimeMillis();
- }
- public void checkFriendsList() {
- openTab(Constants.TAB_FRIENDS);
- if (random(0, 5) == 5) {
- try {
- moveMouse(random(573, 620), random(439, 457));
- clickMouse(true);
- Thread.sleep(random(750, 1000));
- sendText("", true);
- } catch (final InterruptedException e) {
- }
- } else {
- try {
- moveMouse(random(552, 569), random(227, 420));
- Thread.sleep(random(750, 1000));
- Point mousel2 = getMouseLocation();
- moveMouse(random(584, 624), mousel2.y + random(-3, 3));
- } catch (final InterruptedException e) {
- }
- }
- antimiss = System.currentTimeMillis();
- }
- @Override
- public void run() {
- int chance = 0;
- chance = random(1, 5);
- if (chance >= 3) {
- return;
- }
- if ((System.currentTimeMillis() - antibannext) >= (random(25, 90) * 1000)) {
- aboveground();
- antibannext = System.currentTimeMillis();
- // log("Antiban performed =)");
- }
- }
- public void aboveground() {
- int gamble = 0;
- if (!getMyPlayer().isMoving()) {
- gamble = random(0, 14);
- if (gamble > 14) {
- Lookplayers();
- }else if (gamble > 12) {
- checkFriendsList();
- //log("Friends Tab Opened Above");
- } else if (gamble > 7) {
- mouseOverMiningSkill();
- //log("Stats Tab Opened Above");
- } else if (gamble > 4) {
- mouseoverMM();
- //log("Moved Mouse over MM Below");
- } else if (gamble > 0) {
- moveMouseRandomly(150);
- //log("Moved Mouse Randomly Above");
- } else if (gamble == 0) {
- CameraRot();
- //log("Camera Rotated Above");
- }
- }
- }
- }
- Thread Antiban = new antiban();
- public void onFinish() {
- stopcc = true;
- log(cache.messages.get(10)+getVersion());
- log(cache.messages.get(9));
- log("You have mined "+OresMined+" And gained " +TotalXp+" XP");
- cache.DeleteCache();
- cache = null;
- }
- }
