wafflecat

Untitled

Mar 11th, 2012
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 119.26 KB | None | 0 0
  1. import java.awt.*;
  2. import java.awt.event.*;
  3. import java.awt.image.BufferedImage;
  4. import java.awt.image.RenderedImage;
  5. import java.io.BufferedReader;
  6. import java.io.File;
  7. import java.io.IOException;
  8. import java.io.InputStreamReader;
  9. import java.lang.reflect.InvocationTargetException;
  10. import java.net.URI;
  11. import java.net.URL;
  12. import java.net.URLConnection;
  13. import java.util.*;
  14. import java.util.logging.Logger;
  15. import javax.imageio.ImageIO;
  16. import javax.swing.*;
  17. import javax.swing.border.*;
  18. import com.rarebot.event.events.*;
  19. import com.rarebot.event.listeners.*;
  20. import com.rarebot.script.*;
  21. import com.rarebot.script.methods.*;
  22. import com.rarebot.script.methods.Game.ChatButton;
  23. import com.rarebot.script.methods.Game.Tab;
  24. import com.rarebot.script.wrappers.*;
  25.  
  26. @ScriptManifest(authors = { "Feriscool" }, keywords = { "Combat", "Giant", "Spider", "Killer" }, name = "AUTOGiantSpiders", version = 2.6, description = "Max out combat quickly with this bot!")
  27. public class AutoGiantSpiders extends Script implements PaintListener, MessageListener, MouseListener {
  28.  
  29.  
  30. public double getVersion() {
  31. return getClass().getAnnotation(ScriptManifest.class).version();
  32. }
  33. public String scriptName = "AUTOGiantSpiders";
  34. public String author = "Feriscool";
  35. private int foodID;
  36. private int eatingValue[];
  37. private int arrow;
  38. private int potions[] = { 0, 0, 0, 0, 0 };
  39. private int amounts[] = { 1, 1, 1, 1, 1 };
  40. private int currentRoom;
  41. private int tries;
  42. private int objTries;
  43. private int bankTab = -1;
  44. private int stats[][];
  45. private int trainedSkill = -1;
  46. private int mouseSpeed1;
  47.  
  48. private long startTime;
  49. long lastTime = System.currentTimeMillis();
  50. int nextWait = 30000;
  51. GSFGUI gui = new GSFGUI();
  52. updateChecker uc = new updateChecker();
  53. public boolean GuiIsOpen = true;
  54. boolean guiClosed;
  55.  
  56. private boolean enableTeleporting;
  57. private boolean changeRooms;
  58. private boolean useTablets;
  59. private boolean enableRange;
  60. private boolean noArrowsLeft;
  61. private boolean atSpiders;
  62. private boolean needBank;
  63. String status;
  64.  
  65. Rectangle close = new Rectangle(405, 5, 111, 26);
  66. private final Color color1 = new Color(0, 0, 0, 180);
  67. Point p;
  68. boolean hide = false;
  69.  
  70. private RSTile myTile;
  71. private RSTile bankTile;
  72.  
  73. private final RSTile edgeTile = new RSTile(3094, 3491);
  74. private final RSTile varrockTile = new RSTile(3189, 3437);
  75. private final RSTile entranceTile = new RSTile(3081, 3421);
  76.  
  77. private final RSTile caveToVarrockTiles[] = { new RSTile(3081, 3421),
  78. new RSTile(3087, 3420), new RSTile(3095, 3420),
  79. new RSTile(3103, 3421), new RSTile(3113, 3420),
  80. new RSTile(3120, 3418), new RSTile(3128, 3417),
  81. new RSTile(3138, 3417), new RSTile(3148, 3417),
  82. new RSTile(3157, 3419), new RSTile(3163, 3424),
  83. new RSTile(3171, 3428), new RSTile(3180, 3429),
  84. new RSTile(3186, 3433), new RSTile(3189, 3437) };
  85.  
  86. private final RSTile varrockToCaveTiles[] = {new RSTile(3189, 3437),
  87. new RSTile(3186, 3433), new RSTile(3180, 3429),
  88. new RSTile(3171, 3428), new RSTile(3163, 3424),
  89. new RSTile(3157, 3419), new RSTile(3148, 3417),
  90. new RSTile(3138, 3417), new RSTile(3128, 3417),
  91. new RSTile(3120, 3418), new RSTile(3113, 3420),
  92. new RSTile(3103, 3421), new RSTile(3095, 3420),
  93. new RSTile(3087, 3420), new RSTile(3081, 3421)};
  94.  
  95. private final RSTile caveToEdgyTiles[] = { new RSTile(3081, 3421),
  96. new RSTile(3086, 3427), new RSTile(3090, 3431),
  97. new RSTile(3088, 3441), new RSTile(3087, 3451),
  98. new RSTile(3087, 3459), new RSTile(3087, 3465),
  99. new RSTile(3082, 3465), new RSTile(3079, 3468),
  100. new RSTile(3079, 3475), new RSTile(3079, 3481),
  101. new RSTile(3083, 3485), new RSTile(3088, 3491),
  102. new RSTile(3094, 3491) };
  103.  
  104. private final RSTile edgyToCaveTiles[] = { new RSTile(3094, 3491),
  105. new RSTile(3088, 3491), new RSTile(3083, 3485),
  106. new RSTile(3079, 3481), new RSTile(3079, 3475),
  107. new RSTile(3079, 3468), new RSTile(3082, 3465),
  108. new RSTile(3087, 3465), new RSTile(3087, 3459),
  109. new RSTile(3087, 3451), new RSTile(3088, 3441),
  110. new RSTile(3090, 3431), new RSTile(3068, 3427),
  111. new RSTile(3081, 3421) };
  112.  
  113. private final RSTile doors[] = { new RSTile(2132, 5257),
  114. new RSTile(2132, 5260), new RSTile(2132, 5278),
  115. new RSTile(2132, 5281), new RSTile(2138, 5294),
  116. new RSTile(2141, 5294), new RSTile(2148, 5299),
  117. new RSTile(2148, 5302) };
  118.  
  119. private final RSArea floor1 = new RSArea(new RSTile(1856, 5236),
  120. new RSTile(1866, 5245));
  121. private final RSArea floor1Middle = new RSArea(new RSTile(1900, 5210),
  122. new RSTile(1917, 5230));
  123. private final RSArea floor2 = new RSArea(new RSTile(2037, 5239),
  124. new RSTile(2046, 5246));
  125. private final RSArea floor2Middle = new RSArea(new RSTile(2009, 5203),
  126. new RSTile(2034, 5228));
  127. private final RSArea floor3 = new RSArea(new RSTile(2116, 5250),
  128. new RSTile(2131, 5259));
  129. private final RSArea floor3Front = new RSArea(new RSTile(2131, 5253),
  130. new RSTile(2133, 5256));
  131.  
  132. private final RSArea doors1 = new RSArea(new RSTile(2132, 5257),
  133. new RSTile(2133, 5259));
  134. private final RSArea doors2 = new RSArea(new RSTile(2132, 5279),
  135. new RSTile(2133, 5281));
  136. private final RSArea doors3 = new RSArea(new RSTile(2138, 5294),
  137. new RSTile(2140, 5295));
  138. private final RSArea doors4 = new RSArea(new RSTile(2148, 5299),
  139. new RSTile(2149, 5301));
  140.  
  141. private final RSArea room1 = new RSArea(new RSTile(2117, 5267), new RSTile(
  142. 2134, 5277));
  143. private final RSArea room2 = new RSArea(new RSTile(2142, 5302), new RSTile(
  144. 2156, 5311));
  145.  
  146. private final int potionConstants[] = { Skills.ATTACK, Skills.STRENGTH,
  147. Skills.STRENGTH, Skills.ATTACK, Skills.DEFENSE };
  148. private final int skillConstants[] = { Skills.ATTACK, Skills.STRENGTH,
  149. Skills.DEFENSE, Skills.RANGE };
  150. private final int foods[] = { 361, 379, 373, 7946, 385 };
  151. private final int potionID[][] = { { 9745, 9743, 9741, 9739 },
  152. { 119, 117, 115, 113 }, { 161, 159, 157, 2440 },
  153. { 149, 147, 145, 2436 }, { 167, 165, 163, 2442 } };
  154. private final int rewardID[] = { 11640, 2528, 6199, 14664 };
  155. private final int bowID[] = { 841, 843, 849, 853, 857, 861, 839, 845, 847,
  156. 851, 855, 859 };
  157. private final int arrowID[] = { 882, 884, 886, 888, 890, 892 };
  158. private final int spiderID = 4400;
  159. private final int tabletID = 8007;
  160. private final int lawID = 563;
  161. private final int fireID = 554;
  162. private final int airID = 556;
  163. private final int vialID = 229;
  164.  
  165. /*
  166. * Paint Variables
  167. */
  168. private final String skillNames[] = { "Attack", "Strength", "Defense",
  169. "Range" };
  170. private long runTime;
  171. private int currentLevel;
  172. private int levelsGained;
  173. private int xpGained;
  174. private int xpHour;
  175. private int TNL;
  176. private int percentTNL;
  177. private long timeTNL;
  178. private String skillName;
  179.  
  180. private int kills;
  181. private int killsph;
  182. private int spiderXP = 200;
  183.  
  184. URLConnection url = null;
  185. BufferedReader in = null;
  186.  
  187. Image fsicon;
  188. Image guilogo;
  189. Image paint;
  190. Image showhide;
  191. Image statusback;
  192.  
  193. Rectangle avatarSpotShape = new Rectangle(426, 286, 87, 54);
  194. Rectangle scriptLogoShape = new Rectangle(184, 283, 235, 54);
  195.  
  196. @Override
  197. public boolean onStart() {
  198. try {
  199. if (!game.isLoggedIn()) {
  200. log.info("Please login before starting");
  201. return false;
  202. }
  203.  
  204. /*
  205. * Update Checker
  206. */
  207. if (getUpdate() > getVersion()) {
  208. showMessage(scriptName + ": Script Update found!");
  209. update();
  210. return false;
  211. }
  212. else {
  213. showMessage(scriptName + ": Script is Up to Date!");
  214. /*
  215. * GUI Init
  216. */
  217. try {
  218. SwingUtilities.invokeAndWait(new Runnable() {
  219. @Override
  220. public void run() {
  221. gui.setVisible(true);
  222. }
  223. });
  224. } catch (InterruptedException ignored) {
  225. } catch (InvocationTargetException ignored) {
  226. }
  227. while (GuiIsOpen) {
  228. Methods.sleep(25);
  229. }
  230. }
  231. if (guiClosed) {
  232. return false;
  233. }
  234. /*
  235. * Eating
  236. */
  237. if (gui.textField1.getText().length() > 0) {
  238. try {
  239. foodID = Integer.parseInt(gui.textField1.getText());
  240. } catch (NumberFormatException e) {
  241. log.severe("Invalid food id");
  242. return false;
  243. }
  244. } else {
  245. if (gui.list1.getSelectedIndex() != -1) {
  246. foodID = foods[gui.list1.getSelectedIndex()];
  247. } else {
  248. log.severe("No food selected");
  249. return false;
  250. }
  251. }
  252. try {
  253. final int value = Integer
  254. .parseInt(gui.textField2.getText());
  255. final int value1 = Integer.parseInt(gui.textField3
  256. .getText());
  257. eatingValue = new int[] { random(value, value1), value,
  258. value1 };
  259. } catch (NumberFormatException e) {
  260. log.severe("Invalid eating value(s)");
  261. return false;
  262. }
  263. /*
  264. * Potions
  265. */
  266. final JCheckBox selections[] = { gui.checkBox1, gui.checkBox2,
  267. gui.checkBox3, gui.checkBox4, gui.checkBox5 };
  268. final JTextField fields[] = { gui.textField4, gui.textField5,
  269. gui.textField6, gui.textField7, gui.textField8 };
  270. for (int i = 0; i < selections.length; i++) {
  271. if (selections[i].isSelected()) {
  272. potions[i] = 1;
  273. try {
  274. amounts[i] = Integer.parseInt(fields[i].getText());
  275. } catch (NumberFormatException e) {
  276. log.severe("Invalid potion amount(s)");
  277. return false;
  278. }
  279. }
  280. }
  281. /*
  282. * Banking
  283. */
  284. if (!gui.radioButton2.isSelected()) {
  285. bankTile = varrockTile;
  286. } else {
  287. bankTile = edgeTile;
  288. }
  289. if (!gui.radioButton3.isSelected()) {
  290. enableTeleporting = true;
  291. if (!gui.radioButton4.isSelected()) {
  292. useTablets = true;
  293. }
  294. }
  295. /*
  296. * Other
  297. */
  298. if (gui.mouseSpeed.getValue() == 1) {
  299. mouseSpeed1 = 10;
  300. }
  301. else if (gui.mouseSpeed.getValue() == 2) {
  302. mouseSpeed1 = 9;
  303. }
  304. else if (gui.mouseSpeed.getValue() == 3) {
  305. mouseSpeed1 = 8;
  306. }
  307. else if (gui.mouseSpeed.getValue() == 4) {
  308. mouseSpeed1 = 7;
  309. }
  310. else if (gui.mouseSpeed.getValue() == 5) {
  311. mouseSpeed1 = 6;
  312. }
  313. else if (gui.mouseSpeed.getValue() == 6) {
  314. mouseSpeed1 = 5;
  315. }
  316. else if (gui.mouseSpeed.getValue() == 7) {
  317. mouseSpeed1 = 4;
  318. }
  319. else if (gui.mouseSpeed.getValue() == 8) {
  320. mouseSpeed1 = 3;
  321. }
  322. else if (gui.mouseSpeed.getValue() == 9) {
  323. mouseSpeed1 = 2;
  324. }
  325. else if (gui.mouseSpeed.getValue() == 10) {
  326. mouseSpeed1 = 1;
  327. }
  328.  
  329. if (gui.radioButton7.isSelected()) {
  330. changeRooms = true;
  331. } else {
  332. if (gui.radioButton8.isSelected()) {
  333. currentRoom = 1;
  334. } else {
  335. currentRoom = 2;
  336. }
  337. }
  338. if (gui.checkBox6.isSelected()) {
  339. enableRange = true;
  340. final RSItem knive = equipment.getItem(Equipment.WEAPON);
  341. if (knive != null && knive.getID() == 863) {
  342. arrow = 863;
  343. } else {
  344. final RSItem weared = equipment.getItem(Equipment.AMMO);
  345. for (final int id : arrowID) {
  346. if (weared != null && weared.getID() == id) {
  347. arrow = id;
  348. break;
  349. }
  350. }
  351. if (arrow < 1) {
  352. log.severe("No arrows found");
  353. return false;
  354. }
  355. }
  356. if (!equipment.containsOneOf(bowID) && arrow != 863) {
  357. log.severe("No bow found");
  358. return false;
  359. }
  360. }
  361. stats = new int[][] {
  362. { skills.getRealLevel(Skills.ATTACK),
  363. skills.getCurrentExp(Skills.ATTACK) },
  364. { skills.getRealLevel(Skills.STRENGTH),
  365. skills.getCurrentExp(Skills.STRENGTH) },
  366. { skills.getRealLevel(Skills.DEFENSE),
  367. skills.getCurrentExp(Skills.DEFENSE) },
  368. { skills.getRealLevel(Skills.RANGE),
  369. skills.getCurrentExp(Skills.RANGE) } };
  370. if (!combat.isAutoRetaliateEnabled()) {
  371. combat.setAutoRetaliate(true);
  372. }
  373. setRoom();
  374. startTime = System.currentTimeMillis();
  375. /*
  376. * Disabling Rewards Box Solver
  377. */
  378. env.disableRandom("Improved Rewards Box");
  379. showMessage("Script Started Successfully!");
  380. return true;
  381. } catch (Exception e) {
  382. e.printStackTrace();
  383. return false;
  384. }
  385. }
  386.  
  387. public static void showMessage(Object text) {
  388. }
  389.  
  390. private void update() {
  391. try {
  392. SwingUtilities.invokeAndWait(new Runnable() {
  393. @Override
  394. public void run() {
  395. uc.setVisible(true);
  396. }
  397. });
  398. } catch (InterruptedException ignored) {
  399. } catch (InvocationTargetException ignored) {
  400. }
  401. while (uc.isVisible()) {
  402. sleep(100);
  403. }
  404. }
  405.  
  406. public double getUpdate() {
  407. try {
  408. BufferedReader r = new BufferedReader(new InputStreamReader(new URL("http://scripters.powerbot.org/files/378722/gsfversion.txt").openStream()));
  409. double d = Double.parseDouble(r.readLine());
  410. r.close();
  411. return d;
  412. } catch(Exception e) {
  413. log("Unable to check for update.");
  414. }
  415. return getVersion();
  416. }
  417.  
  418. public void openThread(String thread){
  419. if (java.awt.Desktop.isDesktopSupported()) {
  420. java.awt.Desktop desktop = java.awt.Desktop.getDesktop();
  421.  
  422. if (!desktop.isSupported(java.awt.Desktop.Action.BROWSE)) {
  423. log("Unable to Open Script Thread.");
  424. return;
  425. }
  426.  
  427. try {
  428.  
  429. java.net.URI uri = new java.net.URI(thread);
  430. desktop.browse(uri);
  431. } catch (Exception e) {
  432.  
  433. }
  434. }
  435. }
  436.  
  437.  
  438. @Override
  439. public int loop() {
  440. if (!game.isLoggedIn()) {
  441. return random(800, 1200);
  442. }
  443. mouse.setSpeed(mouseSpeed1);
  444. checkRunning();
  445. if (eat()) {
  446. return random(100, 250);
  447. }
  448. if (teleport()) {
  449. return random(5000, 6000);
  450. }
  451. if (!hasFood() || noArrowsLeft) {
  452. if (!needBank) {
  453. setRoom();
  454. needBank = true;
  455. atSpiders = false;
  456. if (tries != 0) {
  457. tries = 0;
  458. }
  459. }
  460. } else {
  461. needBank = false;
  462. }
  463. if (atSpiders) {
  464. if (getMyPlayer().getInteracting() == null) {
  465. if (!pickArrows()) {
  466. attackSpiders();
  467. }
  468. } else {
  469. status = "Fighting...";
  470. if (tries != 0) {
  471. tries = 0;
  472. }
  473. if (!drinkPotions() && !equipArrows()) {
  474. antiban();
  475. }
  476. }
  477. return random(100, 250);
  478. }
  479. if ((myTile = getMyPlayer().getLocation()) != null) {
  480. if (floor1.contains(myTile)) {
  481. if (!needBank) {
  482. clickObject(16150, "Enter");
  483. status = "Entering Portal...";
  484. } else {
  485. clickObject(16148, "Climb-up");
  486. status = "Climbing Up...";
  487. }
  488. } else if (floor1Middle.contains(myTile)) {
  489. clickObject(16149, "Climb-down");
  490. status = "Climbing Down...";
  491. } else if (floor2.contains(myTile)) {
  492. if (!needBank) {
  493. clickObject(16082, "Enter");
  494. status = "Entering Portal...";
  495. } else {
  496. clickObject(16080, "Climb-up");
  497. status = "Climbing Up...";
  498. }
  499. } else if (floor2Middle.contains(myTile)) {
  500. clickObject(16081, "Climb-down");
  501. status = "Climbing Down...";
  502. } else if (floor3.contains(myTile)) {
  503. if (!needBank) {
  504. clickDoor(doors[0]);
  505. status = "Opening Doors...";
  506. } else {
  507. clickObject(16114, "Climb-up");
  508. status = "Climbing Up...";
  509. }
  510. } else if (floor3Front.contains(myTile)) {
  511. if (!needBank) {
  512. clickDoor(doors[0]);
  513. status = "Opening Doors...";
  514. } else {
  515. clickObject(16114, "Climb-up");
  516. status = "Climbing Up...";
  517. }
  518. } else if (doors1.contains(myTile)) {
  519. if (!needBank) {
  520. clickDoor(doors[1]);
  521. status = "Opening Doors...";
  522. } else {
  523. clickDoor(doors[0]);
  524. status = "Opening Doors...";
  525. }
  526. } else if (myTile.getY() >= 5260 && myTile.getY() <= 5278) {
  527. if (!needBank) {
  528. if (currentRoom == 1) {
  529. if (room1.contains(myTile)) {
  530. atSpiders = true;
  531. status = "Reached Spiders...";
  532. } else {
  533. walkToTile(room1.getCentralTile());
  534. }
  535. } else {
  536. clickDoor(doors[2]);
  537. status = "Opening Doors...";
  538. }
  539. } else {
  540. clickDoor(doors[1]);
  541. status = "Opening Doors...";
  542. }
  543. } else if (doors2.contains(myTile)) {
  544. if (!needBank && currentRoom == 2) {
  545. clickDoor(doors[3]);
  546. status = "Opening Doors...";
  547. } else {
  548. clickDoor(doors[2]);
  549. status = "Opening Doors...";
  550. }
  551. } else if (myTile.getY() >= 5282 && myTile.getY() <= 5295
  552. && myTile.getX() <= 2137) {
  553. if (!needBank && currentRoom == 2) {
  554. clickDoor(doors[4]);
  555. status = "Opening Doors...";
  556. } else {
  557. clickDoor(doors[3]);
  558. status = "Opening Doors...";
  559. }
  560. } else if (doors3.contains(myTile)) {
  561. if (!needBank && currentRoom == 2) {
  562. clickDoor(doors[5]);
  563. status = "Opening Doors...";
  564. } else {
  565. clickDoor(doors[4]);
  566. status = "Opening Doors...";
  567. }
  568. } else if (myTile.getY() >= 5294 && myTile.getY() <= 5298
  569. && myTile.getX() >= 2141) {
  570. if (!needBank && currentRoom == 2) {
  571. clickDoor(doors[6]);
  572. status = "Opening Doors...";
  573. } else {
  574. clickDoor(doors[5]);
  575. status = "Opening Doors...";
  576. }
  577. } else if (doors4.contains(myTile)) {
  578. if (!needBank && currentRoom == 2) {
  579. clickDoor(doors[7]);
  580. status = "Opening Doors...";
  581. } else {
  582. clickDoor(doors[6]);
  583. status = "Opening Doors...";
  584. }
  585. } else if (room2.contains(myTile)) {
  586. if (!needBank && currentRoom == 2) {
  587. walkToTile(room2.getCentralTile());
  588. atSpiders = true;
  589. status = "Reached Spiders...";
  590. } else {
  591. clickDoor(doors[7]);
  592. status = "Opening Doors...";
  593. }
  594. } else {
  595. if (needBank) {
  596. if (dropVials()) {
  597. status = "Dropping Vials...";
  598. return random(800, 1200);
  599. }
  600. if (dropRewards()) {
  601. status = "Dropping Reward Box...";
  602. return random(800, 1200);
  603. }
  604. if (calc.distanceTo(bankTile) < 5) {
  605. if (bank.isOpen()) {
  606. status = "Banking...";
  607. if (tries != 0) {
  608. tries = 0;
  609. }
  610. if (noArrowsLeft) {
  611. log.severe("No arrows left");
  612. showMessage(scriptName + ": No Arrows Left, Stopping Script...");
  613. stopScript(true);
  614. }
  615. if (openBankTab()) {
  616. return random(800, 1200);
  617. }
  618. if (depositCrap()) {
  619. return random(800, 1200);
  620. }
  621. if (enableTeleporting) {
  622. if (useTablets) {
  623. if (!inventory.contains(tabletID)
  624. && bank.getCount(tabletID) > 0) {
  625. bank.withdraw(tabletID, 1);
  626. return random(800, 1200);
  627. }
  628. } else {
  629. if (!inventory.contains(lawID)
  630. && bank.getCount(lawID) > 0) {
  631. bank.withdraw(lawID, 1);
  632. return random(800, 1200);
  633. } else if (inventory.getCount(true, airID) < 3
  634. && bank.getCount(airID) >= 3) {
  635. bank.withdraw(airID, 3);
  636. return random(800, 1200);
  637. } else if (!inventory.contains(fireID)
  638. && bank.getCount(fireID) > 0) {
  639. bank.withdraw(fireID, 1);
  640. return random(800, 1200);
  641. }
  642. }
  643. }
  644. for (int i = 0; i < potionID.length; i++) {
  645. if (potions[i] == 1) {
  646. if (inventory.getCount(potionID[i]) > amounts[i]) {
  647. if (depositPotion(potionID[i])) {
  648. return random(800, 1200);
  649. }
  650. } else if (inventory.getCount(potionID[i]) < amounts[i]) {
  651. if (withdrawPotion(potionID[i])) {
  652. return random(800, 1200);
  653. }
  654. }
  655. }
  656. }
  657. if (!inventory.contains(foodID)) {
  658. if (bank.getCount(foodID) < 5) {
  659. log.severe("No food left");
  660. showMessage(scriptName + ": No Food Left, Stopping Script...");
  661. stopScript(true);
  662. } else {
  663. bank.withdraw(foodID, 0);
  664. return random(800, 1200);
  665. }
  666. } else {
  667. needBank = false;
  668. }
  669. } else {
  670. if (tries > 3) {
  671. walkToTile(bankTile);
  672. tries = 0;
  673. } else {
  674. if (clickObject((bankTile.equals(edgeTile)) ? 42217 : 782, "Bank")) {
  675. tries++;
  676. status = "Opening Bank...";
  677. }
  678. }
  679. }
  680. } else {
  681. walkPath((bankTile.equals(edgeTile)) ? caveToEdgyTiles : caveToVarrockTiles);
  682. status = "Walking to Bank...";
  683. }
  684. } else {
  685. if (calc.distanceTo(entranceTile) < 5) {
  686. clickObject(16154, "Climb-down");
  687. } else {
  688. walkPath(((bankTile.equals(edgeTile)) ? edgyToCaveTiles : varrockToCaveTiles));
  689. status = "Walking to Cave...";
  690. }
  691. }
  692. }
  693. }
  694. return random(100, 250);
  695. }
  696.  
  697. @Override
  698. public void onFinish() {
  699. showMessage("Thanks for Using " + scriptName + " - By " + author);
  700. sleep(5000);
  701. //tray.remove(icon);
  702. }
  703.  
  704. private boolean teleport() {
  705. if (enableTeleporting && game.getBaseY() > 4000 && needBank
  706. && canTeleport()) {
  707. if (useTablets) {
  708. final RSItem tablet = inventory.getItem(tabletID);
  709. if (tablet != null) {
  710. status = "Teleporting...";
  711. return tablet.interact("Break");
  712. }
  713. } else {
  714. status = "Teleporting...";
  715. return magic.castSpell(Magic.SPELL_VARROCK_TELEPORT);
  716. }
  717. }
  718. return false;
  719. }
  720.  
  721. private int getNextTile(final RSTile path[]) {
  722. for (int i = path.length - 1; i >= 0; i--) {
  723. if (calc.tileOnMap(path[i])) {
  724. return i;
  725. }
  726. }
  727. return -1;
  728. }
  729.  
  730. private void walkPath(final RSTile path[]) {
  731. final int next = getNextTile(path);
  732. if (next != -1) {
  733. if (walking.walkTileMM(path[next], 2, 2)) {
  734. if (path[next].equals(path[path.length - 1])) {
  735. sleep(700, 900);
  736. waitToStop();
  737. } else {
  738. for (int i = 0; i < 20; i++) {
  739. if (getMyPlayer().isMoving()) {
  740. i = 0;
  741. }
  742. if (calc.tileOnMap(path[next + 1])) {
  743. break;
  744. }
  745. sleep(100, 200);
  746. }
  747. }
  748. }
  749. } else {
  750. walkToTile(path[path.length - 1]);
  751. }
  752. }
  753.  
  754. private void waitToStop() {
  755. while (getMyPlayer().isMoving()) {
  756. sleep(100, 250);
  757. }
  758. }
  759.  
  760. private boolean canTeleport() {
  761. return (inventory.contains(tabletID))
  762. || (inventory.contains(lawID)
  763. && inventory.getCount(true, airID) >= 3 && inventory
  764. .contains(fireID));
  765. }
  766.  
  767.  
  768. private boolean dropVials() {
  769. if (inventory.contains(vialID)) {
  770. for (final RSItem item : inventory.getItems()) {
  771. if (item != null && item.getID() == vialID
  772. && item.interact("Drop")) {
  773. sleep(50, 90);
  774. }
  775. }
  776. return true;
  777. }
  778. return false;
  779. }
  780.  
  781.  
  782. private boolean dropRewards() {
  783. if (inventory.containsOneOf(rewardID)) {
  784. for (final RSItem item : inventory.getItems()) {
  785. if (item != null && isReward(item.getID())
  786. && item.interact("Drop")) {
  787. sleep(50, 90);
  788. }
  789. }
  790. return true;
  791. }
  792. return false;
  793. }
  794.  
  795. private boolean isReward(final int thisID) {
  796. for (final int id : rewardID) {
  797. if (thisID == id)
  798. return true;
  799. }
  800. return false;
  801. }
  802.  
  803. private boolean isPotion(final int thisID) {
  804. for (final int id[] : potionID) {
  805. for (final int id2 : id) {
  806. if (thisID == id2)
  807. return true;
  808. }
  809. }
  810. return false;
  811. }
  812.  
  813.  
  814. private boolean depositCrap() {
  815. ArrayList<Integer> items = new ArrayList<Integer>();
  816. for (final RSItem item : inventory.getItems()) {
  817. if (item != null) {
  818. final int id = item.getID();
  819. if (!items.contains(id) && id > 0 && id != lawID && id != airID
  820. && id != fireID && id != tabletID && id != foodID
  821. && id != arrow && !isPotion(id) && !isReward(id)) {
  822. if (item.interact("Deposit-All")) {
  823. items.add(id);
  824. sleep(60, 120);
  825. }
  826. item.interact("Deposit");
  827. }
  828. }
  829. }
  830. return items.size() > 0;
  831. }
  832.  
  833.  
  834. private boolean equipArrows() {
  835. if (enableRange && inventory.getCount(true, arrow) >= random(20, 30)) {
  836. final RSItem arrows = inventory.getItem(arrow);
  837. if (arrows != null && arrows.interact("Wield")) {
  838. status = "Weilding Arrows...";
  839. sleep(600, 900);
  840. return true;
  841. }
  842. }
  843. return false;
  844. }
  845.  
  846.  
  847. private boolean pickArrows() {
  848. if (enableRange && !inventory.isFull()) {
  849. RSGroundItem thisItem = null;
  850. final RSGroundItem items[] = groundItems.getAll();
  851. for (final RSGroundItem item : items) {
  852. if (item != null) {
  853. if (room1.contains(item.getLocation())
  854. || room2.contains(item.getLocation())) {
  855. final RSItem stack = item.getItem();
  856. if (stack != null && stack.getID() == arrow
  857. && stack.getStackSize() >= 5) {
  858. thisItem = item;
  859. break;
  860. }
  861. }
  862. }
  863. }
  864. if (thisItem != null) {
  865. if (thisItem.isOnScreen()) {
  866. if (!getMyPlayer().isMoving() && thisItem.interact("Take")) {
  867. status = "Picking Up...";
  868. sleep(700, 900);
  869. waitToStop();
  870. for (int i = 0; i < 20; i++) {
  871. if (needToEat()) {
  872. break;
  873. }
  874. sleep(50, 80);
  875. }
  876. return true;
  877. }
  878. } else {
  879. walkToTile(thisItem.getLocation());
  880. }
  881. }
  882. }
  883. return false;
  884. }
  885.  
  886. private boolean containsPotion(final int potion[]) {
  887. return inventory.containsOneOf(potion);
  888. }
  889.  
  890. private boolean hasFood() {
  891. for (final RSItem food : (!bank.isOpen()) ? inventory.getItems() : inventory.getItems()) {
  892. if (food != null && food.getID() == foodID)
  893. return true;
  894. }
  895. return false;
  896. }
  897.  
  898.  
  899. private boolean drinkPotions() {
  900. for (int i = 0; i < potionID.length; i++) {
  901. if (potions[i] == 1
  902. && containsPotion(potionID[i])
  903. && skills.getCurrentLevel(potionConstants[i])
  904. - skills.getRealLevel(potionConstants[i]) <= random(
  905. 2, 5)) {
  906. final RSItem potion = inventory.getItem(potionID[i]);
  907. if (potion != null && potion.interact("Drink")) {
  908. status = "Drinking Potions...";
  909. sleep(1000, 1300);
  910. return true;
  911. }
  912. break;
  913. }
  914. }
  915. return false;
  916. }
  917.  
  918. private boolean openBankTab() {
  919. if (bankTab != -1) {
  920. if (bank.getCurrentTab() != bankTab) {
  921. final RSComponent tab = interfaces.getComponent(
  922. Bank.INTERFACE_BANK, Bank.INTERFACE_BANK_TAB[bankTab]);
  923. if (tab.isValid()) {
  924. return tab.doClick();
  925. }
  926. }
  927. } else {
  928. bankTab = bank.getCurrentTab();
  929. }
  930. return false;
  931. }
  932.  
  933. private boolean withdrawPotion(final int potion[]) {
  934. for (int i = potion.length - 1; i >= 0; i--) {
  935. if (bank.getCount(potion[i]) > 0) {
  936. bank.withdraw(potion[i], 1);
  937. return true;
  938. }
  939. }
  940. return false;
  941. }
  942.  
  943. private boolean depositPotion(final int potion[]) {
  944. for (final int id : potion) {
  945. if (inventory.contains(id)) {
  946. bank.deposit(id, 0);
  947. return true;
  948. }
  949. }
  950. return false;
  951. }
  952.  
  953.  
  954. private boolean eat() {
  955. if (needToEat()) {
  956. final RSItem food = inventory.getItem(foodID);
  957. if (food != null && food.interact("Eat")) {
  958. status = "Eating...";
  959. sleep(1000, 1300);
  960. eatingValue[0] = random(eatingValue[1], eatingValue[2]);
  961. return true;
  962. }
  963. }
  964. return false;
  965. }
  966.  
  967. private boolean needToEat() {
  968. return combat.getLifePoints() <= eatingValue[0];
  969. }
  970.  
  971.  
  972. private boolean clickObject(final int id, final String action) {
  973. final RSObject obj = objects.getNearest(id);
  974. if (obj != null) {
  975. if (obj.isOnScreen()) {
  976. if (!getMyPlayer().isMoving()) {
  977. if (objTries > 5) {
  978. camera.setAngle(random(1, 360));
  979. objTries = 0;
  980. } else {
  981. if (obj.interact(action)) {
  982. objTries = 0;
  983. sleep(2500, 3000);
  984. return true;
  985. } else {
  986. objTries++;
  987. }
  988. }
  989. }
  990. } else {
  991. walkToTile(obj.getLocation());
  992. }
  993. }
  994. return false;
  995. }
  996.  
  997.  
  998. private void clickDoor(final RSTile doorTile) {
  999. if (camera.getPitch() != 3072) {
  1000. camera.setPitch(true);
  1001. }
  1002. final RSObject obj = objects.getTopAt(doorTile);
  1003. if (obj != null) {
  1004. if (obj.isOnScreen()) {
  1005. if (!getMyPlayer().isMoving()) {
  1006. if (objTries > 5) {
  1007. camera.setAngle(random(1, 360));
  1008. objTries = 0;
  1009. } else {
  1010. if (obj.interact("Open")) {
  1011. objTries = 0;
  1012. sleep(3500, 4000);
  1013. } else {
  1014. objTries++;
  1015. }
  1016. }
  1017. }
  1018. } else {
  1019. walkToTile(obj.getLocation());
  1020. }
  1021. } else {
  1022. walkToTile(doorTile);
  1023. }
  1024. }
  1025.  
  1026. private void setRoom() {
  1027. if (changeRooms) {
  1028. currentRoom = random(1, 3);
  1029. }
  1030. }
  1031.  
  1032. private void walkToTile(final RSTile destination) {
  1033. if (calc.tileOnMap(destination)) {
  1034. if (walking.walkTileMM(destination, 2, 2)) {
  1035. sleep(700, 900);
  1036. waitToStop();
  1037. }
  1038. } else {
  1039. if (!getMyPlayer().isMoving()
  1040. || walking.getDestination() == null
  1041. || calc.distanceTo(walking.getDestination()) <= random(3, 8)) {
  1042. final RSTile step = walking.getClosestTileOnMap(destination);
  1043. if (step != null && walking.walkTileMM(step, 2, 2)) {
  1044. sleep(700, 900);
  1045. }
  1046. }
  1047. }
  1048. }
  1049.  
  1050. private void checkRunning() {
  1051. if (!walking.isRunEnabled() && walking.getEnergy() >= random(25, 35)) {
  1052. walking.setRun(true);
  1053. sleep(900, 1300);
  1054. }
  1055. }
  1056.  
  1057.  
  1058. private void attackSpiders() {
  1059. final RSNPC agressive = getAgressive();
  1060. if (agressive != null) {
  1061. if (tries < 15) {
  1062. if (!agressive.isMoving()) {
  1063. tries++;
  1064. }
  1065. return;
  1066. }
  1067. }
  1068. final RSNPC free = getFree();
  1069. if (free != null) {
  1070. if (free.isOnScreen()) {
  1071. if (random(1,6) == 3) {
  1072. camera.turnTo(free, random(3,5));
  1073. }
  1074. if (free.interact("Attack")) {
  1075. status = "Attacking...";
  1076. sleep(700, 900);
  1077. waitToStop();
  1078. for (int i = 0; i < 20; i++) {
  1079. if (needToEat()) {
  1080. break;
  1081. }
  1082. sleep(50, 150);
  1083. }
  1084. }
  1085. } else {
  1086. walkToTile(free.getLocation());
  1087. }
  1088. }
  1089. }
  1090.  
  1091. private RSNPC getFree() {
  1092. RSNPC winner = null;
  1093. int distance = 1000;
  1094. for (final RSNPC npc : npcs.getAll()) {
  1095. if (npc != null && npc.getID() == spiderID && !npc.isInCombat()
  1096. && npc.getHPPercent() > 0) {
  1097. if (room1.contains(npc.getLocation())
  1098. || room2.contains(npc.getLocation())) {
  1099. final int thisDistance = calc.distanceTo(npc.getLocation());
  1100. if (thisDistance < distance) {
  1101. winner = npc;
  1102. distance = thisDistance;
  1103. }
  1104. }
  1105. }
  1106. }
  1107. status = "Searching...";
  1108. return winner;
  1109. }
  1110.  
  1111. private RSNPC getAgressive() {
  1112. for (final RSNPC npc : npcs.getAll()) {
  1113. if (npc != null && npc.getID() == spiderID
  1114. && npc.getInteracting() != null
  1115. && npc.getInteracting().equals(getMyPlayer())) {
  1116. return npc;
  1117. }
  1118. }
  1119. return null;
  1120. }
  1121.  
  1122. boolean timeSinceLast(int a) {
  1123. return (System.currentTimeMillis() - lastTime > a);
  1124. }
  1125.  
  1126. void setNext(int a, int b) {
  1127. lastTime = System.currentTimeMillis();
  1128. nextWait = random(a, b);
  1129. }
  1130.  
  1131. public void antiban() {
  1132. if (timeSinceLast(nextWait)) {
  1133. int cC = random(1, 30);
  1134. doAntiban(cC, 100);
  1135. setNext(60000, 120000);
  1136. }
  1137. }
  1138.  
  1139. public void doAntiban(int ws, int randRecur) {
  1140. switch (ws) {
  1141. case 1:
  1142. if (random(0, 100) <= 50) {
  1143. new rotation("", random(1000, 5000));
  1144. } else {
  1145. new rotation("anti", random(1000, 5000));
  1146. }
  1147. mouse.moveRandomly(200, 600);
  1148. mouse.moveSlightly();
  1149. break;
  1150.  
  1151. case 2:
  1152. RSPlayer target = null;
  1153. for (RSPlayer p : players.getAll()) {
  1154. if (p.isOnScreen()) {
  1155. target = p;
  1156. break;
  1157. }
  1158. target = null;
  1159. }
  1160. if (random(0, 100) <= 50) {
  1161. new rotation("", random(1000, 2000));
  1162. } else {
  1163. new rotation("anti", random(1000, 2000));
  1164. }
  1165. if (target != null) {
  1166. Point pt = target.getScreenLocation();
  1167. mouse.click(pt, false);
  1168. sleep(500, 1200);
  1169. mouse.moveRandomly(400, 500);
  1170. }
  1171. break;
  1172.  
  1173. case 3:
  1174. if (random(0, 100) <= 50) {
  1175. new rotation("", random(200, 400));
  1176. } else {
  1177. new rotation("anti", random(200, 400));
  1178. }
  1179. if (random(0, 100) <= 50) {
  1180. game.openTab(Tab.ATTACK);
  1181. sleep(200, 2000);
  1182. game.openTab(Tab.STATS);
  1183. sleep(200, 2000);
  1184. } else {
  1185. game.openTab(Tab.STATS);
  1186. sleep(200, 2000);
  1187. game.openTab(Tab.ATTACK);
  1188. sleep(200, 2000);
  1189. }
  1190. break;
  1191.  
  1192. case 4:
  1193. RSObject objTarg = null;
  1194. for (RSObject p : objects.getAll()) {
  1195. if (p.isOnScreen()) {
  1196. objTarg = p;
  1197. break;
  1198. }
  1199. }
  1200. if (objTarg != null) {
  1201. new rotation("anti", random(200, 1000));
  1202. objTarg.doClick(false);
  1203. sleep(200, 700);
  1204. mouse.moveSlightly();
  1205. mouse.moveRandomly(200, 350);
  1206. }
  1207. break;
  1208.  
  1209. case 5:
  1210. if (random(0, 100) <= 50) {
  1211. new rotation("", random(200, 400));
  1212. } else {
  1213. new rotation("anti", random(200, 400));
  1214. }
  1215. break;
  1216.  
  1217. case 6:
  1218. case 25:
  1219. case 26:
  1220. case 27:
  1221. case 28:
  1222. case 29:
  1223. case 30:
  1224. if (random(0, 100) <= 50) {
  1225. new rotation("", random(200, 400));
  1226. } else {
  1227. new rotation("anti", random(200, 400));
  1228. }
  1229. Point base = new Point(588 + random(0, 17), 175 + random(0, 20));
  1230. Point skillBase = new Point(550 + random(0, 170), 210 + random(0,
  1231. 200));
  1232. mouse.click(base, true);
  1233. sleep(0, 100);
  1234. mouse.move(skillBase);
  1235. sleep(1000, 2000);
  1236. if (random(0, 100) <= 50) {
  1237. new rotation("", random(100, 200));
  1238. } else {
  1239. new rotation("anti", random(100, 200));
  1240. }
  1241. break;
  1242.  
  1243. case 7:
  1244. if (random(0, 100) <= 50) {
  1245. new rotation("", random(200, 400));
  1246. } else {
  1247. new rotation("anti", random(200, 400));
  1248. }
  1249. mouse.moveRandomly(400, 600);
  1250. break;
  1251.  
  1252. case 8:
  1253. Point based = new Point(588 + random(0, 17), 175 + random(0, 20));
  1254. Point skillBased = new Point(550 + random(0, 170), 210 + random(0,
  1255. 200));
  1256. mouse.click(based, true);
  1257. sleep(0, 100);
  1258. mouse.move(skillBased);
  1259. sleep(1000, 2000);
  1260. if (random(0, 100) <= 50) {
  1261. new rotation("", random(100, 200));
  1262. } else {
  1263. new rotation("anti", random(100, 200));
  1264. }
  1265. break;
  1266.  
  1267. case 9:
  1268. game.openTab(Tab.FRIENDS);
  1269. sleep(1300, 1700);
  1270. if (random(0, 100) <= 50) {
  1271. new rotation("", random(100, 200));
  1272. } else {
  1273. new rotation("anti", random(100, 200));
  1274. }
  1275. break;
  1276.  
  1277. case 10:
  1278. game.openTab(Tab.QUESTS);
  1279. sleep(1100, 1700);
  1280. if (random(0, 100) <= 50) {
  1281. new rotation("", random(100, 200));
  1282. } else {
  1283. new rotation("anti", random(100, 200));
  1284. }
  1285. break;
  1286.  
  1287. case 11:
  1288. game.openTab(Tab.ATTACK);
  1289. sleep(1300, 1700);
  1290. if (random(0, 100) <= 50) {
  1291. new rotation("", random(100, 200));
  1292. } else {
  1293. new rotation("anti", random(100, 200));
  1294. }
  1295. break;
  1296.  
  1297. case 12:
  1298. if (random(0, 100) <= 50) {
  1299. new rotation("", random(200, 400));
  1300. } else {
  1301. new rotation("anti", random(200, 400));
  1302. }
  1303. if (random(0, 100) <= 50) {
  1304. new rotation("", random(200, 400));
  1305. } else {
  1306. new rotation("anti", random(200, 400));
  1307. }
  1308. if (random(0, 100) <= 50) {
  1309. new rotation("", random(200, 400));
  1310. } else {
  1311. new rotation("anti", random(200, 400));
  1312. }
  1313. break;
  1314.  
  1315. case 13:
  1316. if (random(0, 100) <= 50) {
  1317. new rotation("", random(200, 400));
  1318. } else {
  1319. new rotation("anti", random(200, 400));
  1320. }
  1321. mouse.moveRandomly(300, 600);
  1322. break;
  1323.  
  1324. case 14:
  1325. if (random(0, 100) <= 50) {
  1326. new rotation("", random(400, 600));
  1327. } else {
  1328. new rotation("anti", random(400, 600));
  1329. }
  1330. break;
  1331.  
  1332. case 15:
  1333. if (random(0, 100) <= 50) {
  1334. new rotation("", random(200, 400));
  1335. } else {
  1336. new rotation("anti", random(200, 400));
  1337. }
  1338. mouse.moveRandomly(400, 600);
  1339. mouse.moveSlightly();
  1340. break;
  1341.  
  1342. case 16:
  1343. Point baseq = new Point(588 + random(0, 17), 175 + random(0, 20));
  1344. Point skillBaseq = new Point(550 + random(0, 170), 210 + random(0,
  1345. 200));
  1346. mouse.click(baseq, true);
  1347. sleep(0, 100);
  1348. mouse.move(skillBaseq);
  1349. sleep(1000, 2000);
  1350. if (random(0, 100) <= 50) {
  1351. new rotation("", random(100, 200));
  1352. } else {
  1353. new rotation("anti", random(100, 200));
  1354. }
  1355. break;
  1356.  
  1357. case 17:
  1358. game.openTab(Tab.FRIENDS);
  1359. sleep(300, 700);
  1360. if (random(0, 100) <= 50) {
  1361. new rotation("", random(100, 200));
  1362. } else {
  1363. new rotation("anti", random(100, 200));
  1364. }
  1365. break;
  1366.  
  1367. case 18:
  1368. Point start = inventory.getItems()[random(0,
  1369. inventory.getItems().length - 1)].getComponent()
  1370. .getLocation();
  1371. Point destination = inventory.getItems()[random(0,
  1372. inventory.getItems().length - 1)].getComponent()
  1373. .getLocation();
  1374. mouse.move(start);
  1375. mouse.drag(destination);
  1376. break;
  1377.  
  1378. case 19:
  1379. inventory.getItems()[random(0, inventory.getItems().length - 1)]
  1380. .interact("Examine");
  1381. mouse.moveRandomly(random(20, 30));
  1382. sleep(323, 700);
  1383. break;
  1384.  
  1385. case 20:
  1386. if (random(0, 100) <= 50) {
  1387. new rotation("", random(200, 2500));
  1388. } else {
  1389. new rotation("anti", random(200, 2500));
  1390. }
  1391. RSObject objTarg3 = null;
  1392. for (RSObject p : objects.getAll()) {
  1393. if (p.isOnScreen()) {
  1394. objTarg3 = p;
  1395. break;
  1396. }
  1397. objTarg3 = null;
  1398. }
  1399. if (objTarg3 != null) {
  1400. new rotation("anti", random(200, 1000));
  1401. objTarg3.interact("Examine");
  1402. mouse.moveRandomly(random(20, 30));
  1403. sleep(200, 700);
  1404. mouse.moveSlightly();
  1405. mouse.moveRandomly(200, 350);
  1406. }
  1407. break;
  1408.  
  1409. case 21:
  1410. if (random(0, 100) <= 50) {
  1411. new rotation("", random(400, 700));
  1412. } else {
  1413. new rotation("anti", random(400, 700));
  1414. }
  1415. RSObject objTarg2 = null;
  1416. for (RSObject p : objects.getAll()) {
  1417. if (p.isOnScreen()) {
  1418. objTarg2 = p;
  1419. break;
  1420. }
  1421. objTarg = null;
  1422. }
  1423. if (objTarg2 != null) {
  1424. objTarg2.interact("Examine");
  1425. mouse.moveRandomly(random(20, 30));
  1426. }
  1427. break;
  1428.  
  1429. case 22:
  1430. RSNPC fc = npcs.getNearest("Giant spider");
  1431. if (fc != null) {
  1432. Point p = fc.getScreenLocation();
  1433. mouse.click(p, false);
  1434. mouse.moveRandomly(random(20, 30));
  1435. sleep(500, 1000);
  1436. mouse.moveSlightly();
  1437. mouse.moveSlightly();
  1438. } else {
  1439. if (random(0, 100) <= 50) {
  1440. new rotation("", random(200, 400));
  1441. } else {
  1442. new rotation("anti", random(200, 400));
  1443. }
  1444. }
  1445. break;
  1446.  
  1447. case 23:
  1448. RSNPC fc2 = npcs.getNearest("Giant spider");
  1449. if (fc2 != null) {
  1450. fc2.interact("Examine");
  1451. mouse.moveRandomly(random(20, 30));
  1452. sleep(500, 1000);
  1453. } else {
  1454. if (random(0, 100) <= 50) {
  1455. new rotation("", random(200, 400));
  1456. } else {
  1457. new rotation("anti", random(200, 400));
  1458. }
  1459. }
  1460. break;
  1461.  
  1462. case 24:
  1463. if (random(0, 100) <= 50) {
  1464. new rotation("", random(200, 400));
  1465. } else {
  1466. new rotation("anti", random(200, 400));
  1467. }
  1468. int b = random(1, 8);
  1469. if (b == 1) {
  1470. game.mouseChatButton(ChatButton.ALL, false);
  1471. sleep(300, 1000);
  1472. }
  1473. if (b == 2) {
  1474. game.mouseChatButton(ChatButton.GAME, false);
  1475. sleep(300, 1000);
  1476. }
  1477. if (b == 3) {
  1478. game.mouseChatButton(ChatButton.PUBLIC, false);
  1479. sleep(300, 1000);
  1480. }
  1481. if (b == 4) {
  1482. game.mouseChatButton(ChatButton.PRIVATE, false);
  1483. sleep(300, 1000);
  1484. }
  1485. if (b == 5) {
  1486. game.mouseChatButton(ChatButton.FRIENDS, false);
  1487. sleep(300, 1000);
  1488. }
  1489. if (b == 6) {
  1490. game.mouseChatButton(ChatButton.CLAN, false);
  1491. sleep(300, 1000);
  1492. }
  1493. if (b == 7) {
  1494. game.mouseChatButton(ChatButton.TRADE, false);
  1495. sleep(300, 1000);
  1496. }
  1497. if (b == 8) {
  1498. game.mouseChatButton(ChatButton.ASSIST, false);
  1499. sleep(300, 1000);
  1500. }
  1501. mouse.moveSlightly();
  1502. break;
  1503. }
  1504. if (random(0, 180) <= randRecur) {
  1505. int cC = ws;
  1506. while (cC == ws) {
  1507. cC = random(1, 30);
  1508. }
  1509. status = "Antiban...";
  1510. doAntiban(cC, randRecur / 2);
  1511. }
  1512. }
  1513.  
  1514. final char anticlockwise = 37;
  1515. final char clockwise = 39;
  1516. private char rotationDirection;
  1517.  
  1518. class rotation extends Thread {
  1519. int maxDuration = 3000, type = 1, angle = 10;
  1520. RSNPC npc = null;
  1521. RSObject object = null;
  1522. String direction = "";
  1523.  
  1524. public rotation(RSNPC npc, int maxDuration) {
  1525. this.npc = npc;
  1526. this.maxDuration = maxDuration;
  1527. type = 1;
  1528. this.setPriority(3);
  1529. this.start();
  1530. }
  1531.  
  1532. public rotation(RSObject object, int maxDuration) {
  1533. this.object = object;
  1534. this.maxDuration = maxDuration;
  1535. type = 1;
  1536. this.setPriority(3);
  1537. this.start();
  1538. }
  1539.  
  1540. public rotation(String direction, int maxDuration) {
  1541. this.direction = direction;
  1542. this.maxDuration = maxDuration;
  1543. type = 2;
  1544. this.setPriority(3);
  1545. this.start();
  1546. }
  1547.  
  1548. public rotation(int angle, int maxDuration) {
  1549. this.angle = angle;
  1550. this.maxDuration = maxDuration;
  1551. type = 3;
  1552. this.setPriority(3);
  1553. this.start();
  1554. }
  1555.  
  1556. public void run() {
  1557. switch (type) {
  1558. case 1:
  1559. doRotate();
  1560. break;
  1561.  
  1562. case 2:
  1563. rotateDuration();
  1564. break;
  1565.  
  1566. case 3:
  1567. rotateToAngle();
  1568. break;
  1569. default:
  1570.  
  1571. break;
  1572. }
  1573. }
  1574.  
  1575. void doRotate() {
  1576. if (npc != null) {
  1577. rotateToNPC();
  1578. } else if (object != null) {
  1579. rotateToObject();
  1580. }
  1581. }
  1582.  
  1583. public void rotateDuration() {
  1584. if (direction.toLowerCase().contains("anti")) {
  1585. rotationDirection = anticlockwise;
  1586. } else {
  1587. rotationDirection = clockwise;
  1588. }
  1589. long sTime = System.currentTimeMillis();
  1590. keyboard.pressKey(rotationDirection);
  1591. while (System.currentTimeMillis() - sTime < maxDuration) {
  1592. try {
  1593. sleep(50);
  1594. } catch (InterruptedException e) {
  1595. }
  1596. }
  1597. keyboard.pressKey(clockwise);
  1598. keyboard.pressKey(anticlockwise);
  1599. keyboard.releaseKey(anticlockwise);
  1600. keyboard.releaseKey(clockwise);
  1601. }
  1602.  
  1603. public void rotateToAngle() {
  1604. long cTime = 0;
  1605. int aT = angle;
  1606. int aC = camera.getAngle();
  1607. int absoluteDifference = Math.abs(aC - aT);
  1608. if (aC < aT && absoluteDifference < 180) {
  1609. rotationDirection = clockwise;
  1610. } else if (aC < aT && absoluteDifference >= 180) {
  1611. rotationDirection = anticlockwise;
  1612. } else if (aC > aT && absoluteDifference > 180) {
  1613. rotationDirection = clockwise;
  1614. } else if (aC > aT && absoluteDifference <= 180) {
  1615. rotationDirection = anticlockwise;
  1616. }
  1617. cTime = System.currentTimeMillis();
  1618. keyboard.pressKey(rotationDirection);
  1619. while (System.currentTimeMillis() - cTime < maxDuration
  1620. && absoluteDifference > 5) {
  1621. aT = angle;
  1622. aC = camera.getAngle();
  1623. absoluteDifference = Math.abs(aC - aT);
  1624. try {
  1625. sleep(50);
  1626. } catch (InterruptedException e) {
  1627. }
  1628. }
  1629. keyboard.pressKey(clockwise);
  1630. keyboard.pressKey(anticlockwise);
  1631. keyboard.releaseKey(anticlockwise);
  1632. keyboard.releaseKey(clockwise);
  1633. }
  1634.  
  1635. public void rotateToObject() {
  1636. long cTime = 0;
  1637. int aT = camera.getTileAngle(object.getLocation());
  1638. int aC = camera.getAngle();
  1639. int absoluteDifference = Math.abs(aC - aT);
  1640. if (aC < aT && absoluteDifference < 180) {
  1641. rotationDirection = clockwise;
  1642. } else if (aC < aT && absoluteDifference >= 180) {
  1643. rotationDirection = anticlockwise;
  1644. } else if (aC > aT && absoluteDifference > 180) {
  1645. rotationDirection = clockwise;
  1646. } else if (aC > aT && absoluteDifference <= 180) {
  1647. rotationDirection = anticlockwise;
  1648. }
  1649. cTime = System.currentTimeMillis();
  1650. keyboard.pressKey(rotationDirection);
  1651. while ((!object.isOnScreen() && System.currentTimeMillis() - cTime < maxDuration)) {
  1652. aT = camera.getTileAngle(object.getLocation());
  1653. aC = camera.getAngle();
  1654. absoluteDifference = Math.abs(aC - aT);
  1655. try {
  1656. sleep(50);
  1657. } catch (InterruptedException e) {
  1658. }
  1659. }
  1660. keyboard.pressKey(clockwise);
  1661. keyboard.pressKey(anticlockwise);
  1662. keyboard.releaseKey(anticlockwise);
  1663. keyboard.releaseKey(clockwise);
  1664. }
  1665.  
  1666. public void rotateToNPC() {
  1667. long cTime = 0;
  1668. int aT = camera.getTileAngle(npc.getLocation());
  1669. int aC = camera.getAngle();
  1670. int absoluteDifference = Math.abs(aC - aT);
  1671. if (aC < aT && absoluteDifference < 180) {
  1672. rotationDirection = clockwise;
  1673. } else if (aC < aT && absoluteDifference >= 180) {
  1674. rotationDirection = anticlockwise;
  1675. } else if (aC > aT && absoluteDifference > 180) {
  1676. rotationDirection = clockwise;
  1677. } else if (aC > aT && absoluteDifference <= 180) {
  1678. rotationDirection = anticlockwise;
  1679. }
  1680. cTime = System.currentTimeMillis();
  1681. keyboard.pressKey(rotationDirection);
  1682. while ((!npc.isOnScreen() && System.currentTimeMillis() - cTime < maxDuration)
  1683. || (!npc.isOnScreen() && absoluteDifference > 3)) {
  1684. aT = camera.getTileAngle(npc.getLocation());
  1685. aC = camera.getAngle();
  1686. absoluteDifference = Math.abs(aC - aT);
  1687. try {
  1688. sleep(50);
  1689. } catch (InterruptedException e) {
  1690. }
  1691. }
  1692. keyboard.pressKey(clockwise);
  1693. keyboard.pressKey(anticlockwise);
  1694. keyboard.releaseKey(anticlockwise);
  1695. keyboard.releaseKey(clockwise);
  1696. }
  1697. }
  1698.  
  1699. public class MousePaint {
  1700.  
  1701. public int waveSize = 0;
  1702.  
  1703. @SuppressWarnings({"serial", "unused"})
  1704. public class MousePathPoint extends Point {
  1705.  
  1706. private long finishTime;
  1707. private double lastingTime;
  1708.  
  1709. public MousePathPoint(int x, int y, int lastingTime) {
  1710. super(x, y);
  1711. this.lastingTime = lastingTime;
  1712. finishTime = System.currentTimeMillis() + lastingTime;
  1713. }
  1714.  
  1715. public boolean isUp() {
  1716. return System.currentTimeMillis() > finishTime;
  1717. }
  1718.  
  1719. }
  1720.  
  1721. public double getRot(int ticks){
  1722. return (System.currentTimeMillis() % (360 * ticks)) / ticks;
  1723. }
  1724.  
  1725. public LinkedList<MousePathPoint> MousePath = new LinkedList<MousePathPoint>();
  1726.  
  1727. public void drawTrail(Graphics g1) {
  1728. Graphics2D g = (Graphics2D) g1;
  1729. g.setStroke(new BasicStroke(1));
  1730. while (!MousePath.isEmpty() && MousePath.peek().isUp()) {
  1731. MousePath.remove();
  1732. }
  1733. Point clientCursor = mouse.getLocation();
  1734. MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, 250);
  1735. if (MousePath.isEmpty() || !MousePath.getLast().equals(mpp)) {
  1736. MousePath.add(mpp);
  1737. }
  1738. MousePathPoint lastPoint = null;
  1739. for (MousePathPoint a : MousePath) {
  1740. if (lastPoint != null) {
  1741. long mpt = System.currentTimeMillis() - mouse.getPressTime();
  1742. if (mouse.getPressTime() == -1 || mpt >= 250) {
  1743. g.setColor(Color.BLACK);
  1744. }
  1745. if (mpt < 250) {
  1746. g.setColor(Color.RED);
  1747. }
  1748. g.drawLine(a.x, a.y, lastPoint.x, lastPoint.y);
  1749. }
  1750. lastPoint = a;
  1751. }
  1752. }
  1753.  
  1754. public void drawMouse(Graphics g1) {
  1755. Graphics2D g = (Graphics2D) g1;
  1756. g.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON));
  1757. g.setStroke(new BasicStroke(3));
  1758. g.setColor(Color.BLACK);
  1759. g.drawOval(mouse.getLocation().x - 13, mouse.getLocation().y - 13, 25, 25);
  1760. g.setStroke(new BasicStroke(1));
  1761. g.setColor(new Color(0, 0, 0, 114));
  1762. g.fillOval(mouse.getLocation().x - 13, mouse.getLocation().y - 13, 25, 25);
  1763. Point MouseLoc = mouse.getLocation();
  1764. long mpt = System.currentTimeMillis() - mouse.getPressTime();
  1765. g.rotate(Math.toRadians(getRot(5)), mouse.getLocation().x, mouse.getLocation().y);
  1766. if (mouse.getPressTime() == -1 || mpt >= 250) {
  1767. g.setColor(Color.GRAY);
  1768. g.drawLine(MouseLoc.x - 5, MouseLoc.y, MouseLoc.x + 5, MouseLoc.y);
  1769. g.drawLine(MouseLoc.x, MouseLoc.y - 5, MouseLoc.x, MouseLoc.y + 5);
  1770. }
  1771. if (mpt < 250) {
  1772. g.setColor(Color.RED);
  1773. g.drawLine(MouseLoc.x - 5, MouseLoc.y, MouseLoc.x + 5, MouseLoc.y);
  1774. g.drawLine(MouseLoc.x, MouseLoc.y - 5, MouseLoc.x, MouseLoc.y + 5);
  1775. }
  1776. }
  1777.  
  1778. public void drawWave(Graphics g1, Color c) {
  1779. Point MouseLoc = mouse.getPressLocation();
  1780. long mpt = System.currentTimeMillis() - mouse.getPressTime();
  1781. Graphics2D g = (Graphics2D) g1;
  1782. g.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON));
  1783. g.setColor(c);
  1784. if (mpt < 1000) {
  1785. waveSize = (int) (mpt / 7.5);
  1786. } else {
  1787. waveSize = 0;
  1788. }
  1789. g.setStroke(new BasicStroke(3));
  1790. g.drawOval(MouseLoc.x - (waveSize / 2), MouseLoc.y - (waveSize / 2), waveSize, waveSize);
  1791. g.drawOval(MouseLoc.x - ((waveSize / 2) / 2), MouseLoc.y - ((waveSize / 2) / 2), waveSize / 2, waveSize / 2);
  1792. }
  1793.  
  1794. public void draw(Graphics g1) {
  1795. Graphics2D g = (Graphics2D) g1;
  1796. g.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON));
  1797. drawWave(g, Color.BLACK);
  1798. drawTrail(g);
  1799. drawMouse(g);
  1800. }
  1801. }
  1802.  
  1803. public MousePaint mousePaint = new MousePaint();
  1804.  
  1805. private int getTrainedSkill() {
  1806. if (enableRange) {
  1807. return 3;
  1808. }
  1809. for (int i = 0; i < skillConstants.length; i++) {
  1810. if (skills.getCurrentExp(skillConstants[i]) - stats[i][1] > 0) {
  1811. return i;
  1812. }
  1813. }
  1814. return -1;
  1815. }
  1816.  
  1817. private String formatTime(final long time) {
  1818. final int sec = (int) (time / 1000), h = sec / 3600, m = sec / 60 % 60, s = sec % 60;
  1819. return (h < 10 ? "0" + h : h) + ":" + (m < 10 ? "0" + m : m) + ":"
  1820. + (s < 10 ? "0" + s : s);
  1821. }
  1822.  
  1823. private final RenderingHints antialiasing = new RenderingHints(
  1824. RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  1825.  
  1826. private final Font font1 = new Font("sansserif", Font.PLAIN, 12);
  1827. private final Font font2 = new Font("sansserif", Font.BOLD, 14);
  1828. private final BasicStroke stroke1 = new BasicStroke(2);
  1829.  
  1830. @Override
  1831. public void onRepaint(Graphics g1) {
  1832.  
  1833. Graphics2D g = (Graphics2D) g1;
  1834. g.setRenderingHints(antialiasing);
  1835. g.setFont(font1);
  1836. g.setColor(Color.WHITE);
  1837. if (trainedSkill == -1) {
  1838. trainedSkill = getTrainedSkill();
  1839. g.drawImage(statusback, 5, 5, null);
  1840. g.drawImage(paint, 0, 269, null);
  1841. mousePaint.draw(g);
  1842. return;
  1843. }
  1844.  
  1845. runTime = System.currentTimeMillis() - startTime;
  1846. currentLevel = skills.getRealLevel(skillConstants[trainedSkill]);
  1847. levelsGained = currentLevel - stats[trainedSkill][0];
  1848. xpGained = skills.getCurrentExp(skillConstants[trainedSkill]) - stats[trainedSkill][1];
  1849. xpHour = (int) ((3600000.0 / (double) runTime) * xpGained);
  1850. TNL = skills.getExpToNextLevel(skillConstants[trainedSkill]);
  1851. percentTNL = skills.getPercentToNextLevel(skillConstants[trainedSkill]);
  1852. timeTNL = (long) ((double) TNL / (double) xpHour * 3600000);
  1853. skillName = skillNames[trainedSkill];
  1854. kills = xpGained / spiderXP;
  1855. killsph = (int) ((3600000.0 / (double) runTime) * kills);
  1856.  
  1857. if (!hide) {
  1858. g.setColor(color1);
  1859. g.fillRect(353, 180, 160, 155);
  1860. g.setFont(font2);
  1861. g.setColor(Color.WHITE);
  1862. g.drawString("AUTOGiantSpiders", 370, 202);
  1863. g.drawImage(statusback, 5, 5, null);
  1864. g.drawImage(paint, 0, 269, null);
  1865. g.drawImage(showhide, 405, 5, null);
  1866. g.setColor(Color.WHITE);
  1867. g.setFont(font1);
  1868. g.drawString("Running: " + formatTime(runTime), 375, 240);
  1869. g.drawString("Status: " + status, 375, 225);
  1870. g.drawString("Kills: " + kills, 375, 255);
  1871. g.drawString("Gained: " + (xpGained) + " exp", 375, 270);
  1872. g.drawString("Exp/hour: " + xpHour, 375, 285);
  1873. g.drawString("Exp to level: " + TNL, 375, 300);
  1874. g.drawString("Next level in: " + formatTime(timeTNL), 375, 315);
  1875. g.drawString("Kills/hour: " + killsph, 375, 330);
  1876.  
  1877. g.setColor(Color.RED);
  1878. g.fillRect(360, 225, 10, 100);
  1879. g.setColor(Color.BLACK);
  1880. g.drawRect(360, 225, 10, 100);
  1881. g.setColor(Color.GREEN);
  1882. g.fillRect(360, 325 - percentTNL, 10, percentTNL);
  1883. g.setColor(Color.BLACK);
  1884. g.drawRect(360, 325 - percentTNL, 10, percentTNL);
  1885. mousePaint.draw(g);
  1886. }
  1887.  
  1888. if (hide) {
  1889. g.drawImage(showhide, 405, 5, null);
  1890. mousePaint.draw(g);
  1891. }
  1892. }
  1893.  
  1894. public void sendToURL(String url) {
  1895. try {
  1896. java.awt.Desktop.getDesktop().browse(
  1897. java.net.URI.create(url));
  1898. } catch (Exception e) {
  1899. log("Error:" + e.getLocalizedMessage());
  1900. log.severe("Please Select 'Allow Untrusted URLs' in Tools > Options");
  1901. }
  1902. }
  1903. public void mouseClicked(MouseEvent e) {
  1904. p = e.getPoint();
  1905. if (close.contains(p) && !hide) {
  1906. hide = true;
  1907. } else if (close.contains(p) && hide) {
  1908. hide = false;
  1909. }
  1910. }
  1911. public void mouseEntered(MouseEvent e) {
  1912. }
  1913.  
  1914. public void mouseExited(MouseEvent e) {
  1915. }
  1916.  
  1917. public void mouseReleased(MouseEvent e) {
  1918. }
  1919.  
  1920. public void mousePressed(MouseEvent e) {
  1921.  
  1922. }
  1923.  
  1924.  
  1925. @Override
  1926. public void messageReceived(MessageEvent e) {
  1927. if (e.getID() == MessageEvent.MESSAGE_SERVER) {
  1928. final String msg = e.getMessage();
  1929. if (msg != null) {
  1930. if (msg.contains("You can't reach that")) {
  1931. atSpiders = false;
  1932. } else if (enableRange && msg.contains("There is no ammo left")) {
  1933. noArrowsLeft = true;
  1934. }
  1935. }
  1936. }
  1937. }
  1938.  
  1939. @SuppressWarnings("serial")
  1940. public class GSFGUI extends JFrame {
  1941.  
  1942. private JPanel contentPane;
  1943. private JTextField textField1;
  1944. private JTextField textField2;
  1945. private JTextField textField3;
  1946. private JTextField textField4;
  1947. private JTextField textField5;
  1948. private JTextField textField7;
  1949. private JTextField textField6;
  1950. private JTextField textField8;
  1951. private JComboBox list1;
  1952. private JCheckBox checkBox1;
  1953. private JCheckBox checkBox2;
  1954. private JCheckBox checkBox3;
  1955. private JCheckBox checkBox4;
  1956. private JCheckBox checkBox5;
  1957. private JCheckBox checkBox6;
  1958. private JRadioButton radioButton1;
  1959. private JRadioButton radioButton2;
  1960. private JRadioButton radioButton3;
  1961. private JRadioButton radioButton4;
  1962. private JRadioButton radioButton5;
  1963. private JRadioButton radioButton7;
  1964. private JRadioButton radioButton8;
  1965. private JRadioButton radioButton9;
  1966. private JButton button1;
  1967. private JSlider mouseSpeed;
  1968.  
  1969. //private final ImageIcon gui_logo = new ImageIcon(Configuration.Paths.getScriptsDirectory() + File.separator + "gsfgui_logov21.png");
  1970.  
  1971. private void button1ActionPerformed(ActionEvent e) {
  1972. setVisible(false);
  1973. GuiIsOpen = false;
  1974. }
  1975.  
  1976. /**
  1977. * Create the frame.
  1978. */
  1979. public GSFGUI() {
  1980. addWindowListener(new WindowAdapter() {
  1981. @Override
  1982. public void windowClosed(WindowEvent arg0) {
  1983. guiClosed = true;
  1984. }
  1985. });
  1986.  
  1987. setTitle("AUTOGiantSpiders");
  1988. setAlwaysOnTop(true);
  1989. setResizable(false);
  1990. setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  1991. setCursor(new java.awt.Cursor(java.awt.Cursor.CROSSHAIR_CURSOR));
  1992. setBounds(100, 100, 451, 386);
  1993. contentPane = new JPanel();
  1994. contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
  1995. setContentPane(contentPane);
  1996. contentPane.setLayout(null);
  1997.  
  1998. //JLabel label = new JLabel(gui_logo);
  1999. //label.setBounds(10, 11, 425, 125);
  2000. //contentPane.add(label);
  2001.  
  2002. JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
  2003. tabbedPane.setBounds(10, 147, 425, 144);
  2004. contentPane.add(tabbedPane);
  2005.  
  2006. JPanel panel = new JPanel();
  2007. tabbedPane.addTab("Eating", null, panel, null);
  2008. panel.setLayout(null);
  2009.  
  2010. JLabel lblEnterFoodId = new JLabel("Food ID:");
  2011. lblEnterFoodId.setBounds(10, 11, 80, 14);
  2012. panel.add(lblEnterFoodId);
  2013.  
  2014. textField1 = new JTextField();
  2015. textField1.setBounds(80, 8, 86, 20);
  2016. panel.add(textField1);
  2017. textField1.setColumns(10);
  2018.  
  2019. JLabel lblOr = new JLabel("OR");
  2020. lblOr.setFont(new Font("Tahoma", Font.BOLD, 11));
  2021. lblOr.setBounds(175, 12, 16, 14);
  2022. panel.add(lblOr);
  2023.  
  2024. JLabel lblSelectFromList = new JLabel("Select:");
  2025. lblSelectFromList.setBounds(200, 11, 86, 14);
  2026. panel.add(lblSelectFromList);
  2027.  
  2028. list1 = new JComboBox();
  2029. list1.setModel(new DefaultComboBoxModel(new String[] {"Tuna", "Lobster", "Swordfish", "Monkfish", "Shark"}));
  2030. list1.setBounds(250, 9, 87, 20);
  2031. panel.add(list1);
  2032.  
  2033. JLabel lblEatWhenLp = new JLabel("Eat Between:");
  2034. lblEatWhenLp.setBounds(10, 72, 86, 14);
  2035. panel.add(lblEatWhenLp);
  2036.  
  2037. textField2 = new JTextField();
  2038. textField2.setText("300");
  2039. textField2.setBounds(102, 69, 45, 25);
  2040. panel.add(textField2);
  2041. textField2.setColumns(10);
  2042.  
  2043. textField3 = new JTextField();
  2044. textField3.setText("400");
  2045. textField3.setBounds(168, 69, 45, 25);
  2046. panel.add(textField3);
  2047. textField3.setColumns(10);
  2048.  
  2049. JLabel label_1 = new JLabel("-");
  2050. label_1.setBounds(155, 72, 10, 14);
  2051. panel.add(label_1);
  2052.  
  2053. JPanel panel_1 = new JPanel();
  2054. tabbedPane.addTab("Banking", null, panel_1, null);
  2055. panel_1.setLayout(null);
  2056.  
  2057. JLabel lblWhereWouldYou = new JLabel("Bank at:");
  2058. lblWhereWouldYou.setBounds(10, 11, 162, 14);
  2059. panel_1.add(lblWhereWouldYou);
  2060.  
  2061. radioButton2 = new JRadioButton("Edgeville");
  2062. radioButton2.setSelected(true);
  2063. radioButton2.setBounds(25, 31, 97, 23);
  2064. panel_1.add(radioButton2);
  2065.  
  2066. radioButton1 = new JRadioButton("Varrock West");
  2067. radioButton1.setBounds(25, 57, 117, 23);
  2068. panel_1.add(radioButton1);
  2069.  
  2070. JLabel lblTeleportingOptions = new JLabel("Teleporting Options :");
  2071. lblTeleportingOptions.setBounds(222, 11, 150, 20);
  2072. panel_1.add(lblTeleportingOptions);
  2073.  
  2074. radioButton3 = new JRadioButton("Walk only");
  2075. radioButton3.setSelected(true);
  2076. radioButton3.setBounds(232, 31, 171, 23);
  2077. panel_1.add(radioButton3);
  2078.  
  2079. radioButton4 = new JRadioButton("Varrock w/ Runes");
  2080. radioButton4.setBounds(232, 57, 160, 23);
  2081. panel_1.add(radioButton4);
  2082.  
  2083. radioButton5 = new JRadioButton("Varrock Tele Tab");
  2084. radioButton5.setBounds(232, 83, 160, 23);
  2085. panel_1.add(radioButton5);
  2086.  
  2087. JPanel panel_3 = new JPanel();
  2088. tabbedPane.addTab("Potions", null, panel_3, null);
  2089. panel_3.setLayout(null);
  2090.  
  2091. checkBox1 = new JCheckBox("Combat");
  2092. checkBox1.setBounds(6, 32, 110, 23);
  2093. panel_3.add(checkBox1);
  2094.  
  2095. checkBox2 = new JCheckBox("Strength");
  2096. checkBox2.setBounds(6, 58, 110, 23);
  2097. panel_3.add(checkBox2);
  2098.  
  2099. checkBox4 = new JCheckBox("Super Attack");
  2100. checkBox4.setBounds(6, 84, 125, 23);
  2101. panel_3.add(checkBox4);
  2102.  
  2103. JLabel lblWhatPotionsWould = new JLabel("Use Potions?");
  2104. lblWhatPotionsWould.setBounds(10, 11, 191, 14);
  2105. panel_3.add(lblWhatPotionsWould);
  2106.  
  2107. textField4 = new JTextField();
  2108. textField4.setText("1");
  2109. textField4.setBounds(128, 33, 26, 20);
  2110. panel_3.add(textField4);
  2111. textField4.setColumns(10);
  2112.  
  2113. textField5 = new JTextField();
  2114. textField5.setText("1");
  2115. textField5.setBounds(128, 59, 26, 20);
  2116. panel_3.add(textField5);
  2117. textField5.setColumns(10);
  2118.  
  2119. textField7 = new JTextField();
  2120. textField7.setText("1");
  2121. textField7.setBounds(128, 85, 26, 20);
  2122. panel_3.add(textField7);
  2123. textField7.setColumns(10);
  2124.  
  2125. checkBox3 = new JCheckBox("Super Strength");
  2126. checkBox3.setBounds(210, 32, 140, 23);
  2127. panel_3.add(checkBox3);
  2128.  
  2129. checkBox5 = new JCheckBox("Super Defence");
  2130. checkBox5.setBounds(210, 58, 140, 23);
  2131. panel_3.add(checkBox5);
  2132.  
  2133. textField6 = new JTextField();
  2134. textField6.setText("1");
  2135. textField6.setBounds(350, 33, 26, 20);
  2136. panel_3.add(textField6);
  2137. textField6.setColumns(10);
  2138.  
  2139. textField8 = new JTextField();
  2140. textField8.setText("1");
  2141. textField8.setBounds(350, 59, 26, 20);
  2142. panel_3.add(textField8);
  2143. textField8.setColumns(10);
  2144.  
  2145. JPanel panel_4 = new JPanel();
  2146. tabbedPane.addTab("Other", null, panel_4, null);
  2147. panel_4.setLayout(null);
  2148.  
  2149. JLabel lblRoomOptions = new JLabel("Room Options:");
  2150. lblRoomOptions.setBounds(10, 11, 120, 14);
  2151. panel_4.add(lblRoomOptions);
  2152.  
  2153. radioButton8 = new JRadioButton("Room 1 (Main room)");
  2154. radioButton8.setSelected(true);
  2155. radioButton8.setBounds(20, 32, 175, 23);
  2156. panel_4.add(radioButton8);
  2157.  
  2158. radioButton9 = new JRadioButton("Room 2 (Small room)");
  2159. radioButton9.setBounds(20, 58, 175, 23);
  2160. panel_4.add(radioButton9);
  2161.  
  2162. radioButton7 = new JRadioButton("Change Randomly");
  2163. radioButton7.setBounds(20, 84, 171, 23);
  2164.  
  2165. panel_4.add(radioButton7);
  2166.  
  2167. checkBox6 = new JCheckBox("Use Range?");
  2168. checkBox6.setBounds(218, 32, 125, 23);
  2169. panel_4.add(checkBox6);
  2170.  
  2171. JLabel lblRangeOptions = new JLabel("Range Options:");
  2172. lblRangeOptions.setBounds(208, 11, 125, 14);
  2173. panel_4.add(lblRangeOptions);
  2174.  
  2175. //---- buttonGroup1 ----
  2176. ButtonGroup buttonGroup1 = new ButtonGroup();
  2177. buttonGroup1.add(radioButton1);
  2178. buttonGroup1.add(radioButton2);
  2179.  
  2180. //---- buttonGroup2 ----
  2181. ButtonGroup buttonGroup2 = new ButtonGroup();
  2182. buttonGroup2.add(radioButton3);
  2183. buttonGroup2.add(radioButton4);
  2184. buttonGroup2.add(radioButton5);
  2185.  
  2186. //---- buttonGroup3 ----
  2187. ButtonGroup buttonGroup3 = new ButtonGroup();
  2188. buttonGroup3.add(radioButton7);
  2189. buttonGroup3.add(radioButton8);
  2190. buttonGroup3.add(radioButton9);
  2191.  
  2192. JPanel panel_5 = new JPanel();
  2193. tabbedPane.addTab("Mouse", null, panel_5, null);
  2194. panel_5.setLayout(null);
  2195.  
  2196. JLabel lblSetMouseSpeed = new JLabel("Set Mouse Speed:");
  2197. lblSetMouseSpeed.setBounds(10, 11, 125, 14);
  2198. panel_5.add(lblSetMouseSpeed);
  2199.  
  2200. mouseSpeed = new JSlider();
  2201. mouseSpeed.setValue(6);
  2202. mouseSpeed.setMaximum(10);
  2203. mouseSpeed.setMinimum(1);
  2204. mouseSpeed.setPaintLabels(true);
  2205. mouseSpeed.setPaintTicks(true);
  2206. mouseSpeed.setSnapToTicks(true);
  2207. mouseSpeed.setBounds(66, 53, 200, 31);
  2208. panel_5.add(mouseSpeed);
  2209.  
  2210. JLabel lblFaster = new JLabel("Faster");
  2211. lblFaster.setBounds(276, 53, 50, 14);
  2212. panel_5.add(lblFaster);
  2213.  
  2214. JLabel lblLower = new JLabel("Slower");
  2215. lblLower.setBounds(19, 53, 50, 14);
  2216. panel_5.add(lblLower);
  2217.  
  2218. button1 = new JButton("Start");
  2219. button1.setFont(new Font("Tahoma", Font.PLAIN, 24));
  2220. button1.setBounds(10, 302, 425, 45);
  2221. button1.addActionListener(new ActionListener() {
  2222. @Override
  2223. public void actionPerformed(ActionEvent e) {
  2224. button1ActionPerformed(e);
  2225. }
  2226. });
  2227. contentPane.add(button1);
  2228. }
  2229. }
  2230.  
  2231. @SuppressWarnings("serial")
  2232. public class updateChecker extends JFrame {
  2233.  
  2234. private JPanel contentPane;
  2235.  
  2236. private void pbthreadActionPerformed(ActionEvent e) {
  2237. //openThread(PBthread);
  2238. stopScript(false);
  2239. uc.dispose();
  2240. }
  2241.  
  2242. private void fsthreadActionPerformed(ActionEvent e) {
  2243. //openThread(FSthread);
  2244. stopScript(false);
  2245. uc.dispose();
  2246. }
  2247.  
  2248. private void cancelActionPerformed(ActionEvent e) {
  2249. stopScript(false);
  2250. uc.dispose();
  2251. }
  2252.  
  2253. /**
  2254. * Create the frame.
  2255. */
  2256. public updateChecker() {
  2257. setTitle("AUTOGiantSpiders | Update Checker");
  2258. setResizable(false);
  2259. setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  2260. setBounds(100, 100, 450, 150);
  2261. contentPane = new JPanel();
  2262. contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
  2263. setContentPane(contentPane);
  2264. contentPane.setLayout(null);
  2265.  
  2266. JLabel lblNewVersionAvailable = new JLabel("New Version Available!");
  2267. lblNewVersionAvailable.setBounds(12, 13, 197, 16);
  2268. lblNewVersionAvailable.setFont(new Font("Lucida Sans Unicode", Font.PLAIN, 18));
  2269. contentPane.add(lblNewVersionAvailable);
  2270.  
  2271. JLabel lblItsRecommendedTo = new JLabel("Its Recommended to Download the Latest Version!");
  2272. lblItsRecommendedTo.setBounds(172, 41, 266, 16);
  2273. contentPane.add(lblItsRecommendedTo);
  2274.  
  2275. JButton btnVisitScriptThread = new JButton("Visit PB Script Thread");
  2276. btnVisitScriptThread.setBounds(6, 82, 130, 34);
  2277. contentPane.add(btnVisitScriptThread);
  2278.  
  2279. JButton btnCancel = new JButton("Cancel");
  2280. btnCancel.setBounds(347, 82, 81, 34);
  2281. contentPane.add(btnCancel);
  2282. btnCancel.addActionListener(new ActionListener() {
  2283. @Override
  2284. public void actionPerformed(ActionEvent e) {
  2285. cancelActionPerformed(e);
  2286. }
  2287. });
  2288. btnVisitScriptThread.addActionListener(new ActionListener() {
  2289. @Override
  2290. public void actionPerformed(ActionEvent e) {
  2291. pbthreadActionPerformed(e);
  2292. }
  2293. });
  2294. }
  2295. }
  2296.  
  2297. }
Advertisement
Add Comment
Please, Sign In to add comment