Guest User

Untitled

a guest
Jun 25th, 2018
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 69.54 KB | None | 0 0
  1. import com.rarebot.event.events.MessageEvent;
  2. import com.rarebot.event.listeners.PaintListener;
  3. import com.rarebot.script.*;
  4. import com.rarebot.script.methods.*;
  5. import com.rarebot.script.util.*;
  6. import com.rarebot.script.wrappers.*;
  7. import java.awt.*;
  8. import java.util.ArrayList;
  9. import java.util.HashMap;
  10. import com.rarebot.event.listeners.MessageListener;
  11. import javax.swing.table.DefaultTableModel;
  12.  
  13. @ScriptManifest(authors = {"hellomot0123"}, keywords = {"Combat"}, name = "AIOFighter", description = "Start wherever you want to fight.", version = 1.51)
  14. public class AIOFighter extends Script implements PaintListener, MessageListener {
  15.  
  16. public String[] NPC_ARRAY;
  17. public String[] LOOT_ARRAY;
  18. public Potion[] POTION_ARRAY;
  19. public Long START_TIME, ANTIBAN;
  20. public int[] SKILLS_ARRAY = new int[25];
  21. public String STATUS;
  22. public boolean BURY_MODE, START, SPEC_SWAP, SPEC_EQUIP, B2PB2B_TAB, B2PB2B_SPELL, NATURE, FIRE, EARTH, WATER, SWAP, MEMBER, walk, frombank, tobank, FIRST_TIME, BANKING, canUpdate, MULTI_COMBAT, NEED_TO_BANK;
  23. public RSItem EQUIPPED_WEAPON, EQUIPPED_SHIELD, SPECIAL_WEAPON, STAFF, TOME;
  24. public int PERCENT_TO_SPEC, RADIUS;
  25. public RSNPC TARGET;
  26. public RSTile START_TILE;
  27. Potion SARADOMIN_BREW = new Potion(new int[]{6685, 6687, 6689, 6691}, new int[][]{{Skills.DEFENSE, 0, 25}}, true, false, false, false, false, false);
  28. Potion ZAMORAK_BREW = new Potion(new int[]{2450, 189, 191, 193}, new int[][]{{Skills.ATTACK, 2, 20}, {Skills.STRENGTH, 2, 12}}, false, false, false, true, false, false);
  29. Potion ANTIPOISON_PLUS_PLUS = new Potion(new int[]{5952, 5954, 5956, 5958}, null, false, true, false, false, false, false);
  30. Potion ANTIPOISON_PLUS = new Potion(new int[]{5943, 5945, 5947, 5949}, null, false, true, false, false, false, false);
  31. Potion SUPER_ANTIPOISON = new Potion(new int[]{2448, 181, 183, 185}, null, false, true, false, false, false, false);
  32. Potion ANTIPOISON = new Potion(new int[]{2446, 175, 177, 179}, null, false, true, false, false, false, false);
  33. Potion GUTHIX_REST = new Potion(new int[]{4417, 4419, 4421, 4423}, null, true, true, false, false, false, false);
  34. Potion SANFEW_SERUM = new Potion(new int[]{10925, 10927, 10929, 10931}, null, false, true, false, true, true, true);
  35. Potion SUPER_RESTORE = new Potion(new int[]{3024, 3026, 3028, 3030}, null, false, false, false, true, true, true);
  36. Potion RESTORE_POTION = new Potion(new int[]{2430, 127, 129, 131}, new int[][]{{Skills.ATTACK, 0, 0}, {Skills.DEFENSE, 0, 0}, {Skills.STRENGTH, 0, 0}, {Skills.RANGE, 0, 0}, {Skills.MAGIC, 0, 0}}, false, false, false, false, false, false);
  37. Potion SUPER_PRAYER = new Potion(new int[]{15328, 15329, 15330, 15331}, null, false, false, false, true, false, false);
  38. Potion PRAYER_POTION = new Potion(new int[]{2434, 139, 141, 143}, null, false, false, false, true, false, false);
  39. Potion SUMMONING_POTION = new Potion(new int[]{12140, 12142, 12144, 12146}, null, false, false, false, false, true, false);
  40. Potion OVERLOAD = new Potion(new int[]{15332, 15333, 15334, 15335}, new int[][]{{Skills.ATTACK, 0, 0}}, false, false, true, false, false, false);
  41. Potion EXTREME_STRENGTH = new Potion(new int[]{15312, 15313, 15314, 15315}, new int[][]{{Skills.STRENGTH, 5, 22}}, false, false, false, false, false, false);
  42. Potion EXTREME_ATTACK = new Potion(new int[]{15208, 15309, 15310, 15311}, new int[][]{{Skills.ATTACK, 5, 22}}, false, false, false, false, false, false);
  43. Potion EXTREME_DEFENCE = new Potion(new int[]{15316, 15317, 15318, 15319}, new int[][]{{Skills.DEFENSE, 5, 22}}, false, false, false, false, false, false);
  44. Potion EXTREME_RANGING = new Potion(new int[]{15324, 15325, 15326, 15327}, new int[][]{{Skills.RANGE, 4, 19}}, false, false, false, false, false, false);
  45. Potion EXTREME_MAGIC = new Potion(new int[]{15320, 15321, 15322, 15323}, new int[][]{{Skills.MAGIC, 7, 0}}, false, false, false, false, false, false);
  46. Potion SUPER_STRENGTH = new Potion(new int[]{2440, 157, 159, 161}, new int[][]{{Skills.STRENGTH, 5, 15}}, false, false, false, false, false, false);
  47. Potion SUPER_ATTACK = new Potion(new int[]{2436, 145, 147, 149}, new int[][]{{Skills.ATTACK, 5, 15}}, false, false, false, false, false, false);
  48. Potion SUPER_DEFENCE = new Potion(new int[]{2442, 163, 165, 167}, new int[][]{{Skills.DEFENSE, 5, 15}}, false, false, false, false, false, false);
  49. Potion RANGING_POTION = new Potion(new int[]{2444, 169, 171, 173}, new int[][]{{Skills.RANGE, 4, 10}}, false, false, false, false, false, false);
  50. Potion MAGIC_POTION = new Potion(new int[]{3040, 3042, 3044, 3046}, new int[][]{{Skills.MAGIC, 5, 0}}, false, false, false, false, false, false);
  51. Potion COMBAT_POTION = new Potion(new int[]{9739, 9741, 9743, 9745}, new int[][]{{Skills.STRENGTH, 3, 10}, {Skills.ATTACK, 3, 10}}, false, false, false, false, false, false);
  52. Potion ATTACK_POTION = new Potion(new int[]{2428, 121, 123, 125}, new int[][]{{Skills.ATTACK, 3, 10}}, false, false, false, false, false, false);
  53. Potion STRENGTH_POTION = new Potion(new int[]{113, 115, 117, 119}, new int[][]{{Skills.STRENGTH, 3, 10}}, false, false, false, false, false, false);
  54. Potion DEFENCE_POTION = new Potion(new int[]{2432, 133, 135, 137}, new int[][]{{Skills.DEFENSE, 3, 10}}, false, false, false, false, false, false);
  55. Potion[] FULL_POTION_ARRAY = {SARADOMIN_BREW, ZAMORAK_BREW, ANTIPOISON_PLUS_PLUS, ANTIPOISON_PLUS, SUPER_ANTIPOISON, ANTIPOISON, GUTHIX_REST, SANFEW_SERUM, SUPER_RESTORE, RESTORE_POTION, SUPER_PRAYER, PRAYER_POTION, SUMMONING_POTION, OVERLOAD, EXTREME_STRENGTH, EXTREME_ATTACK, EXTREME_DEFENCE, EXTREME_RANGING, EXTREME_MAGIC, SUPER_STRENGTH, SUPER_ATTACK, SUPER_DEFENCE, RANGING_POTION, MAGIC_POTION, COMBAT_POTION, ATTACK_POTION, STRENGTH_POTION, DEFENCE_POTION};
  56. public int[] PERCENTAGE = {10, 25, 30, 35, 50, 55, 60, 65, 75, 100};
  57. public String[][] SPECIAL_WEAPONS = {
  58. {"rod of ivandis", "ivandis flail", "rune thrownaxe"},
  59. {"dragon dagger", "dragon longsword", "dragon mace", "dragon spear", "rune claws", "vesta's longsword"},
  60. {"dragon halberd"},
  61. {"statius's warhammer", "statius' warhammer", "magic longbow"},
  62. {"dragon claws", "abyssal whip", "granite maul", "granite mace", "darklight", "penance trident", "vesta's spear", "armadyl godsword", "saradomin godsword", "zanik's crossbow", "morrigan's throwing axe", "morrigan's javelin", "hand cannon"},
  63. {"dragon scimitar", "magic shortbow", "saradomin bow", "guthix bow", "zamorak bow"},
  64. {"dragon 2h sword", "abyssal vine whip", "korasi's sword", "zamorak godsword"},
  65. {"dark bow"},
  66. {"brackish blade", "bone dagger", "brine sabre", "dorgeshuun crossbow"},
  67. {"dragon pickaxe", "dragon battleaxe", "dragon hatchet", "excalibur", "staff of light", "ancient mace", "saradomin sword", "dwarven army axe", "bandos godsword", "seercull", "enhanced excalibur"}
  68. };
  69. public int[] DROP_ARRAY = {229, 1923, 2313, 1980, 7728};
  70. public ArrayList<Object> pathtobank = new ArrayList<Object>();
  71. public ArrayList<Object> pathfrombank = new ArrayList<Object>();
  72. HashMap map = new HashMap<Integer, Integer>();
  73.  
  74. public void onRepaint(Graphics grphcs) {
  75. Long RUNTIME = System.currentTimeMillis() - START_TIME;
  76. int HOURS = 0;
  77. while (RUNTIME > 3600000) {
  78. HOURS++;
  79. RUNTIME -= 3600000;
  80. }
  81. int MINUTES = 0;
  82. while (RUNTIME > 60000) {
  83. MINUTES++;
  84. RUNTIME -= 60000;
  85. }
  86. int SECONDS = 0;
  87. while (RUNTIME > 1000) {
  88. SECONDS++;
  89. RUNTIME -= 1000;
  90. }
  91. grphcs.setColor(Color.WHITE);
  92. grphcs.drawLine(0, (int) mouse.getLocation().getY(), game.getWidth(), (int) mouse.getLocation().getY());
  93. grphcs.drawLine((int) mouse.getLocation().getX(), 0, (int) mouse.getLocation().getX(), game.getHeight());
  94. grphcs.drawString("AIOFighter v" + AIOFighter.class.getAnnotation(ScriptManifest.class).version(), 5, 15);
  95. grphcs.drawString("By hellomot0123", 5, 30);
  96. grphcs.drawString("Runtime: " + HOURS + ":" + MINUTES + ":" + SECONDS, 5, 45);
  97. grphcs.drawString("Status: " + STATUS, 5, 60);
  98. int counter = 0;
  99. int visible = 0;
  100. for (int i : SKILLS_ARRAY) {
  101. if (skills.getCurrentExp(counter) > i) {
  102. int XP_CHANGE = (skills.getCurrentExp(counter) - i);
  103. grphcs.drawString(Skills.getSkillName(counter).replaceFirst(Skills.getSkillName(counter).substring(0, 1), Skills.getSkillName(counter).substring(0, 1).toUpperCase()) + ": " + XP_CHANGE + " (" + (int) (XP_CHANGE * 3600000D / (System.currentTimeMillis() - START_TIME)) + ") XP Gained (Per Hour)", 5, (75 + visible * 15));
  104. visible++;
  105. }
  106. counter++;
  107. }
  108. }
  109.  
  110. public void messageReceived(MessageEvent me) {
  111. if (me.getID() == 0) {
  112. if (me.getMessage().toLowerCase().contains("you need to be on a members")) {
  113. MEMBER = false;
  114. }
  115. }
  116. }
  117.  
  118. public enum States {
  119.  
  120. FIGHTING, LOOTING, EATING, STOPPING, ANTIBAN, POTTING, SPECCING, RE_EQUIPPING_GEAR, TURNING_RUN_ON, CLICKING_CONTINUE, DROPPING_JUNK, CASTING_B2P_B2B, BURYING_SCATTERING, RECORDING, WALKING_TO_BANK, WALKING_TO_NPC, BANKING, QUICK_PRAY;
  121. };
  122.  
  123. public States getState() {
  124. if (FIRST_TIME && BANKING) {
  125. STATUS = "Recording bank path & setting what to withdraw";
  126. return States.RECORDING;
  127. }
  128. if (interfaces.canContinue()) {
  129. STATUS = "Clicking continue";
  130. return States.CLICKING_CONTINUE;
  131. }
  132. if (!walking.isRunEnabled() && walking.getEnergy() > 30) {
  133. STATUS = "Turning Run On";
  134. return States.TURNING_RUN_ON;
  135. }
  136. if (!BANKING && shallWeBank()) {
  137. STATUS = "Stopping Script";
  138. return States.STOPPING;
  139. }
  140. if (BANKING && (shallWeBank() || NEED_TO_BANK) && !atBank()) {
  141. STATUS = "Walking to Bank";
  142. return States.WALKING_TO_BANK;
  143. }
  144. if (BANKING && (shallWeBank() || NEED_TO_BANK) && atBank()) {
  145. STATUS = "Banking";
  146. return States.BANKING;
  147. }
  148. if (BANKING && !shallWeBank() && atBank()) {
  149. STATUS = "Walking to NPC";
  150. return States.WALKING_TO_NPC;
  151. }
  152. if (activateAntiban()) {
  153. STATUS = "Antiban";
  154. return States.ANTIBAN;
  155. }
  156. if (areWePraying() && !prayer.isQuickPrayerOn()) {
  157. STATUS = "Turning on Quick Prayers";
  158. return States.QUICK_PRAY;
  159. }
  160. if ((B2PB2B_TAB || B2PB2B_SPELL) && needToB2PB2B()) {
  161. STATUS = "Casting B2P/B2B";
  162. return States.CASTING_B2P_B2B;
  163. }
  164. if (foodInInventory() && needToEat()) {
  165. STATUS = "Eating";
  166. return States.EATING;
  167. }
  168. if (getJunk() != null) {
  169. STATUS = "Dropping Junk";
  170. return States.DROPPING_JUNK;
  171. }
  172. if (BURY_MODE && haveBuryOrScatter() != null) {
  173. STATUS = "Burying bones / Scattering ash";
  174. return States.BURYING_SCATTERING;
  175. }
  176. if ((!canWeSpecial() && SPEC_SWAP && specWepEquipped() && notSwitchingToStaff()) || (SWAP && specWepEquipped() && notSwitchingToSpec())) {
  177. STATUS = "Re-Equipping Gear";
  178. return States.RE_EQUIPPING_GEAR;
  179. }
  180. if (LOOT_ARRAY.length != 0 && lootOnFloor() && !isPlayerInCombat() && !inventoryFull()) {
  181. STATUS = "Looting";
  182. return States.LOOTING;
  183. }
  184. if (POTION_ARRAY.length != 0 && needToPot() != null) {
  185. STATUS = "Potting";
  186. return States.POTTING;
  187. }
  188. if (NPC_ARRAY.length != 0 && availableNPC() && !attackingTarget()) {
  189. STATUS = "Fighting";
  190. return States.FIGHTING;
  191. }
  192. if ((SPEC_SWAP || SPEC_EQUIP) && canWeSpecial()) {
  193. STATUS = "Speccing";
  194. return States.SPECCING;
  195. }
  196. return null;
  197. }
  198.  
  199. @Override
  200. public boolean onStart() {
  201. FIRST_TIME = true;
  202. MEMBER = true;
  203. ANTIBAN = (long) 0;
  204. mouse.setSpeed(0);
  205. java.awt.EventQueue.invokeLater(new Runnable() {
  206.  
  207. public void run() {
  208. new GUI().setVisible(true);
  209. }
  210. });
  211. while (!START) {
  212. sleep(100);
  213. }
  214. determineSpecial();
  215. determineRuneSupply();
  216. determineB2PB2B();
  217. while (camera.getPitch() != 100) {
  218. camera.setPitch(100);
  219. }
  220. POTION_ARRAY = potionsInUse();
  221. getSkillData();
  222. START_TIME = System.currentTimeMillis();
  223. START_TILE = getMyPlayer().getLocation();
  224. return true;
  225. }
  226.  
  227. @Override
  228. public int loop() {
  229. try {
  230. switch (getState()) {
  231. case QUICK_PRAY:
  232. prayer.setQuickPrayer(true);
  233. sleep(1000);
  234. break;
  235. case WALKING_TO_BANK:
  236. walkToBank();
  237. break;
  238. case BANKING:
  239. bank();
  240. break;
  241. case WALKING_TO_NPC:
  242. walkToNPC();
  243. break;
  244. case RECORDING:
  245. java.awt.EventQueue.invokeLater(new Runnable() {
  246.  
  247. public void run() {
  248. new GUI2().setVisible(true);
  249. }
  250. });
  251. env.setUserInput(1);
  252. while (FIRST_TIME) {
  253. recording();
  254. }
  255. break;
  256. case BURYING_SCATTERING:
  257. buryScatter();
  258. break;
  259. case CASTING_B2P_B2B:
  260. castB2PB2B();
  261. break;
  262. case DROPPING_JUNK:
  263. drop();
  264. break;
  265. case CLICKING_CONTINUE:
  266. interfaces.clickContinue();
  267. break;
  268. case TURNING_RUN_ON:
  269. walking.setRun(true);
  270. sleep(1000);
  271. break;
  272. case RE_EQUIPPING_GEAR:
  273. equip();
  274. break;
  275. case SPECCING:
  276. spec();
  277. break;
  278. case POTTING:
  279. pot();
  280. break;
  281. case LOOTING:
  282. loot();
  283. break;
  284. case FIGHTING:
  285. fight();
  286. break;
  287. case EATING:
  288. eat();
  289. break;
  290. case STOPPING:
  291. env.saveScreenshot(true);
  292. log("Screenshot saved.");
  293. stopScript(true);
  294. break;
  295. case ANTIBAN:
  296. antiban();
  297. break;
  298. }
  299. } catch (Exception e) {
  300. }
  301. return 0;
  302. }
  303.  
  304. @Override
  305. public void onFinish() {
  306. log("Thankyou for using AIOFighter.");
  307. }
  308.  
  309. public void walkToBank() {
  310. for (Object o : pathtobank) {
  311. if (o instanceof ArrayList) {
  312. ArrayList<RSTile> temp = (ArrayList<RSTile>) o;
  313. for (int i = 0; i < temp.size(); i++) {
  314. Timer timer2 = new Timer(10000);
  315. while (calc.distanceTo(temp.get(i)) > 3) {
  316. if (!timer2.isRunning()) {
  317. break;
  318. }
  319. walking.walkTileMM(temp.get(i));
  320. waitToMove();
  321. }
  322. }
  323. sleep(2000);
  324. }
  325. if (o instanceof String[]) {
  326. String[] temp = (String[]) o;
  327. RSObject object = objects.getNearest(Integer.parseInt(temp[0]));
  328. if (!object.isOnScreen()) {
  329. camera.turnTo(object);
  330. }
  331. Timer timer = new Timer(10000);
  332. while (!object.interact(temp[1])) {
  333. if (!timer.isRunning()) {
  334. break;
  335. }
  336. object.interact(temp[1]);
  337. }
  338. sleep(3000);
  339. }
  340. }
  341. }
  342.  
  343. public void walkToNPC() {
  344. for (Object o : pathfrombank) {
  345. if (o instanceof ArrayList) {
  346. ArrayList<RSTile> temp = (ArrayList<RSTile>) o;
  347. for (int i = 0; i < temp.size(); i++) {
  348. Timer timer2 = new Timer(10000);
  349. while (calc.distanceTo(temp.get(i)) > 3) {
  350. if (!timer2.isRunning()) {
  351. break;
  352. }
  353. walking.walkTileMM(temp.get(i));
  354. waitToMove();
  355. }
  356. }
  357. sleep(2000);
  358. }
  359. if (o instanceof String[]) {
  360. String[] temp = (String[]) o;
  361. RSObject object = objects.getNearest(Integer.parseInt(temp[0]));
  362. if (!object.isOnScreen()) {
  363. camera.turnTo(object);
  364. }
  365. Timer timer = new Timer(10000);
  366. while (!object.interact(temp[1])) {
  367. if (!timer.isRunning()) {
  368. break;
  369. }
  370. object.interact(temp[1]);
  371. }
  372. sleep(3000);
  373. }
  374. }
  375. }
  376.  
  377. public void bank() {
  378. while (inventory.contains(EQUIPPED_WEAPON.getID())) {
  379. inventory.getItem(EQUIPPED_WEAPON.getID()).doClick(true);
  380. sleep(1000);
  381. }
  382. while (inventory.contains(EQUIPPED_SHIELD.getID())) {
  383. inventory.getItem(EQUIPPED_WEAPON.getID()).doClick(true);
  384. sleep(1000);
  385. }
  386. Timer timer = new Timer(3600000);
  387. while (shallWeBank()) {
  388. if (!timer.isRunning()) {
  389. break;
  390. }
  391.  
  392. if (!bank.isOpen()) {
  393. bank.open();
  394. } else {
  395. if (inventory.getCount() == 0) {
  396. if (!map.isEmpty()) {
  397. for (Object o : map.keySet()) {
  398. Integer i = (Integer) o;
  399. while (!inventory.contains(i)) {
  400. bank.withdraw(i, (Integer) map.get(i));
  401. sleep(2000);
  402. }
  403. }
  404. }
  405. bank.close();
  406. POTION_ARRAY = potionsInUse();
  407. determineSpecial();
  408. determineRuneSupply();
  409. determineB2PB2B();
  410. } else {
  411. bank.depositAll();
  412. }
  413. }
  414. }
  415. NEED_TO_BANK = false;
  416. }
  417.  
  418. public boolean atBank() {
  419. ArrayList<RSTile> temp = (ArrayList<RSTile>) pathtobank.get((pathtobank.size() - 1));
  420. return (calc.distanceTo(temp.get((temp.size() - 1))) <= 10);
  421. }
  422.  
  423. public boolean atNPC() {
  424. ArrayList<RSTile> temp = (ArrayList<RSTile>) pathfrombank.get((pathfrombank.size() - 1));
  425. return (calc.distanceTo(temp.get((temp.size() - 1))) <= RADIUS);
  426. }
  427.  
  428. public RSTile getRSTile() {
  429. ArrayList<RSTile> temp = (ArrayList<RSTile>) pathfrombank.get((pathfrombank.size() - 1));
  430. return temp.get((temp.size() - 1));
  431. }
  432.  
  433. public boolean notSwitchingToStaff() {
  434. if (B2PB2B_SPELL && SWAP) {
  435. if (inventory.contains(STAFF.getID())) {
  436. return true;
  437. } else {
  438. return false;
  439. }
  440. }
  441. return true;
  442. }
  443.  
  444. public boolean notSwitchingToSpec() {
  445. if (SPEC_SWAP) {
  446. if (inventory.contains(SPECIAL_WEAPON.getID())) {
  447. return true;
  448. } else {
  449. return false;
  450. }
  451. }
  452. return true;
  453. }
  454.  
  455. public void buryScatter() {
  456. haveBuryOrScatter().doClick(true);
  457. sleep(500);
  458. }
  459.  
  460. public RSItem haveBuryOrScatter() {
  461. for (RSItem i : inventory.getItems()) {
  462. if (i == null || i.getID() == -1) {
  463. continue;
  464. }
  465. if (i.getComponent().getActions() == null || i.getComponent().getActions()[0] == null) {
  466. continue;
  467. }
  468. for (String s : i.getComponent().getActions()) {
  469. if (s != null) {
  470. if (s.contains("Bury") || s.contains("Scatter")) {
  471. return i;
  472. }
  473. }
  474. }
  475. }
  476. return null;
  477. }
  478.  
  479. public boolean needToB2PB2B() {
  480. if (!foodInInventory()) {
  481. if (inventoryHasBones()) {
  482. return true;
  483. }
  484. }
  485. return false;
  486. }
  487.  
  488. public boolean inventoryHasBones() {
  489. for (RSItem i : inventory.getItems()) {
  490. if (i.getName().toLowerCase().contains("bones") && !i.getName().toLowerCase().equals("bones to peaches") && !i.getName().toLowerCase().equals("bones to bananas")) {
  491. return true;
  492. }
  493. }
  494. return false;
  495. }
  496.  
  497. public void castB2PB2B() {
  498. if (B2PB2B_TAB) {
  499. if (inventory.contains(8015)) {
  500. inventory.getItem(8015).interact("break");
  501. sleep(3000);
  502. return;
  503. }
  504. if (inventory.contains(8014)) {
  505. inventory.getItem(8014).interact("break");
  506. sleep(3000);
  507. return;
  508. }
  509. }
  510. if (B2PB2B_SPELL) {
  511. if (!SWAP) {
  512. if (skills.getCurrentLevel(Skills.MAGIC) >= 65 && MEMBER) {
  513. magic.castSpell(Magic.Spell.BONES_TO_PEACHES);
  514. } else {
  515. magic.castSpell(Magic.Spell.BONES_TO_BANANAS);
  516. }
  517. } else {
  518. if (!specWepEquipped()) {
  519. if (TOME != null) {
  520. if (inventory.contains(TOME.getID())) {
  521. inventory.getItem(TOME.getID()).doClick(true);
  522. sleep(1000);
  523. return;
  524. }
  525. }
  526. if (STAFF != null) {
  527. if (inventory.contains(STAFF.getID())) {
  528. inventory.getItem(STAFF.getID()).doClick(true);
  529. sleep(1000);
  530. return;
  531. }
  532. }
  533. } else {
  534. if (skills.getCurrentLevel(Skills.MAGIC) >= 65 && MEMBER) {
  535. magic.castSpell(Magic.Spell.BONES_TO_PEACHES);
  536. } else {
  537. magic.castSpell(Magic.Spell.BONES_TO_BANANAS);
  538. }
  539. }
  540. }
  541. }
  542. }
  543.  
  544. public void drop() {
  545. getJunk().interact("drop");
  546. sleep(500);
  547. }
  548.  
  549. public RSItem getJunk() {
  550. for (RSItem i : inventory.getItems()) {
  551. for (int j : DROP_ARRAY) {
  552. if (i.getID() == j) {
  553. return i;
  554. }
  555. }
  556. }
  557. return null;
  558. }
  559.  
  560. public boolean canWeSpecial() {
  561. if (combat.getSpecialBarEnergy() >= PERCENT_TO_SPEC) {
  562. return true;
  563. } else {
  564. return false;
  565. }
  566. }
  567.  
  568. public boolean specWepEquipped() {
  569. return (inventory.contains(EQUIPPED_WEAPON.getID()));
  570. }
  571.  
  572. public void spec() {
  573. if (!combat.isSpecialEnabled()) {
  574. if (SPEC_EQUIP) {
  575. game.openTab(Game.Tab.ATTACK, true);
  576. RSInterface inter = interfaces.get(884);
  577. RSComponent comp = inter.getComponent(4);
  578. comp.doClick(true);
  579. sleep(500);
  580. } else {
  581. if (!specWepEquipped()) {
  582. game.openTab(Game.Tab.INVENTORY, true);
  583. inventory.getItem(SPECIAL_WEAPON.getID()).doClick(true);
  584. sleep(1000);
  585. } else {
  586. game.openTab(Game.Tab.ATTACK, true);
  587. RSInterface inter = interfaces.get(884);
  588. RSComponent comp = inter.getComponent(4);
  589. comp.doClick(true);
  590. sleep(500);
  591. }
  592. }
  593. }
  594. }
  595.  
  596. public void equip() {
  597. if (specWepEquipped()) {
  598. game.openTab(Game.Tab.INVENTORY, true);
  599. if (EQUIPPED_SHIELD.getID() != -1) {
  600. if (inventory.contains(EQUIPPED_SHIELD.getID())) {
  601. inventory.getItem(EQUIPPED_SHIELD.getID()).doClick(true);
  602. sleep(1000);
  603. return;
  604. }
  605. }
  606. inventory.getItem(EQUIPPED_WEAPON.getID()).doClick(true);
  607. sleep(1000);
  608. }
  609. }
  610.  
  611. public Potion needToPot() {
  612. for (Potion p : POTION_ARRAY) {
  613. if (p.havePotion()) {
  614. if (p.activate()) {
  615. return p;
  616. }
  617. }
  618. }
  619. return null;
  620. }
  621.  
  622. public boolean areWePraying() {
  623. for (Potion p : POTION_ARRAY) {
  624. if (p == ZAMORAK_BREW || p == SUPER_RESTORE || p == SUPER_PRAYER || p == PRAYER_POTION) {
  625. return true;
  626. }
  627. }
  628. return false;
  629. }
  630.  
  631. public boolean prayInInventory() {
  632. for (Potion p : POTION_ARRAY) {
  633. if ((p == ZAMORAK_BREW && !p.havePotion()) || (p == SUPER_RESTORE && !p.havePotion()) || (p == SUPER_PRAYER && !p.havePotion()) || (p == PRAYER_POTION && !p.havePotion())) {
  634. return false;
  635. }
  636. }
  637. return true;
  638. }
  639.  
  640. public void pot() {
  641. needToPot().drinkPotion();
  642. }
  643.  
  644. public void determineRuneSupply() {
  645. if (EQUIPPED_WEAPON.getName().toLowerCase().contains("staff") || EQUIPPED_WEAPON.getName().toLowerCase().contains("battlestaff")) {
  646. if (EQUIPPED_WEAPON.getName().toLowerCase().contains("fire") || EQUIPPED_WEAPON.getName().toLowerCase().contains("steam") || EQUIPPED_WEAPON.getName().toLowerCase().contains("lava")) {
  647. FIRE = true;
  648. }
  649. if (EQUIPPED_WEAPON.getName().toLowerCase().contains("water") || EQUIPPED_WEAPON.getName().toLowerCase().contains("mud") || EQUIPPED_WEAPON.getName().toLowerCase().contains("steam")) {
  650. WATER = true;
  651. }
  652. if (EQUIPPED_WEAPON.getName().toLowerCase().contains("earth") || EQUIPPED_WEAPON.getName().toLowerCase().contains("mud") || EQUIPPED_WEAPON.getName().toLowerCase().contains("lava")) {
  653. EARTH = true;
  654. }
  655. if (EQUIPPED_WEAPON.getName().toLowerCase().contains("nature")) {
  656. NATURE = true;
  657. }
  658. }
  659. if (EQUIPPED_SHIELD.getName().toLowerCase().equals("tome of frost")) {
  660. WATER = true;
  661. }
  662. for (RSItem i : inventory.getItems()) {
  663. if (i.getName().toLowerCase().contains("staff") || i.getName().toLowerCase().contains("battlestaff")) {
  664. if (i.getName().toLowerCase().contains("fire") || i.getName().toLowerCase().contains("steam") || i.getName().toLowerCase().contains("lava")) {
  665. FIRE = true;
  666. SWAP = true;
  667. STAFF = i;
  668. }
  669. if (i.getName().toLowerCase().contains("water") || i.getName().toLowerCase().contains("mud") || i.getName().toLowerCase().contains("steam")) {
  670. WATER = true;
  671. SWAP = true;
  672. STAFF = i;
  673. }
  674. if (i.getName().toLowerCase().contains("earth") || i.getName().toLowerCase().contains("mud") || i.getName().toLowerCase().contains("lava")) {
  675. EARTH = true;
  676. SWAP = true;
  677. STAFF = i;
  678. }
  679. if (i.getName().toLowerCase().contains("nature")) {
  680. NATURE = true;
  681. SWAP = true;
  682. STAFF = i;
  683. }
  684. }
  685. if (i.getName().toLowerCase().equals("tome of frost")) {
  686. WATER = true;
  687. SWAP = true;
  688. TOME = i;
  689. }
  690. }
  691. if (inventory.contains(561)) {
  692. NATURE = true;
  693. }
  694. if (inventory.contains(554)) {
  695. FIRE = true;
  696. }
  697. if (inventory.contains(555)) {
  698. WATER = true;
  699. }
  700. if (inventory.contains(557)) {
  701. EARTH = true;
  702. }
  703. }
  704.  
  705. public void determineB2PB2B() {
  706. B2PB2B_TAB = (inventory.contains(8014) || inventory.contains(8015));
  707. if (!B2PB2B_TAB) {
  708. if (NATURE && EARTH && WATER && skills.getCurrentLevel(Skills.MAGIC) >= 10) {
  709. B2PB2B_SPELL = true;
  710. }
  711. }
  712. }
  713.  
  714. public void determineSpecial() {
  715. while (game.getTab() != Game.Tab.EQUIPMENT) {
  716. game.openTab(Game.Tab.EQUIPMENT, true);
  717. }
  718. while (game.getTab() != Game.Tab.INVENTORY) {
  719. EQUIPPED_WEAPON = equipment.getItem(Equipment.WEAPON);
  720. EQUIPPED_SHIELD = equipment.getItem(Equipment.SHIELD);
  721. game.openTab(Game.Tab.INVENTORY, true);
  722. }
  723. for (RSItem item : inventory.getItems()) {
  724. for (int i = 0; i < SPECIAL_WEAPONS.length; i++) {
  725. for (int j = 0; j < SPECIAL_WEAPONS[i].length; j++) {
  726. if (item.getName().toLowerCase().contains(SPECIAL_WEAPONS[i][j])) {
  727. SPECIAL_WEAPON = item;
  728. PERCENT_TO_SPEC = PERCENTAGE[i];
  729. }
  730. }
  731. }
  732. }
  733. SPEC_SWAP = SPECIAL_WEAPON != null;
  734. if (!SPEC_SWAP) {
  735. for (int i = 0; i < SPECIAL_WEAPONS.length; i++) {
  736. for (int j = 0; j < SPECIAL_WEAPONS[i].length; j++) {
  737. if (EQUIPPED_WEAPON.getName().toLowerCase().contains(SPECIAL_WEAPONS[i][j])) {
  738. SPEC_EQUIP = true;
  739. PERCENT_TO_SPEC = PERCENTAGE[i];
  740. }
  741. }
  742. }
  743. }
  744. }
  745.  
  746. public Potion[] potionsInUse() {
  747. ArrayList<Potion> TEMP = new ArrayList<Potion>();
  748. for (Potion p : FULL_POTION_ARRAY) {
  749. if (p.havePotion()) {
  750. TEMP.add(p);
  751. }
  752. }
  753. Potion[] TEMP2 = new Potion[TEMP.size()];
  754. TEMP.toArray(TEMP2);
  755. return TEMP2;
  756. }
  757.  
  758. public boolean shallWeBank() {
  759. if (!isPlayerInCombat()) {
  760. if (inventoryFull()) {
  761. NEED_TO_BANK = true;
  762. return true;
  763. }
  764. if (!BANKING && !foodInInventory() && combat.getHealth() < 50 && !areWePraying()) {
  765. NEED_TO_BANK = true;
  766. return true;
  767. }
  768. if (BANKING && !foodInInventory() && !areWePraying()) {
  769. NEED_TO_BANK = true;
  770. return true;
  771. }
  772. if (areWePraying() && !prayInInventory()) {
  773. NEED_TO_BANK = true;
  774. return true;
  775. }
  776. }
  777. return false;
  778. }
  779.  
  780. public boolean activateAntiban() {
  781. if (System.currentTimeMillis() > ANTIBAN) {
  782. ANTIBAN = System.currentTimeMillis() + random(5000, 30000);
  783. return true;
  784. }
  785. return false;
  786. }
  787.  
  788. private void antiban() {
  789. Thread mouseThread = new Thread() {
  790.  
  791. @Override
  792. public void run() {
  793. switch (random(0, 9)) {
  794. case 0:
  795. mouse.moveOffScreen();
  796. break;
  797. case 1:
  798. mouse.move(random(0, game.getWidth()), random(0, game.getHeight()));
  799. break;
  800. case 2:
  801. mouse.moveSlightly();
  802. break;
  803. case 3:
  804. RSNPC NPC = npcs.getNearest(NPC_FILTER);
  805. if (NPC != null) {
  806. NPC.interact("examine");
  807. }
  808. break;
  809. case 4:
  810. RSPlayer PLAYER = players.getNearest(new Filter<RSPlayer>() {
  811.  
  812. public boolean accept(RSPlayer p) {
  813. if (p.isOnScreen() && !p.equals(getMyPlayer())) {
  814. return true;
  815. }
  816. return false;
  817. }
  818. });
  819. if (PLAYER != null) {
  820. mouse.click(PLAYER.getScreenLocation(), false);
  821. }
  822. break;
  823. }
  824. }
  825. };
  826. Thread keyThread = new Thread() {
  827.  
  828. @Override
  829. public void run() {
  830. switch (random(0, 1)) {
  831. case 0:
  832. camera.setAngle(random(0, 360));
  833. break;
  834. }
  835. }
  836. };
  837.  
  838. if (random(0, 1) == 0) {
  839. keyThread.start();
  840. sleep(random(0, 600));
  841. mouseThread.start();
  842. } else {
  843. mouseThread.start();
  844. sleep(random(0, 600));
  845. keyThread.start();
  846. }
  847. }
  848.  
  849. public void getSkillData() {
  850. for (int counter = 0; counter <= 24; counter++) {
  851. SKILLS_ARRAY[counter] = skills.getCurrentExp(counter);
  852. }
  853. }
  854.  
  855. public boolean inventoryFull() {
  856. if (inventory.isFull()) {
  857. if (BURY_MODE && haveBuryOrScatter() != null) {
  858. buryScatter();
  859. return false;
  860. }
  861. if (foodInInventory()) {
  862. eat();
  863. if (inventory.isFull()) {
  864. return inventoryFull();
  865. }
  866. return false;
  867. }
  868. return true;
  869. } else {
  870. return false;
  871. }
  872. }
  873.  
  874. public boolean foodInInventory() {
  875. return getFood() != null;
  876. }
  877.  
  878. private RSItem getFood() {
  879. for (RSItem i : inventory.getItems()) {
  880. if (i == null || i.getID() == -1) {
  881. continue;
  882. }
  883. if (i.getComponent().getActions() == null || i.getComponent().getActions()[0] == null) {
  884. continue;
  885. }
  886. for (String s : i.getComponent().getActions()) {
  887. if (s != null) {
  888. if (s.contains("Eat")) {
  889. return i;
  890. }
  891. }
  892. }
  893. }
  894. return null;
  895. }
  896.  
  897. public boolean needToEat() {
  898. return combat.getHealth() < 60;
  899. }
  900.  
  901. public void eat() {
  902. RSItem i = getFood();
  903. if (!i.doClick(true)) {
  904. return;
  905. }
  906. sleep(2000);
  907. }
  908.  
  909. public boolean lootOnFloor() {
  910. return groundItems.getNearest(LOOT_FILTER) != null;
  911. }
  912.  
  913. public void loot() {
  914. RSGroundItem LOOT = groundItems.getNearest(LOOT_FILTER);
  915. if (LOOT != null) {
  916. if (LOOT.isOnScreen()) {
  917. if (!LOOT.interact("Take " + LOOT.getItem().getName())) {
  918. return;
  919. }
  920. if (calc.distanceTo(LOOT.getLocation()) == 0) {
  921. sleep(500);
  922. return;
  923. }
  924. waitToMove();
  925. } else {
  926. walking.walkTileMM(LOOT.getLocation());
  927. waitLOOTOnScreen(LOOT);
  928. }
  929. }
  930. }
  931.  
  932. public void fight() {
  933. if (TARGET != null) {
  934. if (TARGET.isOnScreen()) {
  935. if (!TARGET.interact("Attack " + TARGET.getName())) {
  936. return;
  937. }
  938. if (calc.distanceTo(TARGET) < 1) {
  939. sleep(500);
  940. return;
  941. }
  942. waitToMove();
  943. } else {
  944. walking.walkTileMM(TARGET.getLocation());
  945. waitNPCOnScreen(TARGET);
  946. }
  947. }
  948. }
  949.  
  950. public void waitNPCOnScreen(RSNPC TARGET) {
  951. Timer timer = new Timer(4000);
  952. while (!TARGET.isOnScreen()) {
  953. if (!timer.isRunning()) {
  954. break;
  955. }
  956. }
  957. }
  958.  
  959. public void waitLOOTOnScreen(RSGroundItem LOOT) {
  960. Timer timer = new Timer(4000);
  961. while (!LOOT.isOnScreen()) {
  962. if (!timer.isRunning()) {
  963. break;
  964. }
  965. }
  966. }
  967.  
  968. public void waitToMove() {
  969. Timer timer = new Timer(2000);
  970. while (!getMyPlayer().isMoving()) {
  971. if (!timer.isRunning()) {
  972. break;
  973. }
  974. }
  975. while (getMyPlayer().isMoving()) {
  976. }
  977. }
  978. private final Filter<RSNPC> NPC_FILTER = new Filter<RSNPC>() {
  979.  
  980. public boolean accept(RSNPC NPC) {
  981. for (String s : NPC_ARRAY) {
  982. if ((NPC.getName().toLowerCase()).equals(s)) {
  983. if (!NPC.isDead() && NPC.isValid() && NPC.getLevel() > 0) {
  984. if ((!BANKING && calc.distanceBetween(START_TILE, NPC.getLocation()) <= RADIUS) || (BANKING && calc.distanceBetween(getRSTile(), NPC.getLocation()) <= RADIUS)) {
  985. if (underAttack()) {
  986. if (NPCAttackingPlayer(NPC)) {
  987. return true;
  988. }
  989. } else {
  990. if (MULTI_COMBAT) {
  991. if (attacking()) {
  992. if (attackingNPC(NPC)) {
  993. return true;
  994. }
  995. } else {
  996. return true;
  997. }
  998. } else {
  999. if (!NPCInCombat(NPC)) {
  1000. return true;
  1001. }
  1002. }
  1003. }
  1004. }
  1005. }
  1006. }
  1007. }
  1008. return false;
  1009. }
  1010. };
  1011. private final Filter<RSGroundItem> LOOT_FILTER = new Filter<RSGroundItem>() {
  1012.  
  1013. public boolean accept(RSGroundItem LOOT) {
  1014. for (String s : LOOT_ARRAY) {
  1015. try {
  1016. if ((LOOT.getItem().getName().toLowerCase()).equals(s)) {
  1017. if ((!BANKING && calc.distanceBetween(START_TILE, LOOT.getLocation()) <= RADIUS) || (BANKING && calc.distanceBetween(getRSTile(), LOOT.getLocation()) <= RADIUS)) {
  1018. if (B2PB2B_TAB || B2PB2B_SPELL) {
  1019. if (LOOT.getItem().getName().toLowerCase().contains("bones")) {
  1020. if (SPEC_SWAP) {
  1021. if (inventory.getCount() <= 25) {
  1022. return true;
  1023. }
  1024. } else {
  1025. if (inventory.getCount() <= 26) {
  1026. return true;
  1027. }
  1028. }
  1029. } else {
  1030. return true;
  1031. }
  1032. } else {
  1033. return true;
  1034. }
  1035. }
  1036. }
  1037. } catch (Exception e) {
  1038. }
  1039. }
  1040. return false;
  1041. }
  1042. };
  1043.  
  1044. public boolean attacking() {
  1045. try {
  1046. return getMyPlayer().getInteracting() instanceof RSNPC;
  1047. } catch (Exception e) {
  1048. return false;
  1049. }
  1050. }
  1051.  
  1052. public boolean attackingNPC(RSNPC n) {
  1053. try {
  1054. return getMyPlayer().getInteracting().equals(n);
  1055. } catch (Exception e) {
  1056. return false;
  1057. }
  1058. }
  1059.  
  1060. public boolean availableNPC() {
  1061. if (npcs.getNearest(NPC_FILTER) != null) {
  1062. TARGET = npcs.getNearest(NPC_FILTER);
  1063. return true;
  1064. }
  1065. return false;
  1066. }
  1067.  
  1068. public boolean NPCAttackingPlayer(RSNPC n) {
  1069. try {
  1070. if (n.isInteractingWithLocalPlayer()) {
  1071. return true;
  1072. }
  1073. } catch (Exception e) {
  1074. }
  1075. return false;
  1076. }
  1077.  
  1078. public boolean attackingTarget() {
  1079. try {
  1080. if (getMyPlayer().getInteracting().equals(TARGET)) {
  1081. return true;
  1082. }
  1083. } catch (Exception e) {
  1084. }
  1085. return false;
  1086. }
  1087.  
  1088. public boolean NPCInCombat(RSNPC NPC) {
  1089. return NPC.getInteracting() instanceof RSCharacter || NPC.isInCombat();
  1090. }
  1091.  
  1092. public boolean isPlayerInCombat() {
  1093. for (RSNPC NPC : npcs.getAll()) {
  1094. try {
  1095. if (NPC.isInteractingWithLocalPlayer()) {
  1096. return true;
  1097. }
  1098. } catch (Exception e) {
  1099. }
  1100. try {
  1101. if (getMyPlayer().getInteracting().equals(NPC)) {
  1102. return true;
  1103. }
  1104. } catch (Exception e) {
  1105. }
  1106. }
  1107. return false;
  1108. }
  1109.  
  1110. public boolean underAttack() {
  1111. for (RSNPC NPC : npcs.getAll()) {
  1112. try {
  1113. if (NPC.isInteractingWithLocalPlayer()) {
  1114. return true;
  1115. }
  1116. } catch (Exception e) {
  1117. }
  1118. }
  1119. return false;
  1120. }
  1121.  
  1122. public class GUI extends javax.swing.JFrame {
  1123.  
  1124. public GUI() {
  1125. initComponents();
  1126. }
  1127.  
  1128. private void initComponents() {
  1129.  
  1130. jLabel1 = new javax.swing.JLabel();
  1131. jLabel2 = new javax.swing.JLabel();
  1132. jLabel3 = new javax.swing.JLabel();
  1133. NPCBox = new javax.swing.JTextField();
  1134. jLabel4 = new javax.swing.JLabel();
  1135. LOOTBox = new javax.swing.JTextField();
  1136. jLabel5 = new javax.swing.JLabel();
  1137. RADIUSBox = new javax.swing.JTextField();
  1138. BURYBox = new javax.swing.JCheckBox();
  1139. BANKBox = new javax.swing.JCheckBox();
  1140. STARTButton = new javax.swing.JButton();
  1141. MULTICOMBATBox1 = new javax.swing.JCheckBox();
  1142.  
  1143. setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  1144.  
  1145. jLabel1.setText("AIOFighter v" + AIOFighter.class.getAnnotation(ScriptManifest.class).version());
  1146.  
  1147. jLabel2.setText("by hellomot0123");
  1148.  
  1149. jLabel3.setText("NPCs to Fight:");
  1150.  
  1151. NPCBox.setText("Chicken,Cow,etc");
  1152.  
  1153. jLabel4.setText("Loot to take:");
  1154.  
  1155. LOOTBox.setText("Coins,Bones,etc");
  1156.  
  1157. jLabel5.setText("Radius (# tiles):");
  1158.  
  1159. BURYBox.setText("Bury bones/ Scatter ash");
  1160.  
  1161. BANKBox.setText("Use banking");
  1162.  
  1163. STARTButton.setText("START");
  1164. STARTButton.addActionListener(new java.awt.event.ActionListener() {
  1165.  
  1166. public void actionPerformed(java.awt.event.ActionEvent evt) {
  1167. STARTButtonActionPerformed(evt);
  1168. }
  1169. });
  1170.  
  1171. MULTICOMBATBox1.setText("Multicombat area?");
  1172.  
  1173. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  1174. getContentPane().setLayout(layout);
  1175. layout.setHorizontalGroup(
  1176. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jLabel1).addComponent(jLabel2).addComponent(jLabel3).addComponent(NPCBox, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jLabel4).addComponent(LOOTBox, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false).addComponent(RADIUSBox, javax.swing.GroupLayout.Alignment.LEADING).addComponent(jLabel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)).addComponent(BANKBox).addComponent(BURYBox).addComponent(MULTICOMBATBox1).addComponent(STARTButton)).addGap(50, 50, 50)));
  1177. layout.setVerticalGroup(
  1178. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addComponent(jLabel1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel2).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel3).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(NPCBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel4).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(LOOTBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel5).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(RADIUSBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(BURYBox).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(BANKBox).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(MULTICOMBATBox1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(STARTButton).addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
  1179.  
  1180. pack();
  1181. }
  1182.  
  1183. private void STARTButtonActionPerformed(java.awt.event.ActionEvent evt) {
  1184. String[] temp = NPCBox.getText().toLowerCase().split(",");
  1185. NPC_ARRAY = temp;
  1186. String[] temp2 = LOOTBox.getText().toLowerCase().split(",");
  1187. LOOT_ARRAY = temp2;
  1188. BURY_MODE = BURYBox.isSelected();
  1189. BANKING = BANKBox.isSelected();
  1190. MULTI_COMBAT = MULTICOMBATBox1.isSelected();
  1191. try {
  1192. RADIUS = Integer.parseInt(RADIUSBox.getText());
  1193. } catch (Exception e) {
  1194. RADIUS = 10;
  1195. }
  1196. dispose();
  1197. START = true;
  1198. }
  1199. private javax.swing.JCheckBox BANKBox;
  1200. private javax.swing.JCheckBox BURYBox;
  1201. private javax.swing.JTextField LOOTBox;
  1202. private javax.swing.JCheckBox MULTICOMBATBox1;
  1203. private javax.swing.JTextField NPCBox;
  1204. private javax.swing.JTextField RADIUSBox;
  1205. private javax.swing.JButton STARTButton;
  1206. private javax.swing.JLabel jLabel1;
  1207. private javax.swing.JLabel jLabel2;
  1208. private javax.swing.JLabel jLabel3;
  1209. private javax.swing.JLabel jLabel4;
  1210. private javax.swing.JLabel jLabel5;
  1211. }
  1212.  
  1213. public class Potion {
  1214.  
  1215. public int[] ids;
  1216. public int[][] skillboosted;
  1217. public boolean getHealth;
  1218. public boolean isPoisoned;
  1219. public boolean getLifepoints;
  1220. public boolean needPray;
  1221. public boolean needSumm;
  1222. public boolean needRestore;
  1223.  
  1224. public Potion(int[] ids, int[][] skillboosted, boolean getHealth, boolean isPoisoned, boolean getLifepoints, boolean needPray, boolean needSumm, boolean needRestore) {
  1225. this.ids = ids;
  1226. this.skillboosted = skillboosted;
  1227. this.getHealth = getHealth;
  1228. this.isPoisoned = isPoisoned;
  1229. this.getLifepoints = getLifepoints;
  1230. this.needPray = needPray;
  1231. this.needSumm = needSumm;
  1232. this.needRestore = needRestore;
  1233. }
  1234.  
  1235. public int[] getIDs() {
  1236. return ids;
  1237. }
  1238.  
  1239. public boolean activate() {
  1240. boolean temp1, temp2, temp3, temp4, temp5, temp6;
  1241. int counter = 0;
  1242. if (skillboosted == null) {
  1243. temp1 = false;
  1244. } else {
  1245. for (int[] i : skillboosted) {
  1246. if (!skillBoosted(i[0], i[1], i[2])) {
  1247. counter++;
  1248. }
  1249. }
  1250. if (counter > 0) {
  1251. temp1 = true;
  1252. } else {
  1253. temp1 = false;
  1254. }
  1255. }
  1256. if (!getHealth) {
  1257. temp2 = false;
  1258. } else {
  1259. temp2 = combat.getHealth() < 60;
  1260. }
  1261. if (!needRestore) {
  1262. temp3 = false;
  1263. } else {
  1264. temp3 = needRestore();
  1265. }
  1266. if (!needPray) {
  1267. temp4 = false;
  1268. } else {
  1269. temp4 = needPray();
  1270. }
  1271. if (!needSumm) {
  1272. temp5 = false;
  1273. } else {
  1274. temp5 = needSumm();
  1275. }
  1276. if (!isPoisoned) {
  1277. temp6 = false;
  1278. } else {
  1279. temp6 = combat.isPoisoned();
  1280. }
  1281. if (!getLifepoints) {
  1282. return (temp1 || temp2 || temp3 || temp4 || temp5 || temp6);
  1283. } else {
  1284. return (temp1 || temp2 || temp3 || temp4 || temp5 || temp6) && (combat.getLifePoints() > 500);
  1285. }
  1286. }
  1287.  
  1288. public boolean havePotion() {
  1289. return inventory.containsOneOf(ids);
  1290. }
  1291.  
  1292. public void drinkPotion() {
  1293. for (int i = 3; i >= 0; i--) {
  1294. if (inventory.contains(ids[i])) {
  1295. inventory.getItem(ids[i]).doClick(true);
  1296. sleep(2000);
  1297. return;
  1298. }
  1299. }
  1300. }
  1301.  
  1302. public boolean needPray() {
  1303. return ((prayer.getPrayerLeft() * 10 / skills.getRealLevel(Skills.PRAYER)) < 60);
  1304. }
  1305.  
  1306. public boolean needSumm() {
  1307. return (summoning.getSummoningPoints() == 0);
  1308. }
  1309.  
  1310. public boolean skillBoosted(int skill, int constant, int percent) {
  1311. double temp1 = (double) skills.getRealLevel(skill);
  1312. double temp2 = ((double) percent / 100) + 1;
  1313. int temp3 = (int) (temp1 * temp2);
  1314. int temp4 = (temp3 + constant) - skills.getRealLevel(skill);
  1315. int temp5 = temp4 / 2;
  1316. return (skills.getCurrentLevel(skill) >= (skills.getRealLevel(skill) + temp5));
  1317. }
  1318.  
  1319. public boolean needRestore() {
  1320. for (int counter = 0; counter <= 24; counter++) {
  1321. if (counter != Skills.CONSTITUTION && counter != Skills.PRAYER && counter != Skills.SUMMONING) {
  1322. if (!skillBoosted(counter, 0, 0)) {
  1323. return true;
  1324. }
  1325. }
  1326. }
  1327. return false;
  1328. }
  1329. }
  1330.  
  1331. public void recording() {
  1332. if (walk) {
  1333. ArrayList<RSTile> temp = new ArrayList<RSTile>();
  1334. temp.add(getMyPlayer().getLocation());
  1335. while (walk) {
  1336. if (calc.distanceTo(temp.get((temp.size() - 1))) >= 10) {
  1337. temp.add(getMyPlayer().getLocation());
  1338. }
  1339. }
  1340. temp.add(getMyPlayer().getLocation());
  1341. if (frombank) {
  1342. pathfrombank.add(temp);
  1343. canUpdate = true;
  1344. } else if (tobank) {
  1345. pathtobank.add(temp);
  1346. canUpdate = true;
  1347. }
  1348. }
  1349. }
  1350.  
  1351. public class GUI2 extends javax.swing.JFrame {
  1352.  
  1353. public GUI2() {
  1354. initComponents();
  1355. }
  1356.  
  1357. private void initComponents() {
  1358.  
  1359. jTabbedPane1 = new javax.swing.JTabbedPane();
  1360. jPanel1 = new javax.swing.JPanel();
  1361. walkingToggle = new javax.swing.JToggleButton();
  1362. interactToggle = new javax.swing.JToggleButton();
  1363. jScrollPane1 = new javax.swing.JScrollPane();
  1364. tobankBox = new javax.swing.JTextArea();
  1365. jScrollPane2 = new javax.swing.JScrollPane();
  1366. frombankBox = new javax.swing.JTextArea();
  1367. jLabel1 = new javax.swing.JLabel();
  1368. jLabel2 = new javax.swing.JLabel();
  1369. frombankradio = new javax.swing.JRadioButton();
  1370. tobankradio = new javax.swing.JRadioButton();
  1371. jLabel3 = new javax.swing.JLabel();
  1372. jLabel4 = new javax.swing.JLabel();
  1373. jTextField1 = new javax.swing.JTextField();
  1374. jTextField2 = new javax.swing.JTextField();
  1375. jPanel2 = new javax.swing.JPanel();
  1376. jScrollPane3 = new javax.swing.JScrollPane();
  1377. table = new javax.swing.JTable();
  1378. addrow = new javax.swing.JButton();
  1379. STARTButton = new javax.swing.JButton();
  1380.  
  1381. setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  1382.  
  1383. walkingToggle.setText("START WALKING");
  1384. walkingToggle.setToolTipText("");
  1385. walkingToggle.addActionListener(new java.awt.event.ActionListener() {
  1386.  
  1387. public void actionPerformed(java.awt.event.ActionEvent evt) {
  1388. walkingToggleActionPerformed(evt);
  1389. }
  1390. });
  1391.  
  1392. interactToggle.setText("INTERACT WITH OBJECT:");
  1393. interactToggle.setToolTipText("");
  1394. interactToggle.addActionListener(new java.awt.event.ActionListener() {
  1395.  
  1396. public void actionPerformed(java.awt.event.ActionEvent evt) {
  1397. interactToggleActionPerformed(evt);
  1398. }
  1399. });
  1400.  
  1401. tobankBox.setColumns(20);
  1402. tobankBox.setRows(5);
  1403. tobankBox.setEditable(false);
  1404. jScrollPane1.setViewportView(tobankBox);
  1405.  
  1406. frombankBox.setColumns(20);
  1407. frombankBox.setRows(5);
  1408. frombankBox.setEditable(false);
  1409. jScrollPane2.setViewportView(frombankBox);
  1410.  
  1411. jLabel1.setText("From Bank");
  1412.  
  1413. jLabel2.setText("To Bank");
  1414.  
  1415. frombankradio.setText("From Bank");
  1416. frombankradio.setSelected(true);
  1417. frombank = true;
  1418. frombankradio.addActionListener(new java.awt.event.ActionListener() {
  1419.  
  1420. public void actionPerformed(java.awt.event.ActionEvent evt) {
  1421. frombankradioActionPerformed(evt);
  1422. }
  1423. });
  1424.  
  1425. tobankradio.setText("To Bank");
  1426. tobankradio.addActionListener(new java.awt.event.ActionListener() {
  1427.  
  1428. public void actionPerformed(java.awt.event.ActionEvent evt) {
  1429. tobankradioActionPerformed(evt);
  1430. }
  1431. });
  1432.  
  1433. jLabel3.setText("Object ID:");
  1434.  
  1435. jLabel4.setText("Action to perform:");
  1436.  
  1437. javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
  1438. jPanel1.setLayout(jPanel1Layout);
  1439. jPanel1Layout.setHorizontalGroup(
  1440. jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addGap(17, 17, 17).addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(frombankradio).addComponent(tobankradio).addComponent(walkingToggle)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 122, Short.MAX_VALUE).addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(interactToggle).addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jLabel4).addComponent(jLabel3)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)))).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 59, Short.MAX_VALUE).addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))).addContainerGap()).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup().addContainerGap(316, Short.MAX_VALUE).addComponent(jLabel2).addGap(74, 74, 74)).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup().addContainerGap(310, Short.MAX_VALUE).addComponent(jLabel1).addGap(68, 68, 68)));
  1441. jPanel1Layout.setVerticalGroup(
  1442. jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup().addComponent(jLabel1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup().addGap(5, 5, 5).addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(jLabel2).addGap(4, 4, 4)).addGroup(jPanel1Layout.createSequentialGroup().addGap(35, 35, 35).addComponent(frombankradio).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(tobankradio).addGap(18, 18, 18).addComponent(walkingToggle).addGap(18, 18, 18))).addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addGroup(jPanel1Layout.createSequentialGroup().addComponent(interactToggle).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel3).addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel4).addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))).addContainerGap()));
  1443.  
  1444. jTabbedPane1.addTab("Bank Path", jPanel1);
  1445.  
  1446. table.setModel(new javax.swing.table.DefaultTableModel(
  1447. new Object[][]{
  1448. {null, null},
  1449. {null, null},
  1450. {null, null},
  1451. {null, null},
  1452. {null, null},
  1453. {null, null},
  1454. {null, null},
  1455. {null, null},
  1456. {null, null},
  1457. {null, null}
  1458. },
  1459. new String[]{
  1460. "Item ID", "Item Quantity"
  1461. }) {
  1462.  
  1463. Class[] types = new Class[]{
  1464. java.lang.Integer.class, java.lang.Integer.class
  1465. };
  1466.  
  1467. public Class getColumnClass(int columnIndex) {
  1468. return types[columnIndex];
  1469. }
  1470. });
  1471. jScrollPane3.setViewportView(table);
  1472. table.getColumnModel().getColumn(0).setHeaderValue("Item ID");
  1473. table.getColumnModel().getColumn(1).setHeaderValue("Item Quantity");
  1474.  
  1475. addrow.setText("Add row");
  1476. addrow.addActionListener(new java.awt.event.ActionListener() {
  1477.  
  1478. public void actionPerformed(java.awt.event.ActionEvent evt) {
  1479. addrowActionPerformed(evt);
  1480. }
  1481. });
  1482.  
  1483. STARTButton.setText("START");
  1484. STARTButton.addActionListener(new java.awt.event.ActionListener() {
  1485.  
  1486. public void actionPerformed(java.awt.event.ActionEvent evt) {
  1487. STARTButtonActionPerformed(evt);
  1488. }
  1489. });
  1490.  
  1491. javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
  1492. jPanel2.setLayout(jPanel2Layout);
  1493. jPanel2Layout.setHorizontalGroup(
  1494. jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false).addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 344, javax.swing.GroupLayout.PREFERRED_SIZE).addGroup(jPanel2Layout.createSequentialGroup().addComponent(addrow).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(STARTButton))).addContainerGap(74, Short.MAX_VALUE)));
  1495. jPanel2Layout.setVerticalGroup(
  1496. jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup().addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE).addGap(18, 18, 18).addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(addrow).addComponent(STARTButton)).addGap(19, 19, 19)));
  1497.  
  1498. jTabbedPane1.addTab("Withdraw", jPanel2);
  1499.  
  1500. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  1501. getContentPane().setLayout(layout);
  1502. layout.setHorizontalGroup(
  1503. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jTabbedPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE));
  1504. layout.setVerticalGroup(
  1505. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jTabbedPane1));
  1506.  
  1507. pack();
  1508. }
  1509.  
  1510. private void updateBoxes() {
  1511. while (!canUpdate) {
  1512. sleep(1);
  1513. }
  1514. frombankBox.setText("");
  1515. for (Object o : pathfrombank) {
  1516. if (o instanceof String[]) {
  1517. String[] temp = (String[]) o;
  1518. frombankBox.append(temp[0] + " : " + temp[1] + "\n");
  1519. } else if (o instanceof ArrayList) {
  1520. ArrayList<RSTile> arrayList = (ArrayList<RSTile>) o;
  1521. frombankBox.append("X:" + arrayList.get(0).getX() + "Y:" + arrayList.get(0).getY() + "Z:" + arrayList.get(0).getZ() + " -> " + "X:" + arrayList.get((arrayList.size() - 1)).getX() + "Y:" + arrayList.get((arrayList.size() - 1)).getY() + "Z:" + arrayList.get((arrayList.size() - 1)).getZ() + "\n");
  1522. }
  1523. }
  1524. tobankBox.setText("");
  1525. for (Object o : pathtobank) {
  1526. if (o instanceof String[]) {
  1527. String[] temp = (String[]) o;
  1528. tobankBox.append(temp[0] + " : " + temp[1] + "\n");
  1529. } else if (o instanceof ArrayList) {
  1530. ArrayList<RSTile> arrayList = (ArrayList<RSTile>) o;
  1531. tobankBox.append("X:" + arrayList.get(0).getX() + "Y:" + arrayList.get(0).getY() + "Z:" + arrayList.get(0).getZ() + " -> " + "X:" + arrayList.get((arrayList.size() - 1)).getX() + "Y:" + arrayList.get((arrayList.size() - 1)).getY() + "Z:" + arrayList.get((arrayList.size() - 1)).getZ() + "\n");
  1532. }
  1533. }
  1534. canUpdate = false;
  1535. }
  1536.  
  1537. private void addrowActionPerformed(java.awt.event.ActionEvent evt) {
  1538. ((DefaultTableModel) table.getModel()).addRow(new Object[]{null, null});
  1539. }
  1540.  
  1541. private void STARTButtonActionPerformed(java.awt.event.ActionEvent evt) {
  1542. try {
  1543. table.getCellEditor().stopCellEditing();
  1544. } catch (Exception e) {
  1545. }
  1546. Object temp = pathtobank.get((pathtobank.size() - 1));
  1547. Object temp2 = pathfrombank.get((pathfrombank.size() - 1));
  1548. if (temp instanceof ArrayList && temp2 instanceof ArrayList) {
  1549. for (int i = 0; i < table.getRowCount(); i++) {
  1550. if (table.getValueAt(i, 0) == null) {
  1551. continue;
  1552. } else {
  1553. map.put((Integer) table.getValueAt(i, 0), (Integer) table.getValueAt(i, 1));
  1554. }
  1555. }
  1556. FIRST_TIME = false;
  1557. env.setUserInput(0);
  1558. dispose();
  1559. } else {
  1560. log("Please end both paths with some walking!");
  1561. }
  1562. }
  1563.  
  1564. private void frombankradioActionPerformed(java.awt.event.ActionEvent evt) {
  1565. if (frombankradio.isSelected()) {
  1566. tobankradio.setSelected(false);
  1567. frombank = true;
  1568. tobank = false;
  1569. } else {
  1570. frombankradio.setSelected(true);
  1571. }
  1572. }
  1573.  
  1574. private void tobankradioActionPerformed(java.awt.event.ActionEvent evt) {
  1575. if (tobankradio.isSelected()) {
  1576. frombankradio.setSelected(false);
  1577. tobank = true;
  1578. frombank = false;
  1579. } else {
  1580. tobankradio.setSelected(true);
  1581. }
  1582. }
  1583.  
  1584. private void walkingToggleActionPerformed(java.awt.event.ActionEvent evt) {
  1585. if (walkingToggle.isSelected()) {
  1586. walk = true;
  1587. walkingToggle.setText("STOP WALKING");
  1588. interactToggle.setEnabled(false);
  1589. } else {
  1590. walk = false;
  1591. walkingToggle.setText("START WALKING");
  1592. interactToggle.setEnabled(true);
  1593. updateBoxes();
  1594. }
  1595. }
  1596.  
  1597. private void interactToggleActionPerformed(java.awt.event.ActionEvent evt) {
  1598. if (interactToggle.isSelected()) {
  1599. String[] temp2 = new String[2];
  1600. temp2[0] = jTextField2.getText();
  1601. temp2[1] = jTextField1.getText();
  1602. if (frombank) {
  1603. pathfrombank.add(temp2);
  1604. canUpdate = true;
  1605. } else if (tobank) {
  1606. pathtobank.add(temp2);
  1607. canUpdate = true;
  1608. }
  1609. interactToggle.setSelected(false);
  1610. updateBoxes();
  1611. }
  1612. }
  1613. private javax.swing.JButton STARTButton;
  1614. private javax.swing.JButton addrow;
  1615. private javax.swing.JTextArea frombankBox;
  1616. private javax.swing.JRadioButton frombankradio;
  1617. private javax.swing.JToggleButton interactToggle;
  1618. private javax.swing.JLabel jLabel1;
  1619. private javax.swing.JLabel jLabel2;
  1620. private javax.swing.JLabel jLabel3;
  1621. private javax.swing.JLabel jLabel4;
  1622. private javax.swing.JPanel jPanel1;
  1623. private javax.swing.JPanel jPanel2;
  1624. private javax.swing.JScrollPane jScrollPane1;
  1625. private javax.swing.JScrollPane jScrollPane2;
  1626. private javax.swing.JScrollPane jScrollPane3;
  1627. private javax.swing.JTabbedPane jTabbedPane1;
  1628. private javax.swing.JTextField jTextField1;
  1629. private javax.swing.JTextField jTextField2;
  1630. private javax.swing.JTable table;
  1631. private javax.swing.JTextArea tobankBox;
  1632. private javax.swing.JRadioButton tobankradio;
  1633. private javax.swing.JToggleButton walkingToggle;
  1634. }
  1635. }
Add Comment
Please, Sign In to add comment