Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 98.57 KB | None | 0 0
  1. import java.awt.Graphics;
  2. import java.awt.Color;
  3. import java.awt.Point;
  4. import java.awt.Rectangle;
  5. import java.awt.event.MouseEvent;
  6. import java.awt.*;
  7. import java.awt.event.MouseListener;
  8. import java.util.Arrays;
  9. import javax.swing.DefaultListModel;
  10. import javax.swing.ListSelectionModel;
  11. import javax.swing.UIManager;
  12. import org.rsbot.event.events.MessageEvent;
  13. import org.rsbot.event.listeners.PaintListener;
  14. import org.rsbot.event.listeners.MessageListener;
  15. import org.rsbot.script.Script;
  16. import org.rsbot.script.ScriptManifest;
  17. import org.rsbot.script.methods.Game;
  18. import org.rsbot.script.methods.Skills;
  19. import org.rsbot.script.util.Filter;
  20. import org.rsbot.script.wrappers.RSArea;
  21. import org.rsbot.script.wrappers.RSItem;
  22. import org.rsbot.script.wrappers.RSNPC;
  23. import org.rsbot.script.wrappers.RSObject;
  24. import org.rsbot.script.wrappers.RSTile;
  25. import org.rsbot.script.wrappers.RSTilePath;
  26.  
  27. @ScriptManifest(authors = { "PhatNinja55" }, name = "PhatMiner", version = 4, description = "Mines ores around the globe!.")
  28. public class PhatMinerV4 extends Script implements PaintListener, MessageListener, MouseListener {
  29. Rectangle tab1 = new Rectangle(564, 433, 154, 30);
  30. Rectangle tab2 = new Rectangle(547, 205, 189, 227);
  31. int tab = 1;
  32. Point p;
  33. //Paints
  34. private boolean showPaint = true;
  35. //GUI STUFF
  36. private phatminer gui = new phatminer();
  37. public String Location;
  38. public String[] mineOres;
  39. public boolean startProgram = false;
  40. public boolean Banking = false;
  41. public int checkDistance = 0;
  42. public boolean M1D1;
  43. ///////////////////////////
  44.  
  45. //TILES
  46. public RSTile[] Bank;
  47. public RSTilePath toBank;
  48. public RSTile atBank;
  49. public RSTile[] Mine;
  50. public RSTilePath toMine;
  51. public RSTile[] MineFally;
  52. public RSTilePath toMineFally;
  53. public RSTile[] MineLumby;
  54. public RSTilePath toMineLumby;
  55. public RSTile[] MineLRC;
  56. public RSTilePath toMineLRC;
  57. public RSTile[] SouthtoBank;
  58. public RSTilePath toBankSouthLRC;
  59. public RSTilePath toBankWestLRC;
  60. public RSTilePath toSouthLRC;
  61. public RSTilePath toWestLRC;
  62. public RSTile[] WesttoBank;
  63. public RSTile[] WesttoSouth;
  64. public RSTilePath toWestfromSouth;
  65. public RSTilePath toSouthfromWest;
  66. public RSTile[] Ladder;
  67. public RSTilePath toLadderTop;
  68. public RSTilePath toLadderBottom;
  69.  
  70. public RSTile nearLadderDown = new RSTile(3019, 3337);
  71. public RSTile nearLadderUp = new RSTile(3019, 9737);
  72. public int LadderDown = 2113;
  73. public int LadderUp = 6226;
  74.  
  75. public RSArea atMine;
  76. public RSArea atFally;
  77. public RSArea atLumby;
  78.  
  79. public RSTile startPos;
  80.  
  81. public RSObject LRCDoor;
  82. public final int LRC_DOOR = 11714;
  83. public final RSTile LRCDoorTile = new RSTile(3061, 3374);
  84. public RSObject LRCStairs;
  85. public final int LRC_STAIRS = 35921;
  86. public RSObject LRCRope;
  87. public final int LRC_ROPE = 45077;
  88. public final RSTile LRCRopeTile = new RSTile(3014, 9831);
  89. public final int LRC_INTERFACE = 892;
  90. public final int LRC_INTERFACE_COMP = 17;
  91. public final int LRC_BANK = 2738;
  92. public final RSTile SOUTH_GOLD = new RSTile(3668,5076);
  93. public final RSTile WEST_GOLD = new RSTile(3638,5095);
  94. public final RSTile SOUTH_COAL = new RSTile(3665,5091);
  95. public final RSTile WEST_COAL = new RSTile(3675,5099);
  96. private int goldID = 444;
  97. private int coalID = 453;
  98. public boolean shouldWait = false;
  99. public int lastRock = -1;
  100.  
  101. public final int TZHAAR_OUT = 9359;
  102. public final RSTile TZHAAR_OUT_LOC = new RSTile(2480,5175);
  103. public final int TZHAAR_IN = 31284;
  104.  
  105. public final int TAVERLY_SHORTCUT = 11844;
  106. public final RSTile TAVERLY_SHORTCUT_BANK = new RSTile(2934,3355);
  107. public final RSTile TAVERLY_SHORTCUT_MINE = new RSTile(2938,3355);
  108. ///////////////////////////
  109.  
  110. public static final int[] PICK_IDS = { 1265, 1267, 1269, 1271, 1273, 1275, 14099, 14107,
  111. 15259, 15261 };
  112. public static final int[] ANIMATIONS = { 624, 625, 626, 627, 628, 629, 12188, 12189};
  113. public static final int[] BANK_BOOTHS = { 11402, 11758, 11402, 2213, 35647, 26972 , 34752, 782};
  114. public final int TZHAAR_BANK = 2619;
  115. public static final int[] ORE_IDS = { 434, 436, 438, 440, 442, 453, 444, 447, 449, 451, 6979, 6981, 6983 };
  116.  
  117. RSObject currRock = null;
  118. RSObject nextRock = null;
  119. int currID;
  120.  
  121. public int trys = 0;
  122. public int mined = 0;
  123. public int gemFound = 0;
  124. public int startlevel;
  125. public int startexp;
  126. public int currLevel;
  127. public int lvlGain;
  128. public int xpGained;
  129. public long millis;
  130. public int xpPerHour;
  131. public int orePerHour;
  132. public long minutes;
  133. public long hours;
  134. public long seconds;
  135. public int xpToLevel;
  136. public double percent;
  137. public long startTime = System.currentTimeMillis();
  138. public boolean run;
  139. //ROCK ID'S AND TRACKING
  140. private final int CLAY = 0;
  141. private final int COPPER = 1;
  142. private final int TIN = 2;
  143. private final int IRON = 3;
  144. private final int SILVER = 4;
  145. private final int COAL= 5;
  146. private final int GOLD = 6;
  147. private final int GRANITE = 7;
  148. private final int MITHRIL = 8;
  149. private final int ADAMANTITE = 9;
  150. private final int RUNITE = 10;
  151. private final int CONC_GOLD = 11;
  152. private final int CONC_COAL = 12;
  153. private final String[] oreID = {
  154. "11504, 11503, 11505, 9711, 9713, 15503, 15505",
  155. "14906, 14907, 5779, 5780, 5781, 11961, 11962, 11960, 9710, 9708, 9709, 11937, 11938",
  156. "11933, 11959, 11957, 11958, 11935, 11934, 9714, 9716, 5777, 5776, 5778",
  157. "14914, 14913, 2092, 2093, 11955, 11956, 11954, 9718, 9719, 9717, 37307, 37308, 37309, 21282, 21281, 5773, 5774, 5775",
  158. "37306, 37304, 37305, 11950, 11949, 11948, 15579, 15580, 15581",
  159. "3032, 3233, 11932, 11931, 11930, 2097, 2096, 5770, 5772, 5771, 11963",
  160. "5771, 9720, 9722, 2099, 2098, 34977, 34976, 5989, 5768, 5769, 45067, 45068, 2109, 2108, 15578, 15576, 15577, 32432, 32433, 32434",
  161. "6979, 6980, 6981, 6982, 6983, 6984",
  162. "3280, 3041, 11942, 11943, 11944, 5784, 5786",
  163. "11941, 11939, 5782, 5783, 3273, 3040, 29233, 29235",
  164. "45069, 45070",
  165. "45076",
  166. "5999"
  167. };
  168. ///////////////////////////
  169. public antiBan anti = new antiBan();
  170. public Thread Ban = new Thread(anti);
  171. public boolean banRun = true;
  172. public boolean showIcon = true;
  173. public int x;
  174. public int y;
  175. public double num;
  176. public int trys2;
  177. RSObject banker;
  178. public boolean mouseDown;
  179.  
  180.  
  181. public static void main(String[] args) {
  182. PhatMinerV4 thisThing = new PhatMinerV4();
  183. thisThing.onStart();
  184. }
  185.  
  186.  
  187. public void messageReceived(MessageEvent e) {
  188. String msg = e.getMessage();
  189. if (msg.contains("manage to mine two")) {
  190. mined += 2;
  191. } else if (msg.contains("manage to")) {
  192. mined++;
  193. } else if (msg.contains("just found")) {
  194. gemFound++;
  195. }
  196. }
  197.  
  198. @Override
  199. public int loop() {
  200. if (!startProgram || Location == null) {
  201. stopScript();
  202. }
  203. if (!walking.isRunEnabled() && (walking.getEnergy() > random(50,70))) {
  204. walking.setRun(true);
  205. }
  206. if (interfaces.get(18).isValid()) {
  207. interfaces.get(18).getComponent(36).doClick();
  208. }
  209. if (Location.equals("Power-Mining")) {
  210. if (calc.distanceTo(startPos) > checkDistance) {
  211. while (getMyPlayer().isMoving() && !currRock.isOnScreen()) {
  212. sleep(100);
  213. }
  214. walking.walkTileMM(startPos);
  215. }
  216. if (!shouldBank()) {
  217. currRock = getRock();
  218. if (currRock != null) {
  219. while (calc.distanceBetween(currRock.getLocation(), getMyPlayer().getLocation()) > checkDistance) {
  220. getRock();
  221. }
  222. powerMine();
  223. } else {
  224. if (menu.isOpen() && menu.contains("Drop")) {
  225. menu.doAction("Drop");
  226. }
  227. }
  228. }
  229. if (shouldBank() && !M1D1) {
  230. inventory.dropAllExcept(PICK_IDS);
  231. }
  232. } else if (Location.equals("Living Rock Cavern") || Location.equals("LRC Power-Mining")) {
  233. if (atFally.contains(getMyPlayer().getLocation())) {
  234. reEquipItems();
  235. while (calc.distanceTo(LRCDoorTile) >= 10) {
  236. if (!game.isLoggedIn()) {
  237. break;
  238. }
  239. toMineFally.traverse();
  240. }
  241. } else if (atLumby.contains(getMyPlayer().getLocation())) {
  242. reEquipItems();
  243. while (calc.distanceTo(LRCDoorTile) >= 10) {
  244. if (!game.isLoggedIn()) {
  245. break;
  246. }
  247. toMineLumby.traverse();
  248. }
  249. }
  250. if (calc.distanceTo(LRCDoorTile) < 10) {
  251. doLRCDoorAndStairs();
  252. }
  253. if (getMyPlayer().getLocation().getY() > 9000 && getMyPlayer().getLocation().getY() < 10000 && calc.distanceTo(LRCRopeTile) > 7) {
  254. toMineLRC.traverse();
  255. }
  256. if (interfaces.get(LRC_INTERFACE).isValid()) {
  257. interfaces.get(LRC_INTERFACE).getComponent(LRC_INTERFACE_COMP).doClick();
  258. while (getMyPlayer().getLocation().getY() > 6000 && !getMyPlayer().isIdle()) {
  259. sleep(300);
  260. }
  261. walking.walkTileMM(atBank);
  262. }
  263. if (calc.distanceTo(LRCRopeTile) <= 10) {
  264. doLRCRope();
  265. }
  266.  
  267. if (interfaces.get(266).isValid()) {
  268. interfaces.get(266).getComponent(1).doClick();
  269. }
  270. if (interfaces.get(18).isValid()) {
  271. interfaces.get(18).getComponent(36).doClick();
  272. }
  273. if (getMyPlayer().isInCombat() && mineOres[0].toString().equals("Concentrated Gold")) {
  274. shouldWait = false;
  275. if (calc.distanceTo(SOUTH_GOLD) <= calc.distanceTo(WEST_GOLD)) {
  276. toBankSouthLRC.traverse();
  277. } else {
  278. toBankWestLRC.traverse();
  279. }
  280. }
  281. if (getMyPlayer().isInCombat() && mineOres[0].toString().equals("Concentrated Coal")) {
  282. shouldWait = false;
  283. if (calc.distanceTo(SOUTH_COAL) <= calc.distanceTo(WEST_COAL)) {
  284. toBankSouthLRC.traverse();
  285. } else {
  286. toBankWestLRC.traverse();
  287. }
  288. }
  289.  
  290. if (Location.equals("Living Rock Cavern")) {
  291. if (shouldBank() && !nearBank() && mineOres[0].toString().equals("Concentrated Gold")) {
  292. if (calc.distanceTo(SOUTH_GOLD) <= calc.distanceTo(WEST_GOLD)) {
  293. toBankSouthLRC.traverse();
  294. } else {
  295. toBankWestLRC.traverse();
  296. }
  297. }
  298.  
  299. if (shouldBank() && !nearBank() && mineOres[0].toString().equals("Concentrated Coal")) {
  300. if (calc.distanceTo(SOUTH_COAL) <= calc.distanceTo(WEST_COAL)) {
  301. toBankSouthLRC.traverse();
  302. } else {
  303. toBankWestLRC.traverse();
  304. }
  305. }
  306.  
  307. if (shouldBank() && nearBank()) {
  308. openLRCBank();
  309. doLRCBank();
  310. return 200;
  311. }
  312. } else {
  313. if (shouldBank()) {
  314. inventory.dropAllExcept(PICK_IDS);
  315. }
  316. }
  317.  
  318.  
  319. if (!shouldBank() && nearBank() && mineOres[0].toString().equals("Concentrated Gold")) {
  320. if (!shouldBank()) {
  321. if (lastRock == -1) {
  322. while (calc.distanceTo(SOUTH_GOLD) > 5) {
  323. if (getMyPlayer().isInCombat() || !game.isLoggedIn() || getMyPlayer().getLocation().getY() > 6000 || getMyPlayer().getLocation().getY() < 5000) {
  324. break;
  325. }
  326. toSouthLRC.traverse();
  327. }
  328. } else if (lastRock == 1) {
  329. while (calc.distanceTo(WEST_GOLD) > 5) {
  330. if (getMyPlayer().isInCombat() || !game.isLoggedIn() || getMyPlayer().getLocation().getY() > 6000 || getMyPlayer().getLocation().getY() < 5000) {
  331. break;
  332. }
  333. toWestLRC.traverse();
  334. }
  335. } else if (lastRock == 2) {
  336. while (calc.distanceTo(SOUTH_GOLD) > 5) {
  337. if (getMyPlayer().isInCombat() || !game.isLoggedIn() || getMyPlayer().getLocation().getY() > 6000 || getMyPlayer().getLocation().getY() < 5000) {
  338. break;
  339. }
  340. toSouthLRC.traverse();
  341. }
  342. }
  343. }
  344. }
  345.  
  346. if (!shouldBank() && nearBank() && mineOres[0].toString().equals("Concentrated Coal")) {
  347. if (!shouldBank()) {
  348. if (lastRock == -1) {
  349. while (calc.distanceTo(SOUTH_COAL) > 5) {
  350. if (getMyPlayer().isInCombat() || !game.isLoggedIn() || getMyPlayer().getLocation().getY() > 6000 || getMyPlayer().getLocation().getY() < 5000) {
  351. break;
  352. }
  353. toSouthLRC.traverse();
  354. }
  355. } else if (lastRock == 1) {
  356. while (calc.distanceTo(WEST_COAL) > 5) {
  357. if (getMyPlayer().isInCombat() || !game.isLoggedIn() || getMyPlayer().getLocation().getY() > 6000 || getMyPlayer().getLocation().getY() < 5000) {
  358. break;
  359. }
  360. toWestLRC.traverse();
  361. }
  362. } else if (lastRock == 2) {
  363. while (calc.distanceTo(SOUTH_COAL) > 5) {
  364. if (getMyPlayer().isInCombat() || !game.isLoggedIn() || getMyPlayer().getLocation().getY() > 6000 || getMyPlayer().getLocation().getY() < 5000) {
  365. break;
  366. }
  367. toSouthLRC.traverse();
  368. }
  369. }
  370. }
  371. }
  372.  
  373.  
  374.  
  375. if (!shouldBank() && calc.distanceTo(SOUTH_GOLD) < 7 && mineOres[0].toString().equals("Concentrated Gold")) {
  376. getRock();
  377. if (currRock != null && calc.distanceTo(currRock.getLocation()) <= 7) {
  378. shouldWait = false;
  379. mineLRC();
  380. } else {
  381. lastRock = 1;
  382. if (!shouldWait) {
  383. while (calc.distanceTo(WEST_GOLD) > 5) {
  384. if (getMyPlayer().isInCombat() || !game.isLoggedIn() || getMyPlayer().getLocation().getY() > 6000 || getMyPlayer().getLocation().getY() < 5000) {
  385. break;
  386. }
  387. toWestfromSouth.traverse();
  388. shouldWait = true;
  389. }
  390. } else {
  391. if (Location.equals("LRC Power-Mining") && inventory.getCount(goldID) > 0) {
  392. inventory.dropAllExcept(PICK_IDS);
  393. }
  394. return 300;
  395. }
  396. }
  397. }
  398.  
  399. if (!shouldBank() && calc.distanceTo(WEST_GOLD) < 7 && mineOres[0].toString().equals("Concentrated Gold")) {
  400. getRock();
  401. if (currRock != null && calc.distanceTo(currRock.getLocation()) <= 7) {
  402. shouldWait = false;
  403. mineLRC();
  404. } else {
  405. lastRock = 2;
  406. if (!shouldWait) {
  407. while (calc.distanceTo(SOUTH_GOLD) > 5) {
  408. if (getMyPlayer().isInCombat() || !game.isLoggedIn() || getMyPlayer().getLocation().getY() > 6000 || getMyPlayer().getLocation().getY() < 5000) {
  409. break;
  410. }
  411. toSouthfromWest.traverse();
  412. shouldWait = true;
  413. }
  414. } else {
  415. if (Location.equals("LRC Power-Mining") && inventory.getCount(goldID) > 0) {
  416. inventory.dropAllExcept(PICK_IDS);
  417. }
  418. return 300;
  419. }
  420. }
  421. }
  422.  
  423. if (!shouldBank() && calc.distanceTo(SOUTH_COAL) < 7 && mineOres[0].toString().equals("Concentrated Coal")) {
  424. getRock();
  425. if (currRock != null && calc.distanceTo(currRock.getLocation()) <= 7) {
  426. shouldWait = false;
  427. mineLRC();
  428. } else {
  429. lastRock = 1;
  430. if (!shouldWait) {
  431. while (calc.distanceTo(WEST_COAL) > 5) {
  432. if (getMyPlayer().isInCombat() || !game.isLoggedIn() || getMyPlayer().getLocation().getY() > 6000 || getMyPlayer().getLocation().getY() < 5000) {
  433. break;
  434. }
  435. toWestfromSouth.traverse();
  436. shouldWait = true;
  437. }
  438. } else {
  439. if (Location.equals("LRC Power-Mining") && inventory.getCount(coalID) > 0) {
  440. inventory.dropAllExcept(PICK_IDS);
  441. }
  442. return 300;
  443. }
  444. }
  445. }
  446.  
  447. if (!shouldBank() && calc.distanceTo(WEST_COAL) < 7 && mineOres[0].toString().equals("Concentrated Coal")) {
  448. getRock();
  449. if (currRock != null && calc.distanceTo(currRock.getLocation()) <= 7) {
  450. shouldWait = false;
  451. mineLRC();
  452. } else {
  453. lastRock = 2;
  454. if (!shouldWait) {
  455. while (calc.distanceTo(SOUTH_COAL) > 5) {
  456. if (getMyPlayer().isInCombat() || !game.isLoggedIn() || getMyPlayer().getLocation().getY() > 6000 || getMyPlayer().getLocation().getY() < 5000) {
  457. break;
  458. }
  459. toSouthfromWest.traverse();
  460. shouldWait = true;
  461. }
  462. } else {
  463. if (Location.equals("LRC Power-Mining") && inventory.getCount(coalID) > 0) {
  464. inventory.dropAllExcept(PICK_IDS);
  465. }
  466. return 300;
  467. }
  468. }
  469. }
  470. } else if (Location.equals("Mining Guild")) {
  471. if (!shouldBank() && atMine.contains(players.getMyPlayer().getLocation())) {
  472. currRock = getRock();
  473. if (currRock != null) {
  474. mine();
  475. }
  476. }
  477. if (shouldBank() && calc.distanceTo(nearLadderUp) < 5) {
  478. doLadder(LadderUp);
  479. while (!getMyPlayer().isIdle()) {
  480. sleep(300);
  481. }
  482. }
  483. if (!shouldBank() && calc.distanceTo(nearLadderDown) < 7) {
  484. doLadder(LadderDown);
  485. while (!getMyPlayer().isIdle()) {
  486. sleep(300);
  487. }
  488. }
  489. if (shouldBank() && !nearBank() && getMyPlayer().getLocation().getY() < 7000) {
  490. toBank.traverse();
  491. }
  492. if (shouldBank() && !nearBank() && getMyPlayer().getLocation().getY() > 7000) {
  493. toLadderBottom.traverse();
  494. }
  495. if (shouldBank() && nearBank()) {
  496. if (openBank()) {
  497. if (doBank()) {
  498. //yay
  499. }
  500. }
  501. }
  502. if (!shouldBank() && !atMine.contains(players.getMyPlayer().getLocation()) && getMyPlayer().getLocation().getY() < 7000) {
  503. toLadderTop.traverse();
  504. }
  505. if (!shouldBank() && !atMine.contains(players.getMyPlayer().getLocation()) && getMyPlayer().getLocation().getY() > 7000) {
  506. toMine.traverse();
  507. }
  508. } else if (Location.equals("Taverly")) {
  509. if (!shouldBank() && atMine.contains(players.getMyPlayer().getLocation())) {
  510. currRock = getRock();
  511. if (currRock != null) {
  512. mine();
  513. }
  514. }
  515. if (shouldBank() && calc.distanceTo(TAVERLY_SHORTCUT_BANK) < 5 && getMyPlayer().getLocation().getX() < 2936) {
  516. doShortcut();
  517. while (!getMyPlayer().isIdle()) {
  518. sleep(300);
  519. }
  520. }
  521. if (!shouldBank() && calc.distanceTo(TAVERLY_SHORTCUT_MINE) < 7 && getMyPlayer().getLocation().getX() >= 2936) {
  522. doShortcut();
  523. while (!getMyPlayer().isIdle()) {
  524. sleep(300);
  525. }
  526. }
  527. if (shouldBank() && !nearBank() && getMyPlayer().getLocation().getX() >= 2936) {
  528. toBank.traverse();
  529. }
  530. if (shouldBank() && !nearBank() && getMyPlayer().getLocation().getX() < 2936) {
  531. toLadderBottom.traverse();
  532. }
  533. if (shouldBank() && nearBank()) {
  534. if (openBank()) {
  535. if (doBank()) {
  536. //yay
  537. }
  538. }
  539. }
  540. if (!shouldBank() && !atMine.contains(players.getMyPlayer().getLocation()) && getMyPlayer().getLocation().getX() >= 2936) {
  541. toLadderTop.traverse();
  542. }
  543. if (!shouldBank() && !atMine.contains(players.getMyPlayer().getLocation()) && getMyPlayer().getLocation().getX() < 2936) {
  544. toMine.traverse();
  545. }
  546. } else if (Location.equals("Karamja Volcano")) {
  547. if (getMyPlayer().isInCombat()) {
  548. if (getMyPlayer().getLocation().getY() > 9000) {
  549. clickCave(true);
  550. sleep(10000);
  551. } else {
  552. walking.setRun(true);
  553. toBank.traverse();
  554. }
  555. }
  556. if (!shouldBank() && atMine.contains(players.getMyPlayer().getLocation())) {
  557. currRock = getRock();
  558. if (currRock != null) {
  559. mine();
  560. }
  561. }
  562. if (shouldBank() && !nearBank() && getMyPlayer().getLocation().getY() > 9000) {
  563. clickCave(true);
  564. }
  565. if (shouldBank() && !nearBank() && getMyPlayer().getLocation().getY() < 9000) {
  566. toBank.traverse();
  567. }
  568. if (shouldBank() && nearBank()) {
  569. if (openBankTzhaar()) {
  570. if (doBank()) {
  571. }
  572. }
  573. }
  574. if (!shouldBank() && !atMine.contains(players.getMyPlayer().getLocation()) && calc.distanceTo(TZHAAR_OUT_LOC) < 6) {
  575. clickCave(false);
  576. }
  577. if (!shouldBank() && !atMine.contains(players.getMyPlayer().getLocation())) {
  578. toMine.traverse();
  579. }
  580. } else {
  581. if (!shouldBank() && atMine.contains(players.getMyPlayer().getLocation())) {
  582. currRock = getRock();
  583. if (currRock != null) {
  584. mine();
  585. }
  586. }
  587. if (shouldBank() && !nearBank()) {
  588. toBank.traverse();
  589. }
  590. if (!Location.equals("TzHaar")) {
  591. if (shouldBank() && nearBank()) {
  592. if (openBank()) {
  593. if (doBank()) {
  594. }
  595. }
  596. }
  597. } else {
  598. if (shouldBank() && nearBank()) {
  599. if (openBankTzhaar()) {
  600. if (doBank()) {
  601. }
  602. }
  603. }
  604. }
  605. if (!shouldBank() && !atMine.contains(players.getMyPlayer().getLocation())) {
  606. toMine.traverse();
  607. }
  608. }
  609. return 250;
  610. }
  611.  
  612. public void reEquipItems() {
  613. RSItem [] inv = inventory.getItems();
  614. if(inventory.getCount()>0){
  615. for(int i = 0; i<3;i++){
  616. if(inv[i].getID() != coalID && inv[i].getID( )!= goldID) {
  617. if(!inv[i].doAction("Wield")) {
  618. if(!inv[i].doAction("Wear")) {
  619. inv[i].doAction("Equip");
  620. }
  621. }
  622. }
  623. }
  624. }
  625. }
  626. public void clickCave(Boolean in) {
  627. RSObject cave = null;
  628. if (in) {
  629. cave = objects.getNearest(TZHAAR_IN);
  630. } else {
  631. cave = objects.getNearest(TZHAAR_OUT);
  632. }
  633. if (cave != null) {
  634. if (cave.isOnScreen()) {
  635. cave.getModel().doClick(true);
  636. } else {
  637. walking.walkTileMM(cave.getLocation());
  638. }
  639. }
  640. sleep(500);
  641. while (getMyPlayer().isMoving()) {
  642. sleep(100);
  643. }
  644. }
  645.  
  646. public boolean openLRCBank() {
  647. RSObject bankBox = objects.getNearest(LRC_BANK);
  648. if (bankBox != null) {
  649. try {
  650. if (bankBox != null && bankBox.isOnScreen()) {
  651. bankBox.getModel().doAction("Deposit");
  652. sleep(500);
  653. while (players.getMyPlayer().isMoving()) {
  654. sleep(100);
  655. }
  656. sleep(1000);
  657. } else {
  658. walking.walkTileMM(bankBox.getLocation());
  659. return false;
  660. }
  661. } catch (Exception e) {
  662.  
  663. }
  664. return bank.isDepositOpen();
  665. } else {
  666. return false;
  667. }
  668. }
  669.  
  670. public boolean doLRCBank() {
  671. if (bank.isDepositOpen()) {
  672. bank.depositAllExcept(PICK_IDS);
  673. bank.close();
  674. return true;
  675. } else {
  676. return false;
  677. }
  678. }
  679.  
  680. public void doLRCDoorAndStairs() {
  681. LRCDoor = null;
  682. LRCDoor = objects.getNearest(LRC_DOOR);
  683. if (LRCDoor != null) {
  684. camera.turnTo(LRCDoor);
  685. LRCDoor.getModel().doAction("Open");
  686. sleep(500);
  687. while (getMyPlayer().isMoving()) {
  688. sleep(100);
  689. }
  690. }
  691. LRCDoor = objects.getNearest(LRC_DOOR);
  692. if (LRCDoor == null || calc.distanceTo(LRCDoor.getLocation()) > 10) {
  693. LRCStairs = objects.getNearest(LRC_STAIRS);
  694. if (LRCStairs != null && LRCStairs.isOnScreen()) {
  695. LRCStairs.getModel().doAction("Climb-down");
  696. sleep(500);
  697. } else if (LRCStairs != null) {
  698. walking.walkTileMM(LRCStairs.getLocation());
  699. }
  700. }
  701. sleep(500);
  702. }
  703.  
  704. public void doLRCRope() {
  705. LRCRope = null;
  706. LRCRope = objects.getNearest(LRC_ROPE);
  707. if (LRCRope != null) {
  708. if (LRCRope.isOnScreen()) {
  709. try {
  710. LRCRope.getModel().doAction("Climb");
  711. sleep(500);
  712. while (getMyPlayer().isMoving()) {
  713. sleep(100);
  714. }
  715. } catch (Exception e) {
  716.  
  717. }
  718. } else {
  719. walking.walkTileMM(LRCRope.getLocation());
  720. sleep(500);
  721. while (getMyPlayer().isMoving()) {
  722. sleep(100);
  723. }
  724. }
  725. }
  726. }
  727.  
  728. public void doLadder(int ladderID) {
  729. RSObject Ladder = objects.getNearest(ladderID);
  730. if (Ladder != null) {
  731. Ladder.getModel().doAction("Climb");
  732. sleep(500);
  733. while (getMyPlayer().isMoving()) {
  734. sleep(100);
  735. }
  736. }
  737. }
  738.  
  739. public void doShortcut() {
  740. RSObject Shortcut = objects.getNearest(TAVERLY_SHORTCUT);
  741. if (Shortcut != null) {
  742. Shortcut.getModel().doClick(true);
  743. sleep(500);
  744. while (getMyPlayer().isMoving()) {
  745. sleep(100);
  746. }
  747. }
  748. }
  749.  
  750. public class antiBan implements Runnable {
  751. private int randomProd;
  752. private int randomMore;
  753. private int randomNum;
  754. public void run() {
  755. while (banRun) {
  756. antiBan3();
  757. sleep(1500,2000);
  758. }
  759. }
  760. public void antiBan3() {
  761. randomProd = random(1, 600);
  762. if (randomProd == 1) {
  763. randomMore = random(1, 5);
  764. if (randomMore == 1) {
  765. if (game.getCurrentTab() != 1) {
  766. game.openTab(1);
  767. sleep(150, 300);
  768. mouse.move(random(678, 728), random(213, 232));
  769. sleep(1000,1100);
  770. } else {
  771. mouse.move(random(678, 728), random(213, 232));
  772. sleep(1000,1100);
  773. }
  774. } else {
  775. }
  776. }
  777. randomNum = random(1, 40);
  778. if (randomNum == 15) {
  779. if (currRock != null) {
  780. camera.turnTo(currRock);
  781. return;
  782. }
  783. camera.setAngle(random(1,360));
  784. }
  785.  
  786. if (randomNum == 6) {
  787. camera.setPitch(random(50, 68));
  788. }
  789.  
  790. if (randomNum == 8) {
  791. camera.setPitch(random(68, 90));
  792. } else {}
  793. }
  794. }
  795.  
  796.  
  797.  
  798.  
  799. @Override
  800. public boolean onStart(){
  801. gui.setVisible(true);
  802. startlevel = skills.getCurrentLevel(Skills.MINING);
  803. startexp = skills.getCurrentExp(Skills.MINING);
  804. while (gui.isVisible()) {
  805. }
  806. mouse.setSpeed(4);
  807. camera.setAngle(random(1,360));
  808. Ban.start();
  809. return true;
  810. }
  811.  
  812. public void mouseClicked(MouseEvent e) {
  813. p = e.getPoint();
  814. if (tab1.contains(p)) {
  815. tab = 1;
  816. }
  817. if (tab2.contains(p)) {
  818. tab = 2;
  819. }
  820. }
  821.  
  822. public void mouseEntered(MouseEvent e) {
  823. }
  824.  
  825. public void mouseExited(MouseEvent e) {
  826. }
  827.  
  828. public void mouseReleased(MouseEvent e) {
  829. }
  830.  
  831. public void mousePressed(MouseEvent e) {
  832. }
  833.  
  834. @Override
  835. public void onFinish(){
  836. banRun = false;
  837. log("Thanks for using PhatMiner!");
  838. }
  839.  
  840. private final Color color2 = new Color(0, 0, 0);
  841. private final Color color4 = new Color(250, 0, 0);
  842. private final Font font1 = new Font("Arial", 0, 14);
  843. private final Font font2 = new Font("Arial", 0, 12);
  844. private final Color color5 = new Color(0, 255, 0);
  845. private final Font font3 = new Font("Arial", 1, 20);
  846.  
  847.  
  848. public void onRepaint(Graphics g) {
  849. java.text.DecimalFormat df = new
  850. java.text.DecimalFormat("##.##");
  851. currLevel = skills.getCurrentLevel(Skills.MINING);
  852. lvlGain = currLevel - startlevel;
  853. xpGained = skills.getCurrentExp(Skills.MINING) - startexp;
  854. millis = System.currentTimeMillis() - startTime;
  855. num = ((3600000.0 / (double) millis));
  856. xpPerHour = (int)(num * xpGained);
  857. orePerHour = (int)(num * mined);
  858. hours = millis / (1000 * 60 * 60);
  859. millis -= hours * (1000 * 60 * 60);
  860. minutes = millis / (1000 * 60);
  861. millis -= minutes * (1000 * 60);
  862. seconds = millis / 1000;
  863. xpToLevel = skills.getExpToNextLevel(Skills.MINING);
  864. percent = getPercentToNextLevel(Skills.MINING);
  865. int nextLevel = currLevel +1;
  866. //Paint
  867. if(game.getCurrentTab() == Game.TAB_INVENTORY){
  868. g.setColor(Color.green);
  869. g.fillRect(tab1.x, tab1.y, tab1.width, tab1.height);
  870. g.setFont(font3);
  871. g.setColor(Color.BLACK);
  872. g.drawString("SHOW PAINT", 577, 457);
  873.  
  874. if (showPaint) { //Shows paints
  875. if (tab == 1) {
  876. g.setColor(Color.GREEN);
  877. g.fillRect(tab2.x, tab2.y, tab2.width, tab2.height);
  878. g.setColor(color2);
  879. g.fillRect(547, 204, 190, 261);
  880. g.setColor(color2);
  881. g.drawRect(547, 204, 190, 261);
  882. g.setColor(color4);
  883. g.fillRoundRect(552, 440, 171, 17, 15, 15);
  884. g.setColor(color4);
  885. g.drawRoundRect(552, 440, 171, 17, 15, 15);
  886.  
  887. //PERCENT BAR
  888. g.setColor(color5);
  889. g.fillRoundRect(552, 440, (int)(171*(percent/100)), 17, 15, 15);
  890. g.setColor(color5);
  891. g.drawRoundRect(552, 440, (int)(171*(percent/100)), 17, 15, 15);
  892. g.setFont(font1);
  893. g.setColor(color2);
  894. if(currLevel != 99) { nextLevel = currLevel + 1; } else { nextLevel = 0;}
  895. if(nextLevel != 0) { g.drawString(df.format(percent) + "% To " + nextLevel, 590, 453); } else { g.drawString("Congratulatiosn on 99 ", 590, 5453);}
  896.  
  897. //MAIN PAINT
  898. g.setColor(color4);
  899. g.setFont(font2);
  900. g.drawString("Location: " + Location, 580, 230);
  901. if (Arrays.toString(mineOres).length() >= 21) {
  902. g.drawString("Mining: " + Arrays.toString(mineOres).substring(1,20) + "...", 580, 250);
  903. } else {
  904. g.drawString("Mining: " + Arrays.toString(mineOres), 580, 250);
  905. }
  906. g.drawString("Current Level: " + currLevel + "(+" + lvlGain + ")", 580, 270);
  907. g.drawString("Time Running: " + hours + ":" + minutes + ":" + seconds, 580, 290);
  908. g.drawString("Exp Gained: " + xpGained, 580, 310);
  909.  
  910. g.drawString("Exp Per Hour: " + xpPerHour, 580, 330);
  911. g.drawString("Exp to Level: " + xpToLevel, 580, 350);
  912. g.drawString("Ores Mined: " + mined, 580, 370);
  913. g.drawString("Ores Per Hour: " + orePerHour, 580, 390);
  914. g.drawString("Gems Mined: " + gemFound, 580, 410);
  915.  
  916. //TIME TILL LVL
  917. try {
  918. if (xpPerHour > 0) {
  919. int sTNL = (xpToLevel) / (xpPerHour / 3600);
  920. int hTNL = sTNL / (60 * 60);
  921. sTNL -= hTNL * (60 * 60);
  922. int mTNL = sTNL / 60;
  923. sTNL -= mTNL * 60;
  924. int msTNL = sTNL / 60;
  925. sTNL -= msTNL * 60;
  926. g.drawString("TTL: " + (int)hTNL + ":" + (int)mTNL + ":" + (int)sTNL, 580, 430);
  927. } else {
  928. g.drawString("TTL: --:--:--", 580, 430);
  929. }
  930. } catch(Exception e) {
  931. g.drawString("TTL: -1:-1:-1", 580, 430);
  932. }
  933. }
  934. }
  935. }
  936. /////////////
  937.  
  938.  
  939. }
  940.  
  941. public double getPercentToNextLevel(final int index) {
  942. final int lvl = skills.getRealLevel(index);
  943. if (lvl == 99) {
  944. return 0;
  945. }
  946. final double xpTotal = Skills.XP_TABLE[lvl + 1] - Skills.XP_TABLE[lvl];
  947. if (xpTotal == 0) {
  948. return 0;
  949. }
  950. final double xpDone = skills.getCurrentExp(index) - Skills.XP_TABLE[lvl];
  951. return 100 * xpDone / xpTotal;
  952. }
  953.  
  954. public boolean shouldBank() {
  955. if (inventory.isFull()) {
  956. return true;
  957. } else {
  958. return false;
  959. }
  960. }
  961.  
  962. public boolean nearBank() {
  963. if (calc.distanceTo(atBank) <= 10) {
  964. return true;
  965. }
  966. return false;
  967. }
  968.  
  969. public boolean openBank() {
  970. try {
  971. banker = objects.getNearest(BANK_BOOTHS);
  972. if (banker == null) {
  973. toBank.traverse();
  974. return false;
  975. }
  976. if (!banker.isOnScreen()) {
  977. walking.walkTileMM(banker.getLocation(),2,2);
  978. }
  979. trys2 = 0;
  980. while (!banker.isOnScreen()) {
  981. trys2++;
  982. if (trys2 > 10) {
  983. walking.walkTileMM(atBank);
  984. banker = objects.getNearest(BANK_BOOTHS);
  985. trys2 = 0;
  986. }
  987. if (banker != null) {
  988. if (banker.isOnScreen()) {
  989. break;
  990. }
  991. }
  992. sleep(100);
  993. }
  994. trys++;
  995. if (trys > 10) {
  996. walking.walkTileMM(atBank);
  997. trys = 0;
  998. }
  999. banker.doAction("Use-quickly");
  1000. sleep(500);
  1001. while (players.getMyPlayer().isMoving()) {
  1002. sleep(100);
  1003. }
  1004. sleep(300);
  1005. return bank.isOpen();
  1006. } catch (Exception e) {
  1007. return false;
  1008. }
  1009. }
  1010.  
  1011. public boolean openBankTzhaar() {
  1012. try {
  1013. RSNPC banker1 = npcs.getNearest(TZHAAR_BANK);
  1014. if (banker1 == null) {
  1015. toBank.traverse();
  1016. return false;
  1017. }
  1018. if (!banker1.isOnScreen()) {
  1019. walking.walkTileMM(banker1.getLocation(),2,2);
  1020. }
  1021. trys2 = 0;
  1022. while (!banker1.isOnScreen()) {
  1023. trys2++;
  1024. if (trys2 > 10) {
  1025. walking.walkTileMM(atBank);
  1026. banker1 = npcs.getNearest(TZHAAR_BANK);
  1027. trys2 = 0;
  1028. }
  1029. if (banker1 != null) {
  1030. if (banker1.isOnScreen()) {
  1031. break;
  1032. }
  1033. }
  1034. sleep(100);
  1035. }
  1036. trys++;
  1037. if (trys > 10) {
  1038. walking.walkTileMM(atBank);
  1039. trys = 0;
  1040. }
  1041. banker1.doAction("Bank");
  1042. sleep(500);
  1043. while (players.getMyPlayer().isMoving()) {
  1044. sleep(100);
  1045. }
  1046. sleep(300);
  1047. return bank.isOpen();
  1048. } catch (Exception e) {
  1049. return false;
  1050. }
  1051. }
  1052.  
  1053. public boolean doBank() {
  1054. if (bank.isOpen()) {
  1055. if (bank.depositAllExcept(PICK_IDS)) {
  1056. return true;
  1057. }
  1058. }
  1059. return false;
  1060. }
  1061.  
  1062. public boolean mineLRC() {
  1063. while (isMining()) {
  1064. if (!checkRock(currRock)) {
  1065. return false;
  1066. }
  1067. if (inventory.isFull()) {
  1068. return false;
  1069. }
  1070. sleep(300);
  1071. }
  1072. while (players.getMyPlayer().isMoving()) {
  1073. sleep(100);
  1074. }
  1075. sleep(750);
  1076. try {
  1077. if (currRock != null) {
  1078. } else {
  1079. return false;
  1080. }
  1081. if (currRock.isOnScreen() && !isMining() && checkRock(currRock)) {
  1082. mouse.move(currRock.getModel().getPoint());
  1083. if (menu.getActions()[0].toString().contains("Mine")) {
  1084. mouse.click(true);
  1085. }
  1086. }
  1087. } catch (Exception e) {
  1088. }
  1089. if (currRock == null) {
  1090. return false;
  1091. }
  1092. sleep(700);
  1093. while (players.getMyPlayer().isMoving()) {
  1094. sleep(100);
  1095. }
  1096. sleep(600);
  1097. while (isMining()) {
  1098. if (!checkRock(currRock)) {
  1099. return false;
  1100. }
  1101. if (inventory.isFull()) {
  1102. return false;
  1103. }
  1104. sleep(300);
  1105. }
  1106. return true;
  1107. }
  1108.  
  1109. public boolean powerMine() {
  1110. while (isMining()) {
  1111. if (!checkRock(currRock)) {
  1112. return false;
  1113. }
  1114. }
  1115. if (menu.isOpen() && menu.contains("Drop")) {
  1116. menu.doAction("Drop");
  1117. }
  1118. while (players.getMyPlayer().isMoving()) {
  1119. sleep(100);
  1120. }
  1121. try {
  1122. if (currRock != null) {
  1123. while (calc.distanceBetween(currRock.getLocation(), getMyPlayer().getLocation()) > checkDistance) {
  1124. getRock();
  1125. }
  1126. } else {
  1127. return false;
  1128. }
  1129. } catch (Exception e) {}
  1130. if (currRock.isOnScreen() && !isMining() && checkRock(currRock)) {
  1131. currRock.getModel().doAction("Mine");
  1132. }
  1133. if (currRock == null) {
  1134. return false;
  1135. }
  1136. sleep(700);
  1137. if (M1D1) {
  1138. if (inventory.getCount(ORE_IDS) > 0) {
  1139. inventory.getItem(ORE_IDS).doClick(false);
  1140. if (menu.contains("Drop") && menu.isOpen()) {
  1141. mouse.move(new Point(menu.getLocation().x + random(15,50), menu.getLocation().y + random(38,52)));
  1142. }
  1143. }
  1144. }
  1145. while (players.getMyPlayer().isMoving()) {
  1146. sleep(100);
  1147. }
  1148. sleep(600);
  1149. while (isMining()) {
  1150. if (!checkRock(currRock)) {
  1151. getRock();
  1152. if (currRock != null) {
  1153. currRock.getModel().doAction("Mine");
  1154. }
  1155. }
  1156. sleep(100);
  1157. }
  1158. if (menu.isOpen() && menu.contains("Drop")) {
  1159. menu.doAction("Drop");
  1160. }
  1161. return true;
  1162. }
  1163.  
  1164.  
  1165. public boolean mine() {
  1166. while (isMining()) {
  1167. if (nextRock != null) {
  1168. hoverRock(nextRock);
  1169. }
  1170. if (!checkRock(currRock)) {
  1171. if (nextRock != null) {
  1172. currRock = nextRock;
  1173. nextRock = null;
  1174. if (calc.distanceTo(currRock.getLocation()) < checkDistance) {
  1175. if (calc.distanceBetween(mouse.getLocation(), calc.tileToScreen(currRock.getLocation())) > 10 ) {
  1176. mouse.move(calc.tileToScreen(currRock.getLocation()),2,2);
  1177. }
  1178. if (menu.getActions()[0].toString().contains("Mine") && !shouldBank()) {
  1179. mouse.click(true);
  1180. sleep(700);
  1181. } else {
  1182. currRock.getModel().doAction("Mine");
  1183. sleep(700);
  1184. }
  1185. }
  1186. } else {
  1187. currRock = getRock();
  1188. if (currRock != null && calc.distanceTo(currRock.getLocation()) < checkDistance) {
  1189. if (calc.distanceBetween(mouse.getLocation(), calc.tileToScreen(currRock.getLocation())) > 10 ) {
  1190. mouse.move(calc.tileToScreen(currRock.getLocation()),2,2);
  1191. }
  1192. if (menu.getActions()[0].toString().contains("Mine") && !shouldBank()) {
  1193. mouse.click(true);
  1194. sleep(700);
  1195. } else {
  1196. currRock.getModel().doAction("Mine");
  1197. sleep(700);
  1198. }
  1199. }
  1200. }
  1201. }
  1202. }
  1203. if (currRock != null) {
  1204. while (players.getMyPlayer().isMoving() && !currRock.isOnScreen()) {
  1205. sleep(100);
  1206. }
  1207. }
  1208. try {
  1209. if (currRock.isOnScreen() && !isMining() && checkRock(currRock) && calc.distanceTo(currRock.getLocation()) < checkDistance) {
  1210. if (calc.distanceBetween(mouse.getLocation(), calc.tileToScreen(currRock.getLocation())) > 10 ) {
  1211. mouse.move(calc.tileToScreen(currRock.getLocation()),2,2);
  1212. }
  1213. if (menu.getActions()[0].toString().contains("Mine") && !shouldBank()) {
  1214. mouse.click(true);
  1215. } else {
  1216. currRock.getModel().doAction("Mine");
  1217. }
  1218. nextRock = null;
  1219. } else if (!currRock.isOnScreen() && !isMining() && calc.distanceTo(currRock.getLocation()) < checkDistance) {
  1220. if (calc.tileOnMap(currRock.getLocation())) {
  1221. walking.walkTileMM(currRock.getLocation(),2,2);
  1222. } else {
  1223. x = getMyPlayer().getLocation().getX() + ((currRock.getLocation().getX() - getMyPlayer().getLocation().getX())/2);
  1224. y = getMyPlayer().getLocation().getY() + ((currRock.getLocation().getY() - getMyPlayer().getLocation().getY())/2);
  1225. walking.walkTileMM(new RSTile(x,y));
  1226. }
  1227. }
  1228. } catch (Exception e) {}
  1229. if (currRock == null) {
  1230. return false;
  1231. }
  1232. sleep(700);
  1233. while (players.getMyPlayer().isMoving()) {
  1234. sleep(100);
  1235. }
  1236. sleep(800);
  1237. if (nextRock == null) {
  1238. getSecondNearest(currRock);
  1239. }
  1240.  
  1241. while (isMining()) {
  1242. if (nextRock != null) {
  1243. hoverRock(nextRock);
  1244. }
  1245. if (!checkRock(currRock)) {
  1246. if (nextRock != null) {
  1247. currRock = nextRock;
  1248. nextRock = null;
  1249. if (calc.distanceTo(currRock.getLocation()) < checkDistance) {
  1250. if (calc.distanceBetween(mouse.getLocation(), calc.tileToScreen(currRock.getLocation())) > 10 ) {
  1251. mouse.move(calc.tileToScreen(currRock.getLocation()),2,2);
  1252. }
  1253. if (menu.getActions()[0].toString().contains("Mine") && !shouldBank()) {
  1254. mouse.click(true);
  1255. sleep(700);
  1256. } else {
  1257. currRock.getModel().doAction("Mine");
  1258. sleep(700);
  1259. }
  1260. }
  1261. } else {
  1262. getRock();
  1263. try {
  1264. if (currRock != null && calc.distanceTo(currRock.getLocation()) < checkDistance) {
  1265. if (calc.distanceBetween(mouse.getLocation(), calc.tileToScreen(currRock.getLocation())) > 10 ) {
  1266. mouse.move(calc.tileToScreen(currRock.getLocation()),2,2);
  1267. }
  1268. if (menu.getActions()[0].toString().contains("Mine") && !shouldBank()) {
  1269. mouse.click(true);
  1270. sleep(700);
  1271. } else {
  1272. currRock.getModel().doAction("Mine");
  1273. sleep(700);
  1274. }
  1275. }
  1276. } catch (Exception e) {
  1277.  
  1278. }
  1279. }
  1280. }
  1281. }
  1282.  
  1283. return true;
  1284. }
  1285.  
  1286. public boolean isMining() {
  1287. for (int i = 0; i < ANIMATIONS.length; i++) {
  1288. if (players.getMyPlayer().getAnimation() == ANIMATIONS[i]) {
  1289. return true;
  1290. }
  1291. }
  1292. return false;
  1293. }
  1294.  
  1295. public void hoverRock(RSObject Rock) {
  1296. int i = 0;
  1297. while (!menu.getItems()[0].toString().contains("Mine") && calc.distanceBetween(calc.tileToScreen(Rock.getLocation()), mouse.getLocation()) > 10) {
  1298. mouse.move(calc.tileToScreen(Rock.getLocation()));
  1299. i++;
  1300. if (i > 20) {
  1301. return;
  1302. }
  1303. }
  1304. }
  1305.  
  1306. public boolean checkRock(RSObject rock) {
  1307. if (rock != null) {
  1308. try {
  1309. RSObject current = objects.getTopAt(currRock.getLocation());
  1310. if (current.getID() == currID) {
  1311. return true;
  1312. } else {
  1313. return false;
  1314. }
  1315. } catch (Exception e) {
  1316. }
  1317. }
  1318. return false;
  1319. }
  1320.  
  1321.  
  1322.  
  1323. public RSObject getRock() {
  1324. int[] ids = {};
  1325. String[] sIDS;
  1326. for (int i=mineOres.length-1; i>=0; i--) {
  1327. if (mineOres[i].equals("Concentrated Gold")) {
  1328. sIDS = oreID[CONC_GOLD].split(", ");
  1329. try {
  1330. ids = toIntArray(sIDS);
  1331. } catch (Exception ex) {
  1332. log(ex);
  1333. return null;
  1334. }
  1335. } else if (mineOres[i].equals("Concentrated Coal")) {
  1336. sIDS = oreID[CONC_COAL].split(", ");
  1337. try {
  1338. ids = toIntArray(sIDS);
  1339.  
  1340. } catch (Exception ex) {
  1341. return null;
  1342. }
  1343. } else if (mineOres[i].equals("Runite")) {
  1344. sIDS = oreID[RUNITE].split(", ");
  1345. try {
  1346. ids = toIntArray(sIDS);
  1347.  
  1348. } catch (Exception ex) {
  1349. return null;
  1350. }
  1351. } else if (mineOres[i].equals("Adamantite")) {
  1352. sIDS = oreID[ADAMANTITE].split(", ");
  1353. try {
  1354. ids = toIntArray(sIDS);
  1355.  
  1356. } catch (Exception ex) {
  1357. return null;
  1358. }
  1359. } else if (mineOres[i].equals("Mithril")) {
  1360. sIDS = oreID[MITHRIL].split(", ");
  1361. try {
  1362. ids = toIntArray(sIDS);
  1363.  
  1364. } catch (Exception ex) {
  1365. return null;
  1366. }
  1367. } else if (mineOres[i].equals("Granite")) {
  1368. sIDS = oreID[GRANITE].split(", ");
  1369. try {
  1370. ids = toIntArray(sIDS);
  1371.  
  1372. } catch (Exception ex) {
  1373. return null;
  1374. }
  1375. } else if (mineOres[i].equals("Gold")) {
  1376. sIDS = oreID[GOLD].split(", ");
  1377. try {
  1378. ids = toIntArray(sIDS);
  1379.  
  1380. } catch (Exception ex) {
  1381. return null;
  1382. }
  1383. } else if (mineOres[i].equals("Coal")) {
  1384. sIDS = oreID[COAL].split(", ");
  1385. try {
  1386. ids = toIntArray(sIDS);
  1387.  
  1388. } catch (Exception ex) {
  1389. return null;
  1390. }
  1391. } else if (mineOres[i].equals("Silver")) {
  1392. sIDS = oreID[SILVER].split(", ");
  1393. try {
  1394. ids = toIntArray(sIDS);
  1395.  
  1396. } catch (Exception ex) {
  1397. return null;
  1398. }
  1399. } else if (mineOres[i].equals("Iron")) {
  1400. sIDS = oreID[IRON].split(", ");
  1401. try {
  1402. ids = toIntArray(sIDS);
  1403.  
  1404. } catch (Exception ex) {
  1405. return null;
  1406. }
  1407. } else if (mineOres[i].equals("Tin")) {
  1408. sIDS = oreID[TIN].split(", ");
  1409. try {
  1410. ids = toIntArray(sIDS);
  1411.  
  1412. } catch (Exception ex) {
  1413. return null;
  1414. }
  1415. } else if (mineOres[i].equals("Copper")) {
  1416. sIDS = oreID[COPPER].split(", ");
  1417. try {
  1418. ids = toIntArray(sIDS);
  1419. } catch (Exception ex) {
  1420. return null;
  1421. }
  1422. } else if (mineOres[i].equals("Clay")) {
  1423. sIDS = oreID[CLAY].split(", ");
  1424. try {
  1425. ids = toIntArray(sIDS);
  1426. } catch (Exception ex) {
  1427. return null;
  1428. }
  1429. }
  1430.  
  1431. currRock = objects.getNearest(ids);
  1432. if (currRock != null) {
  1433. if (calc.distanceBetween(currRock.getLocation(), getMyPlayer().getLocation()) > checkDistance) {
  1434. currRock = null;
  1435. }
  1436. if ((currRock != null && !Location.equals("Power-Mining") && !Location.equals("Living Rock Cavern") && !Location.equals("LRC Power-Mining"))) {
  1437. try {
  1438. if (!atMine.contains(currRock.getLocation())) {
  1439. currRock = null;
  1440. }
  1441. } catch (Exception e) {
  1442. log(Arrays.toString(e.getStackTrace()));
  1443. currRock = null;
  1444. }
  1445. }
  1446. }
  1447. if (currRock != null) {
  1448. currID = currRock.getID();
  1449. return currRock;
  1450. }
  1451. }
  1452. return null;
  1453. }
  1454.  
  1455. public RSObject getSecondNearest(final RSObject curRock) {
  1456. int[] ids = {};
  1457. String[] sIDS;
  1458. for (int i=mineOres.length-1; i>=0; i--) {
  1459. if (mineOres[i].equals("Runite")) {
  1460. sIDS = oreID[RUNITE].split(", ");
  1461. try {
  1462. ids = toIntArray(sIDS);
  1463.  
  1464. } catch (Exception ex) { return null; }
  1465. } else if (mineOres[i].equals("Adamantite")) {
  1466. sIDS = oreID[ADAMANTITE].split(", ");
  1467. try {
  1468. ids = toIntArray(sIDS);
  1469.  
  1470. } catch (Exception ex) { return null; }
  1471. } else if (mineOres[i].equals("Mithril")) {
  1472. sIDS = oreID[MITHRIL].split(", ");
  1473. try {
  1474. ids = toIntArray(sIDS);
  1475.  
  1476. } catch (Exception ex) { return null; }
  1477. } else if (mineOres[i].equals("Granite")) {
  1478. sIDS = oreID[GRANITE].split(", ");
  1479. try {
  1480. ids = toIntArray(sIDS);
  1481.  
  1482. } catch (Exception ex) { return null; }
  1483. } else if (mineOres[i].equals("Gold")) {
  1484. sIDS = oreID[GOLD].split(", ");
  1485. try {
  1486. ids = toIntArray(sIDS);
  1487.  
  1488. } catch (Exception ex) { return null; }
  1489. } else if (mineOres[i].equals("Coal")) {
  1490. sIDS = oreID[COAL].split(", ");
  1491. try {
  1492. ids = toIntArray(sIDS);
  1493.  
  1494. } catch (Exception ex) { return null; }
  1495. } else if (mineOres[i].equals("Silver")) {
  1496. sIDS = oreID[SILVER].split(", ");
  1497. try {
  1498. ids = toIntArray(sIDS);
  1499.  
  1500. } catch (Exception ex) { return null; }
  1501. } else if (mineOres[i].equals("Iron")) {
  1502. sIDS = oreID[IRON].split(", ");
  1503. try {
  1504. ids = toIntArray(sIDS);
  1505.  
  1506. } catch (Exception ex) { return null; }
  1507. } else if (mineOres[i].equals("Tin")) {
  1508. sIDS = oreID[TIN].split(", ");
  1509. try {
  1510. ids = toIntArray(sIDS);
  1511.  
  1512. } catch (Exception ex) { return null; }
  1513. } else if (mineOres[i].equals("Copper")) {
  1514. sIDS = oreID[COPPER].split(", ");
  1515. try {
  1516. ids = toIntArray(sIDS);
  1517.  
  1518. } catch (Exception ex) { return null; }
  1519. } else if (mineOres[i].equals("Clay")) {
  1520. sIDS = oreID[CLAY].split(", ");
  1521. try {
  1522. ids = toIntArray(sIDS);
  1523.  
  1524. } catch (Exception ex) { return null; }
  1525. }
  1526.  
  1527.  
  1528. nextRock = checkSecondNearest(curRock, ids);
  1529.  
  1530. if (nextRock != null) {
  1531. return nextRock;
  1532. }
  1533. }
  1534. return null;
  1535. }
  1536.  
  1537. public RSObject checkSecondNearest(final RSObject curRock, final int[] ids) {
  1538. return objects.getNearest(new Filter<RSObject>() {
  1539. public boolean accept(RSObject o) {
  1540. if(curRock.equals(o)) {
  1541. return false;
  1542. }
  1543. if (calc.distanceBetween(o.getLocation(), getMyPlayer().getLocation()) > checkDistance) {
  1544. return false;
  1545. }
  1546. for (int id : ids) {
  1547. if (o.getID() == id) {
  1548. return true;
  1549. }
  1550. }
  1551. return false;
  1552. }
  1553. });
  1554. }
  1555.  
  1556. public int[] toIntArray(String[] sarray) throws Exception {
  1557. if (sarray != null) {
  1558. int intarray[] = new int[sarray.length];
  1559. for (int i = 0; i < sarray.length; i++) {
  1560. intarray[i] = Integer.parseInt(sarray[i]);
  1561. }
  1562. return intarray;
  1563. }
  1564. return null;
  1565. }
  1566.  
  1567.  
  1568.  
  1569.  
  1570. public class phatminer extends javax.swing.JFrame {
  1571.  
  1572. private static final long serialVersionUID = 1L;
  1573. /** Creates new form phatminer */
  1574. public phatminer() {
  1575. try {
  1576. UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  1577. } catch (Exception e) {
  1578.  
  1579. }
  1580. initComponents();
  1581. lstOres.setModel(new DefaultListModel());
  1582. }
  1583.  
  1584. /** This method is called from within the constructor to
  1585. * initialize the form.
  1586. * WARNING: Do NOT modify this code. The content of this method is
  1587. * always regenerated by the Form Editor.
  1588. */
  1589. private void initComponents() {
  1590.  
  1591. jPanel1 = new javax.swing.JPanel();
  1592. jLabel1 = new javax.swing.JLabel();
  1593. jSeparator1 = new javax.swing.JSeparator();
  1594. cmdStart = new javax.swing.JButton();
  1595. jLabel2 = new javax.swing.JLabel();
  1596. jLabel3 = new javax.swing.JLabel();
  1597. jLabel4 = new javax.swing.JLabel();
  1598. jLabel5 = new javax.swing.JLabel();
  1599. jLabel6 = new javax.swing.JLabel();
  1600. jPanel2 = new javax.swing.JPanel();
  1601. jScrollPane1 = new javax.swing.JScrollPane();
  1602. lstPlaces = new javax.swing.JList();
  1603. jLabel7 = new javax.swing.JLabel();
  1604. jLabel8 = new javax.swing.JLabel();
  1605. jScrollPane2 = new javax.swing.JScrollPane();
  1606. lstOres = new javax.swing.JList();
  1607. txtDistance = new javax.swing.JTextField();
  1608. lblDistance = new javax.swing.JLabel();
  1609. chkM1D1 = new javax.swing.JCheckBox();
  1610. setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  1611. setTitle("PhatMiner");
  1612. setResizable(false);
  1613.  
  1614. cmdStart.setText("Start");
  1615. cmdStart.addActionListener(new java.awt.event.ActionListener() {
  1616. public void actionPerformed(java.awt.event.ActionEvent evt) {
  1617. cmdStartActionPerformed(evt);
  1618. }
  1619. });
  1620.  
  1621. jLabel2.setText("Instructions:");
  1622.  
  1623. jLabel3.setText("Fill out the wanted settings. Be sure to");
  1624. jLabel3.setVerticalTextPosition(javax.swing.SwingConstants.TOP);
  1625.  
  1626. jLabel4.setText(" check each tab in case you miss something!");
  1627. jLabel4.setVerticalTextPosition(javax.swing.SwingConstants.TOP);
  1628.  
  1629. jLabel5.setFont(new java.awt.Font("Tahoma", 1, 11));
  1630. jLabel5.setText("Created By:");
  1631.  
  1632. jLabel6.setFont(new java.awt.Font("Tahoma", 1, 11));
  1633. jLabel6.setText("Phatninja55");
  1634.  
  1635. txtDistance.setText("15");
  1636.  
  1637. jPanel2.setBackground(new java.awt.Color(255, 255, 255));
  1638. jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
  1639.  
  1640. lstPlaces.setModel(new javax.swing.AbstractListModel() {
  1641. /**
  1642. *
  1643. */
  1644. private static final long serialVersionUID = 1L;
  1645. String[] strings = { "Power-Mining", "Al Kharid", "Ardougne East", "Ardougne South",
  1646. "Barbarian Village", "Karamja Volcano", "Khazard Battlefield", "Living Rock Cavern",
  1647. "LRC Power-Mining", "Lumbridge Swamp", "Mining Guild", "North Draynor Village",
  1648. "Rimmington", "Taverly", "TzHaar", "Varrock East", "Varrock West", "Yanille"
  1649. };
  1650. public int getSize() { return strings.length; }
  1651. public Object getElementAt(int i) { return strings[i]; }
  1652. });
  1653. lstPlaces.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
  1654. lstPlaces.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
  1655. public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
  1656. lstPlacesValueChanged(evt);
  1657. }
  1658. });
  1659. jScrollPane1.setViewportView(lstPlaces);
  1660.  
  1661. jLabel7.setText("Locations:");
  1662.  
  1663. jLabel8.setText("Ores:");
  1664.  
  1665. lblDistance.setFont(new java.awt.Font("Tahoma", 0, 11));
  1666. lblDistance.setText("Check Distance:");
  1667.  
  1668. chkM1D1.setText("Use M1D1 while powermining");
  1669. chkM1D1.setBackground(Color.WHITE);
  1670.  
  1671. lstOres.setModel(new javax.swing.AbstractListModel() {
  1672. /**
  1673. *
  1674. */
  1675. private static final long serialVersionUID = 1L;
  1676. String[] strings = { "Clay", "Copper", "Tin", "Iron", "Silver", "Coal", "Sandstone", "Gold", "Granite", "Mithril", "Adamant", "Runite", " " };
  1677. public int getSize() { return strings.length; }
  1678. public Object getElementAt(int i) { return strings[i]; }
  1679. });
  1680. jScrollPane2.setViewportView(lstOres);
  1681.  
  1682. javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
  1683. jPanel2.setLayout(jPanel2Layout);
  1684. jPanel2Layout.setHorizontalGroup(
  1685. jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  1686. .addGroup(jPanel2Layout.createSequentialGroup()
  1687. .addContainerGap()
  1688. .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  1689. .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 217, javax.swing.GroupLayout.PREFERRED_SIZE)
  1690. .addComponent(jLabel7)
  1691. .addComponent(lblDistance)
  1692. .addComponent(txtDistance))
  1693. .addGap(22, 22, 22)
  1694. .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  1695. .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 217, javax.swing.GroupLayout.PREFERRED_SIZE)
  1696. .addComponent(jLabel8)
  1697. .addComponent(chkM1D1))
  1698. .addContainerGap())
  1699. );
  1700. jPanel2Layout.setVerticalGroup(
  1701. jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  1702. .addGroup(jPanel2Layout.createSequentialGroup()
  1703. .addContainerGap()
  1704. .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  1705. .addComponent(jLabel7)
  1706. .addComponent(jLabel8))
  1707. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  1708. .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  1709. .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE)
  1710. .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE))
  1711. .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  1712. .addGap(0, 10, Short.MAX_VALUE)
  1713. .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  1714. .addComponent(lblDistance)
  1715. .addComponent(chkM1D1))
  1716. .addComponent(txtDistance)
  1717. .addContainerGap())
  1718. );
  1719.  
  1720. javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
  1721. jPanel1.setLayout(jPanel1Layout);
  1722. jPanel1Layout.setHorizontalGroup(
  1723. jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  1724. .addGroup(jPanel1Layout.createSequentialGroup()
  1725. .addComponent(jLabel1)
  1726. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  1727. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  1728. .addComponent(cmdStart, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
  1729. .addGroup(jPanel1Layout.createSequentialGroup()
  1730. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  1731. .addComponent(jLabel5)
  1732. .addComponent(jLabel2))
  1733. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  1734. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  1735. .addComponent(jLabel6)
  1736. .addComponent(jLabel4)
  1737. .addComponent(jLabel3))))
  1738. .addContainerGap())
  1739. .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 498, Short.MAX_VALUE)
  1740. .addGroup(jPanel1Layout.createSequentialGroup()
  1741. .addContainerGap()
  1742. .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  1743. .addContainerGap())
  1744. );
  1745. jPanel1Layout.setVerticalGroup(
  1746. jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  1747. .addGroup(jPanel1Layout.createSequentialGroup()
  1748. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  1749. .addComponent(jLabel1)
  1750. .addGroup(jPanel1Layout.createSequentialGroup()
  1751. .addContainerGap()
  1752. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  1753. .addGroup(jPanel1Layout.createSequentialGroup()
  1754. .addComponent(jLabel3)
  1755. .addGap(1, 1, 1)
  1756. .addComponent(jLabel4))
  1757. .addComponent(jLabel2))
  1758. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  1759. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  1760. .addComponent(jLabel5)
  1761. .addComponent(jLabel6))
  1762. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 35, Short.MAX_VALUE)
  1763. .addComponent(cmdStart, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)))
  1764. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  1765. .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 5, javax.swing.GroupLayout.PREFERRED_SIZE)
  1766. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  1767. .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  1768. .addContainerGap())
  1769. );
  1770.  
  1771. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  1772. getContentPane().setLayout(layout);
  1773. layout.setHorizontalGroup(
  1774. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  1775. .addGap(0, 498, Short.MAX_VALUE)
  1776. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  1777. .addGroup(layout.createSequentialGroup()
  1778. .addGap(0, 0, Short.MAX_VALUE)
  1779. .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  1780. .addGap(0, 0, Short.MAX_VALUE)))
  1781. );
  1782. layout.setVerticalGroup(
  1783. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  1784. .addGap(0, 381, Short.MAX_VALUE)
  1785. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  1786. .addGroup(layout.createSequentialGroup()
  1787. .addGap(0, 0, Short.MAX_VALUE)
  1788. .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  1789. .addGap(0, 0, Short.MAX_VALUE)))
  1790. );
  1791.  
  1792. pack();
  1793. }// </editor-fold>
  1794.  
  1795. @SuppressWarnings("deprecation")
  1796. private void cmdStartActionPerformed(java.awt.event.ActionEvent evt) {
  1797. if (txtDistance.getText().isEmpty()) {
  1798. return;
  1799. }
  1800. try {
  1801. checkDistance = Integer.parseInt(txtDistance.getText());
  1802. } catch (Exception e) {
  1803. return;
  1804. }
  1805. Location = lstPlaces.getSelectedValue().toString();
  1806. mineOres = new String[lstOres.getSelectedValues().length];
  1807. for (int i=0; i<lstOres.getSelectedValues().length; i++) {
  1808. mineOres[i] = lstOres.getSelectedValues()[i].toString();
  1809. }
  1810. if (Location.equals("Power-Mining")) {
  1811. Banking = false;
  1812. if (chkM1D1.isSelected()) {
  1813. M1D1 = true;
  1814. } else {
  1815. M1D1 = false;
  1816. }
  1817. } else if (Location.equals("Al Kharid")) {
  1818. Banking = true;
  1819. Mine = new RSTile[] {
  1820. new RSTile(3269, 3167), new RSTile(3274, 3167),
  1821. new RSTile(3277, 3171), new RSTile(3278, 3176),
  1822. new RSTile(3279, 3181), new RSTile(3282, 3186),
  1823. new RSTile(3283, 3191), new RSTile(3283, 3196),
  1824. new RSTile(3283, 3201), new RSTile(3283, 3206),
  1825. new RSTile(3284, 3211), new RSTile(3287, 3215),
  1826. new RSTile(3291, 3219), new RSTile(3294, 3223),
  1827. new RSTile(3295, 3228), new RSTile(3296, 3233),
  1828. new RSTile(3297, 3238), new RSTile(3298, 3243),
  1829. new RSTile(3298, 3248), new RSTile(3299, 3253),
  1830. new RSTile(3299, 3258), new RSTile(3299, 3263),
  1831. new RSTile(3299, 3268), new RSTile(3299, 3273),
  1832. new RSTile(3299, 3278), new RSTile(3299, 3283),
  1833. new RSTile(3299, 3288), new RSTile(3299, 3293),
  1834. new RSTile(3297, 3298), new RSTile(3299, 3301)
  1835. };
  1836. atBank = new RSTile(3269, 3167);
  1837. atMine = new RSArea(new RSTile[] {
  1838. new RSTile(3298, 3280), new RSTile(3293, 3282),
  1839. new RSTile(3291, 3287), new RSTile(3291, 3292),
  1840. new RSTile(3291, 3297), new RSTile(3290, 3302),
  1841. new RSTile(3293, 3306), new RSTile(3294, 3311),
  1842. new RSTile(3295, 3316), new RSTile(3299, 3319),
  1843. new RSTile(3304, 3318), new RSTile(3306, 3313),
  1844. new RSTile(3302, 3310), new RSTile(3306, 3307),
  1845. new RSTile(3304, 3302), new RSTile(3304, 3297),
  1846. new RSTile(3304, 3292), new RSTile(3303, 3287),
  1847. new RSTile(3301, 3282)
  1848. });
  1849. } else if (Location.equals("Ardougne East")) {
  1850. Banking = true;
  1851. Mine = new RSTile[] {
  1852. new RSTile(2652, 3283), new RSTile(2647, 3283),
  1853. new RSTile(2642, 3283), new RSTile(2642, 3288),
  1854. new RSTile(2645, 3292), new RSTile(2649, 3295),
  1855. new RSTile(2654, 3296), new RSTile(2659, 3299),
  1856. new RSTile(2663, 3302), new RSTile(2668, 3305),
  1857. new RSTile(2673, 3306), new RSTile(2678, 3306),
  1858. new RSTile(2683, 3306), new RSTile(2688, 3305),
  1859. new RSTile(2692, 3308), new RSTile(2694, 3313),
  1860. new RSTile(2696, 3318), new RSTile(2697, 3323),
  1861. new RSTile(2699, 3328)
  1862. };
  1863. atBank = new RSTile(2653, 3284);
  1864. atMine = new RSArea(new RSTile[] {
  1865. new RSTile(2690, 3341), new RSTile(2688, 3336),
  1866. new RSTile(2688, 3331), new RSTile(2691, 3327),
  1867. new RSTile(2696, 3326), new RSTile(2701, 3325),
  1868. new RSTile(2706, 3325), new RSTile(2711, 3326),
  1869. new RSTile(2715, 3329), new RSTile(2719, 3333)
  1870. });
  1871. } else if (Location.equals("Ardougne South")) {
  1872. Banking = true;
  1873. Mine = new RSTile[] {
  1874. new RSTile(2611, 3092), new RSTile(2606, 3092),
  1875. new RSTile(2606, 3097), new RSTile(2609, 3101),
  1876. new RSTile(2614, 3102), new RSTile(2616, 3107),
  1877. new RSTile(2618, 3112), new RSTile(2621, 3116),
  1878. new RSTile(2623, 3121), new RSTile(2625, 3126),
  1879. new RSTile(2627, 3131), new RSTile(2628, 3136),
  1880. new RSTile(2630, 3141)
  1881. };
  1882. atBank = new RSTile(2653, 3284);
  1883. atMine = new RSArea(new RSTile[] {
  1884. new RSTile(2606, 3222), new RSTile(2601, 3221),
  1885. new RSTile(2600, 3226), new RSTile(2600, 3231),
  1886. new RSTile(2599, 3236), new RSTile(2601, 3241),
  1887. new RSTile(2606, 3241), new RSTile(2609, 3237),
  1888. new RSTile(2608, 3232), new RSTile(2608, 3227),
  1889. new RSTile(2608, 3222)
  1890. });
  1891. } else if (Location.equals("Barbarian Village")) {
  1892. Banking = true;
  1893. Mine = new RSTile[] {
  1894. new RSTile(3094, 3493), new RSTile(3089, 3493),
  1895. new RSTile(3089, 3488), new RSTile(3092, 3484),
  1896. new RSTile(3097, 3483), new RSTile(3100, 3479),
  1897. new RSTile(3100, 3474), new RSTile(3100, 3469),
  1898. new RSTile(3099, 3464), new RSTile(3096, 3460),
  1899. new RSTile(3096, 3455), new RSTile(3093, 3451),
  1900. new RSTile(3092, 3446), new RSTile(3091, 3441),
  1901. new RSTile(3090, 3436), new RSTile(3089, 3431),
  1902. new RSTile(3087, 3426), new RSTile(3085, 3421)
  1903. };
  1904. atBank = new RSTile(3093, 3491);
  1905. atMine = new RSArea(new RSTile[] {
  1906. new RSTile(3082, 3425), new RSTile(3077, 3424),
  1907. new RSTile(3075, 3419), new RSTile(3078, 3415),
  1908. new RSTile(3083, 3414), new RSTile(3087, 3417),
  1909. new RSTile(3087, 3422)
  1910. });
  1911. } else if (Location.equals("North Draynor Village")) {
  1912. Banking = true;
  1913. Mine = new RSTile[] {
  1914. new RSTile(3093, 3243), new RSTile(3093, 3248),
  1915. new RSTile(3098, 3248), new RSTile(3103, 3250),
  1916. new RSTile(3104, 3255), new RSTile(3104, 3260),
  1917. new RSTile(3104, 3265), new RSTile(3104, 3270),
  1918. new RSTile(3104, 3275), new RSTile(3107, 3279),
  1919. new RSTile(3109, 3284), new RSTile(3110, 3289),
  1920. new RSTile(3111, 3294), new RSTile(3115, 3298),
  1921. new RSTile(3120, 3300), new RSTile(3124, 3303),
  1922. new RSTile(3128, 3306), new RSTile(3132, 3309),
  1923. new RSTile(3135, 3313), new RSTile(3140, 3316)
  1924. };
  1925. atBank = new RSTile(3092, 3243);
  1926. atMine = new RSArea(new RSTile[] {
  1927. new RSTile(3146, 3324), new RSTile(3141, 3324),
  1928. new RSTile(3136, 3323), new RSTile(3134, 3318),
  1929. new RSTile(3137, 3314), new RSTile(3142, 3313),
  1930. new RSTile(3147, 3316), new RSTile(3149, 3321)
  1931. });
  1932. } else if (Location.equals("Lumbridge Swamp")) {
  1933. Banking = true;
  1934. Mine = new RSTile[] {
  1935. new RSTile(3092, 3244), new RSTile(3092, 3249),
  1936. new RSTile(3097, 3248), new RSTile(3101, 3245),
  1937. new RSTile(3101, 3240), new RSTile(3101, 3235),
  1938. new RSTile(3104, 3231), new RSTile(3108, 3228),
  1939. new RSTile(3112, 3225), new RSTile(3114, 3220),
  1940. new RSTile(3115, 3215), new RSTile(3119, 3212),
  1941. new RSTile(3123, 3209), new RSTile(3128, 3208),
  1942. new RSTile(3133, 3206), new RSTile(3136, 3202),
  1943. new RSTile(3139, 3197), new RSTile(3140, 3192),
  1944. new RSTile(3141, 3187), new RSTile(3142, 3182),
  1945. new RSTile(3143, 3177), new RSTile(3146, 3173),
  1946. new RSTile(3146, 3168), new RSTile(3147, 3163),
  1947. new RSTile(3148, 3158), new RSTile(3149, 3153),
  1948. new RSTile(3146, 3149)
  1949. };
  1950. atBank = new RSTile(3092, 3243);
  1951. atMine = new RSArea(new RSTile[] {
  1952. new RSTile(3146, 3156), new RSTile(3151, 3156),
  1953. new RSTile(3150, 3151), new RSTile(3150, 3146),
  1954. new RSTile(3147, 3142), new RSTile(3142, 3142),
  1955. new RSTile(3141, 3147), new RSTile(3141, 3152),
  1956. new RSTile(3145, 3155)
  1957. });
  1958. } else if (Location.equals("Rimmington")) {
  1959. Banking = true;
  1960. Mine = new RSTile[] {
  1961. new RSTile(3013, 3354), new RSTile(3013, 3359),
  1962. new RSTile(3009, 3362), new RSTile(3004, 3359),
  1963. new RSTile(3004, 3354), new RSTile(3008, 3350),
  1964. new RSTile(3008, 3345), new RSTile(3007, 3340),
  1965. new RSTile(3007, 3335), new RSTile(3007, 3330),
  1966. new RSTile(3006, 3325), new RSTile(3005, 3320),
  1967. new RSTile(3005, 3315), new RSTile(3005, 3310),
  1968. new RSTile(3004, 3305), new RSTile(3003, 3300),
  1969. new RSTile(3002, 3295), new RSTile(3001, 3290),
  1970. new RSTile(2999, 3285), new RSTile(2997, 3280),
  1971. new RSTile(2995, 3275), new RSTile(2992, 3271),
  1972. new RSTile(2988, 3268), new RSTile(2985, 3264),
  1973. new RSTile(2982, 3259), new RSTile(2978, 3256),
  1974. new RSTile(2978, 3251), new RSTile(2978, 3246),
  1975. new RSTile(2977, 3242)
  1976. };
  1977. atBank = new RSTile(3012, 3356);
  1978. atMine = new RSArea(new RSTile[] {
  1979. new RSTile(2975, 3253), new RSTile(2970, 3251),
  1980. new RSTile(2966, 3247), new RSTile(2965, 3242),
  1981. new RSTile(2963, 3237), new RSTile(2966, 3233),
  1982. new RSTile(2971, 3231), new RSTile(2974, 3227),
  1983. new RSTile(2979, 3228), new RSTile(2984, 3227),
  1984. new RSTile(2987, 3231), new RSTile(2989, 3236),
  1985. new RSTile(2992, 3240), new RSTile(2993, 3245),
  1986. new RSTile(2989, 3248), new RSTile(2984, 3249),
  1987. new RSTile(2981, 3253)
  1988. });
  1989. } else if (Location.equals("Varrock East")) {
  1990. Banking = true;
  1991. Mine = new RSTile[] {
  1992. new RSTile(3257, 3429), new RSTile(3262, 3429),
  1993. new RSTile(3267, 3429), new RSTile(3272, 3429),
  1994. new RSTile(3277, 3429), new RSTile(3282, 3427),
  1995. new RSTile(3284, 3422), new RSTile(3285, 3417),
  1996. new RSTile(3287, 3412), new RSTile(3290, 3408),
  1997. new RSTile(3290, 3403), new RSTile(3291, 3398),
  1998. new RSTile(3291, 3393), new RSTile(3291, 3388),
  1999. new RSTile(3293, 3383), new RSTile(3293, 3378),
  2000. new RSTile(3290, 3374), new RSTile(3287, 3369)
  2001. };
  2002. atBank = new RSTile(3253, 3421);
  2003. atMine = new RSArea(new RSTile[] {
  2004. new RSTile(3286, 3372), new RSTile(3281, 3371),
  2005. new RSTile(3279, 3366), new RSTile(3276, 3362),
  2006. new RSTile(3279, 3358), new RSTile(3284, 3357),
  2007. new RSTile(3289, 3356), new RSTile(3294, 3355),
  2008. new RSTile(3294, 3360), new RSTile(3291, 3364),
  2009. new RSTile(3291, 3369), new RSTile(3288, 3373)
  2010. });
  2011. } else if (Location.equals("Varrock West")) {
  2012. Banking = true;
  2013. Mine = new RSTile[] {
  2014. new RSTile(3182, 3436), new RSTile(3185, 3432),
  2015. new RSTile(3182, 3428), new RSTile(3177, 3427),
  2016. new RSTile(3172, 3427), new RSTile(3171, 3422),
  2017. new RSTile(3171, 3417), new RSTile(3171, 3412),
  2018. new RSTile(3170, 3407), new RSTile(3170, 3402),
  2019. new RSTile(3172, 3397), new RSTile(3176, 3394),
  2020. new RSTile(3176, 3389), new RSTile(3178, 3384),
  2021. new RSTile(3181, 3380), new RSTile(3184, 3376),
  2022. new RSTile(3181, 3372)
  2023. };
  2024. atBank = new RSTile(3185, 3436);
  2025. atMine = new RSArea(new RSTile[] {
  2026. new RSTile(3180, 3380), new RSTile(3177, 3376),
  2027. new RSTile(3175, 3371), new RSTile(3171, 3368),
  2028. new RSTile(3171, 3363), new RSTile(3176, 3365),
  2029. new RSTile(3181, 3367), new RSTile(3183, 3372),
  2030. new RSTile(3184, 3377), new RSTile(3186, 3382)
  2031. });
  2032. } else if (Location.equals("Yanille")) {
  2033. Banking = true;
  2034. Mine = new RSTile[] {
  2035. new RSTile(2611, 3092), new RSTile(2606, 3092),
  2036. new RSTile(2606, 3097), new RSTile(2609, 3101),
  2037. new RSTile(2614, 3102), new RSTile(2616, 3107),
  2038. new RSTile(2618, 3112), new RSTile(2621, 3116),
  2039. new RSTile(2623, 3121), new RSTile(2625, 3126),
  2040. new RSTile(2627, 3131), new RSTile(2628, 3136),
  2041. new RSTile(2630, 3141)
  2042. };
  2043. atBank = new RSTile(2611, 3092);
  2044. atMine = new RSArea(new RSTile[] {
  2045. new RSTile(2628, 3152), new RSTile(2628, 3147),
  2046. new RSTile(2626, 3142), new RSTile(2625, 3137),
  2047. new RSTile(2625, 3132), new RSTile(2630, 3130),
  2048. new RSTile(2634, 3133), new RSTile(2638, 3136),
  2049. new RSTile(2640, 3141)
  2050. });
  2051. } else if (Location.equals("Khazard Battlefield")) {
  2052. Banking = true;
  2053. Mine = new RSTile[] {
  2054. new RSTile(2652, 3284), new RSTile(2647, 3284),
  2055. new RSTile(2643, 3281), new RSTile(2641, 3276),
  2056. new RSTile(2641, 3271), new RSTile(2641, 3266),
  2057. new RSTile(2638, 3262), new RSTile(2634, 3259),
  2058. new RSTile(2631, 3255), new RSTile(2626, 3253),
  2059. new RSTile(2622, 3250), new RSTile(2618, 3247),
  2060. new RSTile(2613, 3245), new RSTile(2608, 3243),
  2061. new RSTile(2603, 3241), new RSTile(2599, 3238),
  2062. new RSTile(2595, 3235), new RSTile(2590, 3232),
  2063. new RSTile(2585, 3230), new RSTile(2580, 3227),
  2064. new RSTile(2575, 3225), new RSTile(2570, 3224),
  2065. new RSTile(2565, 3226), new RSTile(2562, 3230),
  2066. new RSTile(2560, 3235), new RSTile(2560, 3240),
  2067. new RSTile(2560, 3245), new RSTile(2560, 3250),
  2068. new RSTile(2560, 3255), new RSTile(2560, 3260),
  2069. new RSTile(2555, 3261), new RSTile(2550, 3261),
  2070. new RSTile(2545, 3262), new RSTile(2540, 3262),
  2071. new RSTile(2535, 3262), new RSTile(2530, 3262),
  2072. new RSTile(2525, 3262), new RSTile(2520, 3262),
  2073. new RSTile(2515, 3262), new RSTile(2510, 3262),
  2074. new RSTile(2505, 3263), new RSTile(2500, 3263),
  2075. new RSTile(2495, 3263), new RSTile(2490, 3262),
  2076. new RSTile(2485, 3260), new RSTile(2480, 3259),
  2077. new RSTile(2475, 3257)
  2078. };
  2079. atBank = new RSTile(2653, 3284);
  2080. atMine = new RSArea(new RSTile[] {
  2081. new RSTile(2472, 3260), new RSTile(2467, 3257),
  2082. new RSTile(2465, 3252), new RSTile(2470, 3251),
  2083. new RSTile(2475, 3250), new RSTile(2476, 3255),
  2084. new RSTile(2478, 3260)
  2085. });
  2086. } else if (Location.equals("Living Rock Cavern") || Location.equals("LRC Power-Mining")) {
  2087. Banking = true;
  2088. MineFally = new RSTile[] {
  2089. new RSTile(2969, 3341), new RSTile(2967, 3346),
  2090. new RSTile(2964, 3350), new RSTile(2963, 3355),
  2091. new RSTile(2964, 3360), new RSTile(2965, 3365),
  2092. new RSTile(2966, 3370), new RSTile(2967, 3375),
  2093. new RSTile(2970, 3379), new RSTile(2975, 3379),
  2094. new RSTile(2980, 3378), new RSTile(2984, 3374),
  2095. new RSTile(2988, 3371), new RSTile(2992, 3368),
  2096. new RSTile(2997, 3368), new RSTile(3002, 3366),
  2097. new RSTile(3007, 3365), new RSTile(3012, 3365),
  2098. new RSTile(3017, 3365), new RSTile(3022, 3365),
  2099. new RSTile(3027, 3365), new RSTile(3032, 3368),
  2100. new RSTile(3037, 3368), new RSTile(3042, 3369),
  2101. new RSTile(3047, 3369), new RSTile(3052, 3369),
  2102. new RSTile(3057, 3369), new RSTile(3060, 3373),
  2103. new RSTile(3060, 3378)
  2104. };
  2105. MineLumby = new RSTile[] {
  2106. new RSTile(3221, 3218), new RSTile(3226, 3219),
  2107. new RSTile(3231, 3219), new RSTile(3232, 3224),
  2108. new RSTile(3232, 3229), new RSTile(3229, 3233),
  2109. new RSTile(3225, 3236), new RSTile(3221, 3240),
  2110. new RSTile(3219, 3245), new RSTile(3216, 3249),
  2111. new RSTile(3211, 3249), new RSTile(3206, 3247),
  2112. new RSTile(3201, 3247), new RSTile(3196, 3246),
  2113. new RSTile(3191, 3246), new RSTile(3186, 3245),
  2114. new RSTile(3181, 3245), new RSTile(3176, 3245),
  2115. new RSTile(3171, 3245), new RSTile(3166, 3244),
  2116. new RSTile(3160, 3244), new RSTile(3155, 3244),
  2117. new RSTile(3150, 3244), new RSTile(3145, 3245),
  2118. new RSTile(3143, 3250), new RSTile(3141, 3255),
  2119. new RSTile(3140, 3260), new RSTile(3135, 3262),
  2120. new RSTile(3130, 3262), new RSTile(3125, 3262),
  2121. new RSTile(3120, 3262), new RSTile(3115, 3263),
  2122. new RSTile(3110, 3264), new RSTile(3105, 3267),
  2123. new RSTile(3103, 3272), new RSTile(3103, 3277),
  2124. new RSTile(3103, 3282), new RSTile(3103, 3287),
  2125. new RSTile(3098, 3289), new RSTile(3093, 3289),
  2126. new RSTile(3088, 3288), new RSTile(3083, 3286),
  2127. new RSTile(3078, 3284), new RSTile(3073, 3282),
  2128. new RSTile(3069, 3279), new RSTile(3064, 3277),
  2129. new RSTile(3059, 3277), new RSTile(3054, 3277),
  2130. new RSTile(3049, 3277), new RSTile(3044, 3277),
  2131. new RSTile(3039, 3277), new RSTile(3034, 3277),
  2132. new RSTile(3029, 3277), new RSTile(3024, 3277),
  2133. new RSTile(3018, 3277), new RSTile(3013, 3277),
  2134. new RSTile(3009, 3280), new RSTile(3008, 3285),
  2135. new RSTile(3007, 3290), new RSTile(3005, 3295),
  2136. new RSTile(3005, 3300), new RSTile(3004, 3305),
  2137. new RSTile(3004, 3310), new RSTile(3004, 3315),
  2138. new RSTile(3005, 3320), new RSTile(3005, 3325),
  2139. new RSTile(3006, 3330), new RSTile(3007, 3335),
  2140. new RSTile(3007, 3340), new RSTile(3007, 3345),
  2141. new RSTile(3008, 3350), new RSTile(3006, 3355),
  2142. new RSTile(3003, 3359), new RSTile(3005, 3363),
  2143. new RSTile(3010, 3363), new RSTile(3015, 3363),
  2144. new RSTile(3020, 3363), new RSTile(3025, 3365),
  2145. new RSTile(3030, 3367), new RSTile(3035, 3368),
  2146. new RSTile(3040, 3368), new RSTile(3045, 3368),
  2147. new RSTile(3050, 3369), new RSTile(3055, 3370),
  2148. new RSTile(3059, 3373), new RSTile(3060, 3378)
  2149. };
  2150. MineLRC = new RSTile[] {
  2151. new RSTile(3058, 9777), new RSTile(3051, 9780),
  2152. new RSTile(3046, 9784), new RSTile(3044, 9791),
  2153. new RSTile(3043, 9799), new RSTile(3041, 9806),
  2154. new RSTile(3041, 9815), new RSTile(3041, 9824),
  2155. new RSTile(3038, 9832), new RSTile(3028, 9834),
  2156. new RSTile(3019, 9833), new RSTile(3013, 9832)
  2157. };
  2158. atFally = new RSArea(new RSTile[] {
  2159. new RSTile(2979, 3374), new RSTile(2978, 3379),
  2160. new RSTile(2973, 3382), new RSTile(2970, 3386),
  2161. new RSTile(2968, 3391), new RSTile(2963, 3391),
  2162. new RSTile(2961, 3386), new RSTile(2956, 3384),
  2163. new RSTile(2955, 3379), new RSTile(2960, 3379),
  2164. new RSTile(2961, 3374), new RSTile(2961, 3369),
  2165. new RSTile(2961, 3364), new RSTile(2962, 3359),
  2166. new RSTile(2962, 3354), new RSTile(2962, 3349),
  2167. new RSTile(2961, 3344), new RSTile(2963, 3339),
  2168. new RSTile(2968, 3338), new RSTile(2972, 3335),
  2169. new RSTile(2977, 3335), new RSTile(2981, 3338),
  2170. new RSTile(2980, 3344), new RSTile(2975, 3346),
  2171. new RSTile(2971, 3349), new RSTile(2968, 3353),
  2172. new RSTile(2968, 3358), new RSTile(2968, 3363),
  2173. new RSTile(2970, 3368), new RSTile(2971, 3373)
  2174. });
  2175. atLumby = new RSArea(new RSTile[] {
  2176. new RSTile(3217, 3230), new RSTile(3217, 3225),
  2177. new RSTile(3217, 3220), new RSTile(3217, 3215),
  2178. new RSTile(3217, 3209), new RSTile(3222, 3207),
  2179. new RSTile(3225, 3211), new RSTile(3226, 3216),
  2180. new RSTile(3226, 3221), new RSTile(3224, 3226),
  2181. new RSTile(3222, 3231)
  2182. });
  2183. atBank = new RSTile(3654, 5114);
  2184. if (mineOres[0].toString().equals("Concentrated Gold")) {
  2185. SouthtoBank = new RSTile[] {
  2186. new RSTile(3669,5075), new RSTile(3669,5077),
  2187. new RSTile(3666,5080), new RSTile(3662,5090),
  2188. new RSTile(3658,5101), new RSTile(3654,5114)
  2189. };
  2190. WesttoBank = new RSTile[] {
  2191. new RSTile(3639,5096), new RSTile(3651,5096),
  2192. new RSTile(3657,5105), new RSTile(3654,5114)
  2193. };
  2194. WesttoSouth = new RSTile[] {
  2195. new RSTile(3639,5094),new RSTile(3648,5092),
  2196. new RSTile(3658,5088),new RSTile(3666,5082),
  2197. new RSTile(3669,5077)
  2198. };
  2199. } else {
  2200. SouthtoBank = new RSTile[] {
  2201. new RSTile(3665,5092),new RSTile(3661,5095),
  2202. new RSTile(3660,5104),new RSTile(3654,5114)
  2203. };
  2204. WesttoBank = new RSTile[] {
  2205. new RSTile(3674,5101),new RSTile(3673,5104),
  2206. new RSTile(3667,5111),new RSTile(3660,5114),
  2207. new RSTile(3654,5114)
  2208.  
  2209. };
  2210. WesttoSouth = new RSTile[] {
  2211. new RSTile(3673,5098),new RSTile(3670,5095),
  2212. new RSTile(3665,5092)
  2213. };
  2214. }
  2215. toMineLumby = walking.newTilePath(MineLumby);
  2216. toMineFally = walking.newTilePath(MineFally);
  2217. toMineLRC = walking.newTilePath(MineLRC);
  2218. toBankSouthLRC = walking.newTilePath(SouthtoBank);
  2219. toBankWestLRC = walking.newTilePath(WesttoBank);
  2220. toSouthLRC = walking.newTilePath(walking.reversePath(SouthtoBank));
  2221. toWestLRC = walking.newTilePath(walking.reversePath(WesttoBank));
  2222. toWestfromSouth = walking.newTilePath(walking.reversePath(WesttoSouth));
  2223. toSouthfromWest = walking.newTilePath(WesttoSouth);
  2224. } else if (Location.equals("Mining Guild")) {
  2225. Banking = true;
  2226. Ladder = new RSTile[] {
  2227. new RSTile(3012, 3356), new RSTile(3021, 3360),
  2228. new RSTile(3023, 3352), new RSTile(3031, 3344),
  2229. new RSTile(3023, 3337)
  2230. };
  2231. Mine = new RSTile[] {
  2232. new RSTile(3019, 9737), new RSTile(3028, 9736),
  2233. new RSTile(3039, 9736), new RSTile(3050, 9736)
  2234. };
  2235. atBank = new RSTile(3012, 3356);
  2236. atMine = new RSArea(new RSTile[] {
  2237. new RSTile(3026, 9741), new RSTile(3027, 9730),
  2238. new RSTile(3037, 9730), new RSTile(3043, 9730),
  2239. new RSTile(3060, 9730), new RSTile(3060, 9746),
  2240. new RSTile(3055, 9750), new RSTile(3030, 9749),
  2241. new RSTile(3026, 9741)
  2242. });
  2243. Bank = walking.reversePath(Ladder);
  2244. toLadderTop = walking.newTilePath(Ladder);
  2245. toMine = walking.newTilePath(Mine);
  2246. toBank = walking.newTilePath(Bank);
  2247. toLadderBottom = walking.newTilePath(walking.reversePath(Mine));
  2248. } else if (Location.equals("TzHaar")) {
  2249. Banking = true;
  2250. Mine = new RSTile[] {
  2251. new RSTile(2445, 5178), new RSTile(2447, 5171),
  2252. new RSTile(2452, 5168), new RSTile(2459, 5169),
  2253. };
  2254. atBank = new RSTile(2445, 5178);
  2255. atMine = new RSArea(new RSTile[] {
  2256. new RSTile(2453, 5170), new RSTile(2459, 5178),
  2257. new RSTile(2464, 5178), new RSTile(2464, 5167),
  2258. new RSTile(2454, 5164)
  2259. });
  2260. } else if (Location.equals("Karamja Volcano")) {
  2261. Banking = true;
  2262. Mine = new RSTile[] {
  2263. new RSTile(2445, 5178), new RSTile(2447, 5171),
  2264. new RSTile(2452, 5168), new RSTile(2459, 5169),
  2265. new RSTile(2463, 5171), new RSTile(2470, 5168),
  2266. new RSTile(2478, 5168), new RSTile(2480, 5175)
  2267. };
  2268. atBank = new RSTile(2445, 5178);
  2269. atMine = new RSArea(new RSTile[] {
  2270. new RSTile(2857, 9569), new RSTile(2857, 9583),
  2271. new RSTile(2866, 9583), new RSTile(2866, 9569)
  2272. });
  2273. } else if (Location.equals("Taverly")) {
  2274. Banking = true;
  2275. Ladder = new RSTile[] {
  2276. new RSTile(2944, 3371), new RSTile(2945, 3376),
  2277. new RSTile(2940, 3377), new RSTile(2940, 3372),
  2278. new RSTile(2940, 3367), new RSTile(2940, 3362),
  2279. new RSTile(2938, 3357)
  2280. };
  2281. Mine = new RSTile[] {
  2282. new RSTile(2934, 3356), new RSTile(2929, 3356),
  2283. new RSTile(2924, 3355), new RSTile(2919, 3355),
  2284. new RSTile(2914, 3356), new RSTile(2909, 3358)
  2285. };
  2286. atBank = new RSTile(2946, 3369);
  2287. atMine = new RSArea(new RSTile[] {
  2288. new RSTile(2907, 3371), new RSTile(2904, 3367),
  2289. new RSTile(2903, 3362), new RSTile(2902, 3357),
  2290. new RSTile(2902, 3352), new RSTile(2907, 3351),
  2291. new RSTile(2909, 3356), new RSTile(2910, 3361),
  2292. new RSTile(2913, 3365), new RSTile(2914, 3370)
  2293. });
  2294. Bank = walking.reversePath(Ladder);
  2295. toLadderTop = walking.newTilePath(Ladder);
  2296. toMine = walking.newTilePath(Mine);
  2297. toBank = walking.newTilePath(Bank);
  2298. toLadderBottom = walking.newTilePath(walking.reversePath(Mine));
  2299. }
  2300. if (!Location.equals("Power-Mining") && !Location.equals("Living Rock Cavern") && !Location.equals("Mining Guild") && !Location.equals("LRC Power-Mining")
  2301. && !Location.equals("Taverly")) {
  2302. Bank = walking.reversePath(Mine);
  2303. toMine = walking.newTilePath(Mine);
  2304. toBank = walking.newTilePath(Bank);
  2305. }
  2306. startPos = getMyPlayer().getLocation();
  2307. startProgram = true;
  2308. this.setVisible(false);
  2309. }
  2310.  
  2311. private void lstPlacesValueChanged(javax.swing.event.ListSelectionEvent evt) {
  2312. DefaultListModel Ores = (DefaultListModel) lstOres.getModel();
  2313. String Loc = lstPlaces.getSelectedValue().toString();
  2314. if (Loc.equals("Power-Mining")) {
  2315. Ores.clear();
  2316. lstOres.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  2317. Ores.addElement("Clay");
  2318. Ores.addElement("Copper");
  2319. Ores.addElement("Tin");
  2320. Ores.addElement("Iron");
  2321. Ores.addElement("Silver");
  2322. Ores.addElement("Coal");
  2323. Ores.addElement("Gold");
  2324. Ores.addElement("Granite");
  2325. Ores.addElement("Mithril");
  2326. Ores.addElement("Adamantite");
  2327. Ores.addElement("Runite");
  2328. } else if (Loc.equals("LRC Power-Mining")) {
  2329. Ores.clear();
  2330. lstOres.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  2331. Ores.addElement("Concentrated Coal");
  2332. Ores.addElement("Concentrated Gold");
  2333. } else if (Loc.equals("Al Kharid")) {
  2334. Ores.clear();
  2335. lstOres.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  2336. Ores.addElement("Copper");
  2337. Ores.addElement("Tin");
  2338. Ores.addElement("Iron");
  2339. Ores.addElement("Silver");
  2340. Ores.addElement("Coal");
  2341. Ores.addElement("Gold");
  2342. Ores.addElement("Mithril");
  2343. Ores.addElement("Adamantite");
  2344. } else if (Loc.equals("Ardougne East")) {
  2345. Ores.clear();
  2346. lstOres.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  2347. Ores.addElement("Iron");
  2348. Ores.addElement("Coal");
  2349. } else if (Loc.equals("Ardougne South")) {
  2350. Ores.clear();
  2351. lstOres.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  2352. Ores.addElement("Iron");
  2353. Ores.addElement("Coal");
  2354. } else if (Loc.equals("Barbarian Village")) {
  2355. Ores.clear();
  2356. lstOres.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  2357. Ores.addElement("Tin");
  2358. Ores.addElement("Coal");
  2359. } else if (Loc.equals("North Draynor Village")) {
  2360. Ores.clear();
  2361. lstOres.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  2362. Ores.addElement("Clay");
  2363. } else if (Loc.equals("Lumbridge Swamp")) {
  2364. Ores.clear();
  2365. lstOres.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  2366. Ores.addElement("Coal");
  2367. Ores.addElement("Mithril");
  2368. Ores.addElement("Adamantite");
  2369. } else if (Loc.equals("Rimmington")) {
  2370. Ores.clear();
  2371. lstOres.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  2372. Ores.addElement("Clay");
  2373. Ores.addElement("Copper");
  2374. Ores.addElement("Tin");
  2375. Ores.addElement("Iron");
  2376. Ores.addElement("Gold");
  2377. } else if (Loc.equals("Varrock East")) {
  2378. Ores.clear();
  2379. lstOres.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  2380. Ores.addElement("Copper");
  2381. Ores.addElement("Tin");
  2382. Ores.addElement("Iron");
  2383. } else if (Loc.equals("Varrock West")) {
  2384. Ores.clear();
  2385. lstOres.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  2386. Ores.addElement("Clay");
  2387. Ores.addElement("Tin");
  2388. Ores.addElement("Iron");
  2389. Ores.addElement("Silver");
  2390. } else if (Loc.equals("Yanille")) {
  2391. Ores.clear();
  2392. lstOres.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  2393. Ores.addElement("Clay");
  2394. Ores.addElement("Copper");
  2395. Ores.addElement("Tin");
  2396. Ores.addElement("Iron");
  2397. Ores.addElement("Coal");
  2398. Ores.addElement("Mithril");
  2399. } else if (Loc.equals("Khazard Battlefield")) {
  2400. Ores.clear();
  2401. lstOres.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  2402. Ores.addElement("Copper");
  2403. } else if (Loc.equals("Living Rock Cavern")) {
  2404. Ores.clear();
  2405. lstOres.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  2406. Ores.addElement("Concentrated Coal");
  2407. Ores.addElement("Concentrated Gold");
  2408. } else if (Loc.equals("Mining Guild")) {
  2409. Ores.clear();
  2410. lstOres.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  2411. Ores.addElement("Coal");
  2412. Ores.addElement("Mithril");
  2413. } else if (Loc.equals("TzHaar")) {
  2414. Ores.clear();
  2415. lstOres.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  2416. Ores.addElement("Silver");
  2417. Ores.addElement("Gold");
  2418. } else if (Loc.equals("Karamja Volcano")) {
  2419. Ores.clear();
  2420. lstOres.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  2421. Ores.addElement("Gold");
  2422. } else if (Loc.equals("Taverly")) {
  2423. Ores.clear();
  2424. lstOres.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  2425. Ores.addElement("Copper");
  2426. Ores.addElement("Tin");
  2427. Ores.addElement("Iron");
  2428. Ores.addElement("Coal");
  2429. }
  2430. }
  2431.  
  2432.  
  2433.  
  2434. // Variables declaration - do not modify
  2435. private javax.swing.JTextField txtDistance;
  2436. private javax.swing.JButton cmdStart;
  2437. private javax.swing.JLabel jLabel1;
  2438. private javax.swing.JLabel lblDistance;
  2439. private javax.swing.JLabel jLabel2;
  2440. private javax.swing.JLabel jLabel3;
  2441. private javax.swing.JLabel jLabel4;
  2442. private javax.swing.JLabel jLabel5;
  2443. private javax.swing.JLabel jLabel6;
  2444. private javax.swing.JLabel jLabel7;
  2445. private javax.swing.JLabel jLabel8;
  2446. private javax.swing.JPanel jPanel1;
  2447. private javax.swing.JPanel jPanel2;
  2448. private javax.swing.JScrollPane jScrollPane1;
  2449. private javax.swing.JScrollPane jScrollPane2;
  2450. private javax.swing.JSeparator jSeparator1;
  2451. private javax.swing.JList lstOres;
  2452. private javax.swing.JList lstPlaces;
  2453. private javax.swing.JCheckBox chkM1D1;
  2454. // End of variables declaration
  2455.  
  2456. }
  2457. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement