gamemaste789

WoodCutter.java

Sep 10th, 2011
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 46.88 KB | None | 0 0
  1. import java.awt.BasicStroke;
  2. import java.awt.Color;
  3. import java.awt.Container;
  4. import java.awt.Dimension;
  5. import java.awt.Font;
  6. import java.awt.Graphics;
  7. import java.awt.Graphics2D;
  8. import java.awt.Image;
  9. import java.awt.Insets;
  10. import java.awt.Point;
  11. import java.awt.Rectangle;
  12. import java.awt.event.ActionEvent;
  13. import java.awt.event.ActionListener;
  14. import java.io.BufferedReader;
  15. import java.io.IOException;
  16. import java.io.InputStreamReader;
  17. import java.net.URL;
  18. import java.net.URL;
  19. import java.net.MalformedURLException;
  20. import javax.imageio.ImageIO;
  21. import javax.swing.DefaultComboBoxModel;
  22. import javax.swing.GroupLayout;
  23. import javax.swing.ImageIcon;
  24. import javax.swing.JButton;
  25. import javax.swing.JComboBox;
  26. import javax.swing.JFrame;
  27. import javax.swing.JLabel;
  28. import javax.swing.JLayeredPane;
  29. import javax.swing.LayoutStyle;
  30. import javax.swing.SwingUtilities;
  31.  
  32. import org.rsbot.event.events.MessageEvent;
  33. import org.rsbot.event.listeners.MessageListener;
  34. import org.rsbot.event.listeners.PaintListener;
  35. import org.rsbot.script.Script;
  36. import org.rsbot.script.ScriptManifest;
  37. import org.rsbot.script.methods.Calculations;
  38. import org.rsbot.script.methods.Camera;
  39. import org.rsbot.script.methods.Game;
  40. import org.rsbot.script.methods.GrandExchange;
  41. import org.rsbot.script.methods.GroundItems;
  42. import org.rsbot.script.methods.Players;
  43. import org.rsbot.script.methods.Skills;
  44. import org.rsbot.script.wrappers.RSGroundItem;
  45. import org.rsbot.script.wrappers.RSObject;
  46. import org.rsbot.script.wrappers.RSPath;
  47. import org.rsbot.script.wrappers.RSTile;
  48. import org.rsbot.script.wrappers.RSWeb;
  49.  
  50.  
  51. @ScriptManifest(authors = "PopGlass2", name = "AIO BankChopper", version = 1.83, description = "Cuts Logs and Banks")
  52. public class Woodcutter extends Script implements PaintListener,MessageListener {
  53. private boolean Varrock;
  54. private boolean NorthFalador;
  55. private boolean Draynor, guiWait = true;
  56. private boolean SouthFalador;
  57. private boolean TowerMagic;
  58. private boolean SeersMagic;
  59. private boolean CatherbayYew;
  60. private boolean BehindMaple;
  61. private boolean ResourceMaple;
  62. private boolean ChurchYew;
  63. private boolean Ivy;
  64. private boolean EastIvy;
  65. private boolean FallNorthIvy;
  66. private boolean FallSouthIvy;
  67. private boolean GEYew;
  68. private boolean GETree;
  69. private boolean DraynorWillow;
  70. private boolean DraynorTree;
  71. private boolean SouthVarrockOak;
  72. private boolean EdgeYew;
  73. private boolean GnomeMagic;
  74. private boolean CatherbayWillow;
  75. private boolean CatherbayOak;
  76. private boolean CandleOak;
  77. private static final RSTile BankTile = new RSTile(3254, 3420, 0); RSTile OakTile = new RSTile(3285, 3421, 0),DraynorBankTile = new RSTile(3093, 3245, 0),DraynorOakTile = new RSTile(3100, 3286, 0);
  78. private static final RSTile FaladorBankTile= new RSTile(3012, 3355, 0);
  79. private static final RSTile CatherbayWillowTile= new RSTile(2784, 3429, 0);
  80. private static final RSTile FaladorOakTile = new RSTile(3039, 3321, 0);
  81. private static final RSTile FaladorEastBankTile= new RSTile (2946, 3368, 0);
  82. private static final RSTile FaladorNorthOakTile= new RSTile (2949, 3405, 0);
  83. private static final int[] oakTreeID = { 38732, 38731, 1281};
  84. private static final RSTile CatherbayYewTile = new RSTile(2759, 3431, 0);
  85. private static final RSTile SeersBankTile= new RSTile (2724, 3493, 0);
  86. private static final RSTile SeersMaigcTile = new RSTile(2693, 3425, 0);
  87. private static final RSTile TowerMagicTile = new RSTile (2700, 3398, 0);
  88. private static final RSTile CatherbayBankTile = new RSTile(2811, 3441, 0);
  89. private static final RSTile MapleBehindTile = new RSTile(2728, 3500, 0);
  90. private static final RSTile DungBankTile = new RSTile(3449, 3720, 0);
  91. private static final RSTile ChurchYewTile = new RSTile(2711, 3462, 0);
  92. private static final RSTile EntranceTile = new RSTile(3513, 3666, 0);
  93. private static final RSTile GEYewTile = new RSTile(3211, 3502,0);
  94. private static final RSTile GEBankTile = new RSTile(3177, 3478,0);
  95. private static final RSTile GEIvyTile = new RSTile(3217, 3498,0);
  96. private static final RSTile EastIvyTile = new RSTile(3233, 3457,0);
  97. private static final RSTile FallNorthIvyTile = new RSTile(3014, 3392, 0);
  98. private static final RSTile FallSouthIvyTile = new RSTile(3048, 3328, 0);
  99. private static final RSTile GETreeTile = new RSTile(3139, 3435, 0);
  100. private static final RSTile DraynorWillowTile = new RSTile(3089, 3232, 0);
  101. private static final RSTile DraynorTreeTile = new RSTile(3078, 3266, 0);
  102. private static final RSTile SouthVarrockOakTile = new RSTile(3287, 3342, 0);
  103. private static final RSTile NorthVarrockBankTile = new RSTile(3186, 3441, 0);
  104. private static final RSTile EdgeYewTile = new RSTile(3087, 3475, 0);
  105. private static final RSTile EdgeBankTile = new RSTile(3094, 3491, 0);
  106. private static final RSTile GnomeBankTile = new RSTile (2446, 3424, 1);
  107. private static final RSTile GnomeMaigcTile = new RSTile(2434, 3411, 0);
  108. private static final RSTile GnomeStairTile = new RSTile(2443, 3414, 0);
  109. private static final RSTile GnomeStairTiledown = new RSTile(2445, 3416, 1);
  110. private static final RSTile CatherbayOakTile = new RSTile(2788, 3436, 0);
  111. private static final RSTile CatherbayCandleOakTile = new RSTile(2795, 3447, 0);
  112. int [] Nests = {5070, 5071, 5072, 5073, 5074, 5075, 5076, 7413, 11966};
  113. int[] ivyID = {46322, 46324, 46320, 46318};
  114. int[] yewTreeId = {1309, 38755};
  115. int[] magicTreeId= {1306};
  116. int[] mapleTReeID= {1307, 51843};
  117. int[]willowTreeId={58006, 38627, 38616, 2372, 142,139};
  118. int[] TreeID = {38786, 38784, 38760, 37860, 38782, 38785, 38783, 38787, 38788};
  119. int[] yewstumpId= {38759};
  120. int[] oakstumpid={38754};
  121. int []RING = {15707};
  122. int[] entrance = {52816};
  123. double maplexp =(100);
  124. double oakxp =(37.5);
  125. double yewxp =(175);
  126. double magicxp =(250);
  127. double ivyxp=(332.5);
  128. double willowxp=(67.5);
  129. double treexp=(25);
  130. int[] GnomeStairupId={1742};
  131. int[] GnomeStairdownId={1744};
  132. private long runTime;
  133. private long startTime;
  134.  
  135.  
  136. int expGained, startExp;
  137.  
  138. private int logsPHR;
  139. private int oakLog = 1521;
  140. double Taken = 0;
  141.  
  142. private int[] Hatchet = { 1349, 1351, 1353, 1355, 1357, 1359, 1361, 6739,
  143. 13470 };
  144.  
  145. Tutorial g = new Tutorial();
  146.  
  147. private double scriptVersion = Woodcutter.class.getAnnotation(ScriptManifest.class).version();
  148. public boolean onStart() {
  149. double currver = getCurrentVersion();
  150. if(currver > scriptVersion) {
  151. log(Color.RED,"The Script has been updated!");
  152. log("Your current version is " + scriptVersion + ". The newest version is " + currver);
  153. log("Update Availible At: ");
  154. log(Color.BLUE, "http://www.powerbot.org/community/topic/579731-aio-woodcutter-banker-with-ivy-and-birdnest-supportworks-with-27beta-and-261/"); //<- THAT IS WHERE YOUR SCRIPT'S URL GOES
  155.  
  156. } else {
  157. log(Color.GREEN,"The Script Is Up To Date!");
  158. }
  159. startTime = System.currentTimeMillis();
  160. startExp = skills.getCurrentExp(Skills.WOODCUTTING);
  161. startTime = System.currentTimeMillis();
  162.  
  163. g.setVisible(true);
  164. while (guiWait)
  165. sleep(500);
  166. try {
  167. SwingUtilities.invokeAndWait(new Runnable() {
  168.  
  169. public void run() {
  170. new Tutorial();
  171. }
  172. });
  173. } catch (Throwable e) {
  174. }
  175. return game.isLoggedIn();
  176. }
  177.  
  178. public void onFinish() {
  179. log("Thanks For Using");
  180. }
  181. public double getCurrentVersion() {
  182. try {
  183. BufferedReader r = new BufferedReader(new InputStreamReader(new URL("http://pastebin.com/raw.php?i=4KDGmPpu").openStream())); // DON'T FORGET TO FILL IN THE URL
  184. double d = Double.parseDouble(r.readLine());
  185. r.close();
  186. return d;
  187. } catch(Exception e) {
  188. log.warning("Error checking for latest version.");
  189. }
  190. return scriptVersion;
  191. }
  192. private void openBank() {
  193. bank.open();
  194. }
  195.  
  196.  
  197. private void depositYew() {
  198.  
  199. bank.depositAllExcept(Hatchet);
  200.  
  201. }
  202.  
  203.  
  204. private void closeBank() {
  205.  
  206. bank.close();
  207.  
  208. }
  209.  
  210.  
  211. private void bank() {
  212.  
  213. openBank();
  214.  
  215. depositYew();
  216.  
  217. closeBank();
  218.  
  219. }
  220.  
  221. @Override
  222. public int loop() {
  223. mouse.setSpeed(random(1, 3));
  224. final RSGroundItem NEST = groundItems.getNearest(Nests);
  225. if (NEST != null && !inventory.isFull()) {
  226. if (NEST.interact("Take"))
  227.  
  228. sleep(900);
  229. }
  230.  
  231. if (CatherbayOak == true) {
  232. if (inventory.isFull()) {
  233.  
  234. RSTile bankTile = new RSTile(2811, 3441, 0);
  235. RSWeb webToBank = web.getWeb(getMyPlayer().getLocation(), bankTile);
  236. webToBank.step();
  237.  
  238. bank();
  239. }}
  240. if (CatherbayOak == true) {
  241. if (!inventory.isFull()) {
  242. RSTile yewTile = new RSTile(2788, 3436, 0);
  243. RSWeb webToYew = web.getWeb(getMyPlayer().getLocation(), yewTile);
  244. webToYew.step();
  245. RSObject ivy = objects.getNearest(oakTreeID);
  246.  
  247.  
  248. if ((ivy != null) && (getMyPlayer().getAnimation() == -1) && (!getMyPlayer().isMoving()))
  249. ivy.interact("Chop");
  250. sleep(1500);
  251.  
  252. }}
  253. if (CandleOak == true) {
  254. if (inventory.isFull()) {
  255.  
  256.  
  257.  
  258. RSTile bankTile = new RSTile(2811, 3441, 0);
  259. RSWeb webToBank = web.getWeb(getMyPlayer().getLocation(), bankTile);
  260. webToBank.step();
  261.  
  262. bank();
  263. }}
  264. if (CandleOak == true) {
  265. if (!inventory.isFull()) {
  266. RSTile yewTile = new RSTile(2795, 3447, 0);
  267. RSWeb webToYew = web.getWeb(getMyPlayer().getLocation(), yewTile);
  268. webToYew.step();
  269. RSObject ivy = objects.getNearest(oakTreeID);
  270.  
  271.  
  272. if ((ivy != null) && (getMyPlayer().getAnimation() == -1) && (!getMyPlayer().isMoving()))
  273. ivy.interact("Chop");
  274. sleep(1500);
  275.  
  276.  
  277. }}
  278. if (DraynorWillow == true) {
  279. if (inventory.isFull()) {
  280.  
  281. RSTile bankTile = new RSTile(3012, 3355, 0);
  282. RSWeb webToBank = web.getWeb(getMyPlayer().getLocation(), bankTile);
  283. webToBank.step();
  284.  
  285. bank();
  286. }}
  287.  
  288. if (DraynorWillow == true) {
  289. if (!inventory.isFull()) {
  290. RSTile yewTile = new RSTile(3089, 3232, 0);
  291. RSWeb webToYew = web.getWeb(getMyPlayer().getLocation(), yewTile);
  292. webToYew.step();
  293. RSObject ivy = objects.getNearest(willowTreeId);
  294.  
  295. if ((ivy != null) && (getMyPlayer().getAnimation() == -1) && (!getMyPlayer().isMoving()))
  296. ivy.interact("Chop");
  297. sleep(1500);
  298.  
  299.  
  300. }}
  301. if (FallSouthIvy == true) {
  302. if (inventory.isFull()) {
  303.  
  304. RSTile bankTile = new RSTile(3012, 3355, 0);
  305. RSWeb webToBank = web.getWeb(getMyPlayer().getLocation(), bankTile);
  306. webToBank.step();
  307.  
  308. bank();
  309. }}
  310.  
  311. if (FallSouthIvy == true) {
  312. if (!inventory.isFull()) {
  313. RSTile yewTile = new RSTile(3048, 3328, 0);
  314. RSWeb webToYew = web.getWeb(getMyPlayer().getLocation(), yewTile);
  315. webToYew.step();
  316. RSObject ivy = objects.getNearest(ivyID);
  317.  
  318.  
  319. if ((ivy != null) && (getMyPlayer().getAnimation() == -1) && (!getMyPlayer().isMoving()))
  320. ivy.interact("Chop");
  321. sleep(1500);
  322.  
  323.  
  324. }}
  325.  
  326. if (FallNorthIvy == true) {
  327. if (inventory.isFull()) {
  328.  
  329. RSTile bankTile = new RSTile(2946, 3368, 0);
  330. RSWeb webToBank = web.getWeb(getMyPlayer().getLocation(), bankTile);
  331. webToBank.step();
  332.  
  333. bank();
  334. }}
  335.  
  336. if (FallNorthIvy == true) {
  337. if (!inventory.isFull()) {
  338. RSObject ivy = objects.getNearest(ivyID);
  339.  
  340.  
  341. if ((ivy != null) && (getMyPlayer().getAnimation() == -1) && (!getMyPlayer().isMoving()))
  342. ivy.interact("Chop");
  343. sleep(1500);
  344.  
  345. RSTile yewTile = new RSTile(3014, 3392, 0);
  346. RSWeb webToYew = web.getWeb(getMyPlayer().getLocation(), yewTile);
  347. webToYew.step();
  348. }}
  349. if (EastIvy == true) {
  350. if (inventory.isFull()) {
  351.  
  352. RSTile bankTile = new RSTile(3254, 3420, 0);
  353. RSWeb webToBank = web.getWeb(getMyPlayer().getLocation(), bankTile);
  354. webToBank.step();
  355.  
  356. bank();
  357. }}
  358.  
  359. if (EastIvy == true) {
  360. if (!inventory.isFull()) {
  361. RSObject ivy = objects.getNearest(ivyID);
  362.  
  363.  
  364. if ((ivy != null) && (getMyPlayer().getAnimation() == -1) && (!getMyPlayer().isMoving()))
  365. ivy.interact("Chop");
  366. sleep(1500);
  367.  
  368. RSTile yewTile = new RSTile(3233, 3457,0);
  369. RSWeb webToYew = web.getWeb(getMyPlayer().getLocation(), yewTile);
  370. webToYew.step();
  371. }}
  372. if (Ivy == true) {
  373. if (inventory.isFull()) {
  374.  
  375. RSTile bankTile = new RSTile(3177, 3478,0);
  376. RSWeb webToBank = web.getWeb(getMyPlayer().getLocation(), bankTile);
  377. webToBank.step();
  378.  
  379. bank();
  380. }}
  381.  
  382. if (Ivy == true) {
  383. if (!inventory.isFull()) {
  384. RSObject ivy = objects.getNearest(ivyID);
  385.  
  386.  
  387. if ((ivy != null) && (getMyPlayer().getAnimation() == -1) && (!getMyPlayer().isMoving()))
  388. ivy.interact("Chop");
  389. sleep(1500);
  390.  
  391. RSTile yewTile = new RSTile(3217, 3498,0);
  392. RSWeb webToYew = web.getWeb(getMyPlayer().getLocation(), yewTile);
  393. webToYew.step();
  394. }}
  395. if (ChurchYew == true) {
  396. if (inventory.isFull()) {
  397. RSTile bankTile = new RSTile(2724, 3493, 0);
  398. RSWeb webToBank = web.getWeb(getMyPlayer().getLocation(), bankTile);
  399. webToBank.step();
  400.  
  401. bank();
  402. }}
  403.  
  404. if (ChurchYew == true) {
  405. if (!inventory.isFull()) {
  406. RSTile yewTile = new RSTile(2711, 3462, 0);
  407. RSWeb webToYew = web.getWeb(getMyPlayer().getLocation(), yewTile);
  408. webToYew.step();
  409. RSObject oak = objects.getNearest(yewTreeId);
  410.  
  411.  
  412.  
  413. if ((oak != null) && (getMyPlayer().getAnimation() == -1) && (!getMyPlayer().isMoving()))
  414. oak.interact("Chop down");
  415. sleep(1500);
  416.  
  417.  
  418. }}
  419. if (BehindMaple == true) {
  420. if (inventory.isFull()) {
  421.  
  422.  
  423. RSTile bankTile = new RSTile(2724, 3493, 0);
  424. RSWeb webToBank = web.getWeb(getMyPlayer().getLocation(), bankTile);
  425. webToBank.step();
  426.  
  427. bank();
  428. }}
  429. if (BehindMaple == true) {
  430. if (!inventory.isFull()) {
  431. RSTile yewTile = new RSTile(2728, 3500, 0);
  432. RSWeb webToYew = web.getWeb(getMyPlayer().getLocation(), yewTile);
  433. webToYew.step();
  434. RSObject oak = objects.getNearest(mapleTReeID);
  435.  
  436.  
  437. if ((oak != null) && (getMyPlayer().getAnimation() == -1) && (!getMyPlayer().isMoving()))
  438. oak.interact("Chop down");
  439. sleep(1500);
  440.  
  441.  
  442.  
  443. }}
  444. if (CatherbayYew == true) {
  445. if (inventory.isFull()) {
  446.  
  447.  
  448. RSTile bankTile = new RSTile(2811, 3441, 0);
  449. RSWeb webToBank = web.getWeb(getMyPlayer().getLocation(), bankTile);
  450. webToBank.step();
  451.  
  452. bank();
  453. }}
  454.  
  455. if (CatherbayYew == true) {
  456. if (!inventory.isFull()) {
  457. RSTile yewTile = new RSTile(2759, 3431, 0);
  458. RSWeb webToYew = web.getWeb(getMyPlayer().getLocation(), yewTile);
  459. webToYew.step();
  460. RSObject oak = objects.getNearest(yewTreeId);
  461.  
  462.  
  463. if ((oak != null) && (getMyPlayer().getAnimation() == -1) && (!getMyPlayer().isMoving()))
  464. oak.interact("Chop down");
  465. sleep(1500);
  466.  
  467.  
  468.  
  469. }}
  470. if (SeersMagic == true) {
  471. if (inventory.isFull()) {
  472.  
  473. RSTile bankTile = new RSTile(2724, 3493, 0);
  474. RSWeb webToBank = web.getWeb(getMyPlayer().getLocation(), bankTile);
  475. webToBank.step();
  476.  
  477. bank();
  478. }}
  479.  
  480. if (SeersMagic == true) {
  481. if (!inventory.isFull()) {
  482. RSTile yewTile = new RSTile(2693, 3425, 0);
  483. RSWeb webToYew = web.getWeb(getMyPlayer().getLocation(), yewTile);
  484. webToYew.step();
  485. RSObject oak = objects.getNearest(magicTreeId);
  486.  
  487.  
  488. if ((oak != null) && (getMyPlayer().getAnimation() == -1) && (!getMyPlayer().isMoving()))
  489. oak.interact("Chop down");
  490. sleep(1500);
  491.  
  492.  
  493. }}
  494. if (TowerMagic == true) {
  495. if (inventory.isFull()) {
  496.  
  497.  
  498. RSTile bankTile = new RSTile(2724, 3493, 0);
  499. RSWeb webToBank = web.getWeb(getMyPlayer().getLocation(), bankTile);
  500. webToBank.step();
  501.  
  502. bank();
  503. }}
  504.  
  505. if (TowerMagic == true) {
  506. if (!inventory.isFull()) {
  507. RSTile yewTile = new RSTile(2700, 3398, 0);
  508. RSWeb webToYew = web.getWeb(getMyPlayer().getLocation(), yewTile);
  509. webToYew.step();
  510. RSObject oak = objects.getNearest(magicTreeId);
  511.  
  512.  
  513. if ((oak != null) && (getMyPlayer().getAnimation() == -1) && (!getMyPlayer().isMoving()))
  514. oak.interact("Chop down");
  515. sleep(1500);
  516.  
  517.  
  518.  
  519. }}
  520.  
  521.  
  522.  
  523.  
  524. if (NorthFalador == true) {
  525. if (inventory.isFull()) {
  526.  
  527.  
  528. RSTile bankTile = new RSTile(2946, 3368, 0);
  529. RSWeb webToBank = web.getWeb(getMyPlayer().getLocation(), bankTile);
  530. webToBank.step();
  531.  
  532. bank();
  533. }}
  534. if (NorthFalador == true) {
  535. if (!inventory.isFull()) {
  536. RSTile yewTile = new RSTile(2949, 3405, 0);
  537. RSWeb webToYew = web.getWeb(getMyPlayer().getLocation(), yewTile);
  538. webToYew.step();
  539. RSObject oak = objects.getNearest(oakTreeID);
  540.  
  541.  
  542. if ((oak != null) && (getMyPlayer().getAnimation() == -1) && (!getMyPlayer().isMoving()))
  543. oak.interact("Chop down");
  544. sleep(1500);
  545.  
  546.  
  547.  
  548.  
  549. }}
  550. if (SouthFalador == true) {
  551. if (inventory.isFull()) {
  552. RSTile bankTile = new RSTile(2946, 3368, 0);
  553. RSWeb webToBank = web.getWeb(getMyPlayer().getLocation(), bankTile);
  554. webToBank.step();
  555.  
  556. bank();
  557. }}
  558. if (SouthFalador == true) {
  559. if (!inventory.isFull()) {
  560. RSTile yewTile = new RSTile(3039, 3321, 0);
  561. RSWeb webToYew = web.getWeb(getMyPlayer().getLocation(), yewTile);
  562. webToYew.step();
  563. RSObject oak = objects.getNearest(oakTreeID);
  564.  
  565.  
  566. if ((oak != null) && (getMyPlayer().getAnimation() == -1) && (!getMyPlayer().isMoving()))
  567. oak.interact("Chop down");
  568. sleep(1500);
  569.  
  570.  
  571.  
  572.  
  573. }}
  574. if (Draynor == true) {
  575. if (inventory.isFull()) {
  576.  
  577. RSTile bankTile = new RSTile(3012, 3355, 0);
  578. RSWeb webToBank = web.getWeb(getMyPlayer().getLocation(), bankTile);
  579. webToBank.step();
  580.  
  581. bank();
  582. }}
  583.  
  584. if (Draynor == true) {
  585. if (!inventory.isFull()) {
  586. RSTile yewTile = new RSTile(3100, 3286, 0);
  587. RSWeb webToYew = web.getWeb(getMyPlayer().getLocation(), yewTile);
  588. webToYew.step();
  589. RSObject oak = objects.getNearest(oakTreeID);
  590.  
  591.  
  592. if ((oak != null) && (getMyPlayer().getAnimation() == -1) && (!getMyPlayer().isMoving()))
  593. oak.interact("Chop down");
  594. sleep(1500);
  595.  
  596.  
  597.  
  598. }}
  599. if (Varrock == true) {
  600.  
  601. if (inventory.isFull()) {
  602.  
  603. RSTile bankTile = new RSTile(3254, 3420, 0);
  604. RSWeb webToBank = web.getWeb(getMyPlayer().getLocation(), bankTile);
  605. webToBank.step();
  606.  
  607. bank();
  608. }}
  609. if (Varrock == true) {
  610. if (!inventory.isFull()) {
  611. RSTile yewTile = new RSTile(3285, 3421, 0);
  612. RSWeb webToYew = web.getWeb(getMyPlayer().getLocation(), yewTile);
  613. webToYew.step();
  614. RSObject oak = objects.getNearest(oakTreeID);
  615.  
  616.  
  617. if ((oak != null) && (getMyPlayer().getAnimation() == -1) && (!getMyPlayer().isMoving()))
  618. oak.interact("Chop down");
  619. sleep(1500);
  620.  
  621.  
  622. }}
  623.  
  624.  
  625. antiBanList();
  626. return (random(650, 950));}
  627. public void superAntiMoveMouse() {
  628. final int rand = random(0,65);
  629. switch (rand) {
  630. case 0:
  631.  
  632. mouse.moveSlightly();
  633. mouse.moveSlightly();
  634. mouse.moveSlightly();
  635. break;
  636. case 1:
  637.  
  638. mouse.moveSlightly();
  639. mouse.moveSlightly();
  640. break;
  641. case 2:
  642.  
  643. mouse.moveSlightly();
  644. mouse.moveSlightly();
  645. mouse.moveSlightly();
  646. mouse.moveSlightly();
  647. mouse.moveSlightly();
  648. mouse.moveSlightly();
  649. break;
  650. case 3:
  651. mouse.moveOffScreen();
  652. sleep(random(2000, 3000));
  653. break;
  654. }
  655. }
  656.  
  657. public void randomtab() {
  658. switch (random(0, 12)) {
  659. case 0:
  660. game.openTab(Game.Tab.STATS);
  661. game.openTab(Game.Tab.INVENTORY);
  662.  
  663. break;
  664. case 1:
  665. game.openTab(Game.Tab.INVENTORY);
  666. break;
  667. case 2:
  668. game.openTab(Game.Tab.CLAN_CHAT);
  669. game.openTab(Game.Tab.INVENTORY);
  670. break;
  671. case 3:
  672. game.openTab(Game.Tab.FRIENDS);
  673. game.openTab(Game.Tab.INVENTORY);
  674. break;
  675. case 4:
  676. game.openTab(Game.Tab.CLAN_CHAT);
  677. game.openTab(Game.Tab.INVENTORY);
  678. break;
  679. case 5:
  680. game.openTab(Game.Tab.EQUIPMENT);
  681. game.openTab(Game.Tab.INVENTORY);
  682. break;
  683. case 6:
  684. game.openTab(Game.Tab.MAGIC);
  685. game.openTab(Game.Tab.INVENTORY);
  686. break;
  687. case 7:
  688. game.openTab(Game.Tab.QUESTS);
  689. game.openTab(Game.Tab.INVENTORY);
  690. break;
  691. case 8:
  692. game.openTab(Game.Tab.FRIENDS_CHAT);
  693. game.openTab(Game.Tab.INVENTORY);
  694. break;
  695. case 9:
  696. game.openTab(Game.Tab.NOTES);
  697. game.openTab(Game.Tab.INVENTORY);
  698. break;
  699. case 10:
  700. game.openTab(Game.Tab.PRAYER);
  701. game.openTab(Game.Tab.INVENTORY);
  702. break;
  703. case 11:
  704. game.openTab(Game.Tab.MUSIC);
  705. game.openTab(Game.Tab.INVENTORY);
  706. break;
  707. }
  708. }
  709.  
  710.  
  711. public void MouseObserve() {
  712.  
  713. }
  714.  
  715. {
  716.  
  717. }
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724. public void mouseMoveDownMenu() {
  725.  
  726. Point b = menu.getLocation();
  727. if (menu.isOpen()) {
  728. int x = b.x;
  729. int y = b.y;
  730. int x2 = (x + 218);
  731. int y2 = 0;
  732. y2 = y2 + menu.getSize() * 17;
  733. mouse.move(random(x, x2), random(y + 30, y2));
  734. }
  735. sleep(800);
  736. }
  737.  
  738. public void moveMouseOffMenu() {
  739. Point b = menu.getLocation();
  740. if (menu.isOpen()) {
  741. int x = b.x;
  742. int y = b.y;
  743. if (random(0, 2) == 0) {
  744. x = x + random(-20, -50);
  745. } else {
  746. x = (x + 218) + random(+20, +50);
  747. }
  748. if (random(0, 2) == 0) {
  749. y = y + random(-20, -50);
  750. } else {
  751. y = (y + menu.getSize() * 17) + random(+20, +50);
  752. }
  753. mouse.move(x, y);
  754. sleep(random(100, 400));
  755. }
  756.  
  757. }
  758.  
  759. public void randomXPcheck() {
  760. game.openTab(Game.Tab.STATS);
  761. switch (random(0, 20)) {
  762. case 0:
  763. break;
  764. case 1:
  765. skills.doHover(skills.WOODCUTTING);
  766. sleep(random(5000, 7000));
  767. game.openTab(Game.Tab.INVENTORY);
  768. break;
  769. case 2:
  770. break;
  771. case 3:
  772. break;
  773. case 4:
  774. break;
  775. case 5:
  776. break;
  777. case 6:
  778. break;
  779. case 7:
  780. break;
  781. case 8:
  782. break;
  783. case 9:
  784. break;
  785. case 10:
  786. break;
  787. case 11:
  788. break;
  789. case 12:
  790. break;
  791. case 13:
  792. break;
  793. case 14:
  794. break;
  795. case 15:
  796. break;
  797. case 16:
  798. break;
  799. case 17:
  800. break;
  801. case 18:
  802. break;
  803. case 19:
  804. break;
  805. case 20:
  806. break;
  807. }
  808. }
  809.  
  810. public int antiBanList() {
  811. switch (random(0, 28)) {
  812. case 8:
  813. superAntiMoveMouse();
  814. AntiBanCamera();
  815. break;
  816. case 5:
  817. MouseObserve();
  818. break;
  819. case 9:
  820. randomXPcheck();
  821. break;
  822. case 1:
  823. break;
  824. case 10:
  825. randomtab();
  826. AntiBanCamera();
  827. break;
  828. case 11:
  829. case 12:
  830. break;
  831. case 13:
  832. superAntiMoveMouse();
  833. AntiBanCamera();
  834. break;
  835. case 14:
  836. AntiBanCamera();
  837. break;
  838. case 15:
  839. case 16:
  840. MouseObserve();
  841. break;
  842. case 17:
  843. break;
  844. default:
  845. break;
  846. }
  847. return 500;
  848. }
  849.  
  850. public void mouseHandler() {
  851. switch (random(0, 5)) {
  852. case 0:
  853. mouse.moveOffScreen();
  854. sleep(random(5000, 6000));
  855.  
  856. case 1:
  857. mouse.moveOffScreen();
  858. sleep(random(2000, 7000));
  859.  
  860. case 2:
  861. mouse.moveSlightly();
  862. case 3:
  863. mouse.moveSlightly();
  864. case 4:
  865. case 5:
  866. mouse.moveOffScreen();
  867. sleep(random(5000, 10000));
  868.  
  869. }
  870. }
  871.  
  872. private void AntiBanCamera() {
  873. {
  874. int randomNum = random(1, 50);
  875. if (randomNum == 1 || randomNum == 2 || randomNum == 3) {
  876. camera.moveRandomly(random(2000, 5500));
  877. }
  878. if (randomNum == 4 || randomNum == 5) {
  879. camera.setAngle(random(10, 40));
  880. }
  881. if (randomNum == 6) {
  882. camera.setPitch(random(40, 68));
  883. }
  884. if (randomNum == 7) {
  885. camera.setPitch(random(20, 45));
  886. }
  887. if (randomNum == 8) {
  888. camera.setPitch(random(68, 90));
  889. } else
  890. sleep(50);
  891. }
  892. }
  893.  
  894. //Method
  895. private String formatTime(final long time) {
  896. if(time > 0){
  897. final int sec = (int) (time / 1000), h = sec / 3600, m = sec / 60 % 60, s = sec % 60;
  898. return (h < 10 ? "0" + h : h) + ":" + (m < 10 ? "0" + m : m) + ":"+ (s < 10 ? "0" + s : s);
  899. }
  900. return "--:--:--";
  901. }
  902.  
  903.  
  904. //START: Code generated using Enfilade's Easel
  905. private Image getImage(String url) {
  906. try {
  907. return ImageIO.read(new URL(url));
  908. } catch(IOException e) {
  909. return null;
  910. }
  911. }
  912.  
  913. private final Color color1 = new Color(0, 102, 0);
  914. private final Color color2 = new Color(0, 0, 0);
  915. private final Color color3 = new Color(204, 0, 51);
  916. private final Color color4 = new Color(51, 153, 0);
  917. private final Color color5 = new Color(0, 0, 255);
  918. private final Color color6 = new Color(0, 153, 0);
  919. private final Color color7 = new Color(204, 0, 0);
  920. private final Color color8 = new Color(255, 51, 51);
  921. private final Font font1 = new Font("Arial", 1, 17);
  922. private final Font font2 = new Font("MS Reference Sans Serif", 1, 13);
  923. private final Font font3 = new Font("MS Reference Sans Serif", 1, 21);
  924. private final Font font4 = new Font("MS Reference Sans Serif", 1, 10);
  925. private final BasicStroke stroke2 = new BasicStroke(5);
  926. private final BasicStroke stroke3 = new BasicStroke(3);
  927. private final Image img1 = getImage("http://i52.tinypic.com/mkg0uf.jpg");
  928.  
  929. public void onRepaint(Graphics g1) {
  930. Graphics2D g = (Graphics2D)g1;
  931. if (GETree == true) {
  932. Taken=expGained/ treexp;}
  933. if (SouthVarrockOak == true) {
  934. Taken=expGained/ oakxp;}
  935. if (CandleOak == true) {
  936. Taken=expGained/ oakxp;}
  937. if (CatherbayOak == true) {
  938. Taken=expGained/ oakxp;}
  939. if (GEYew == true) {
  940. Taken=expGained/ yewxp;}
  941. if (DraynorTree == true) {
  942. Taken=expGained/ treexp;}
  943. if (BehindMaple == true) {
  944. Taken = expGained / maplexp;}
  945. if (EastIvy == true) {
  946. Taken = expGained / ivyxp;}
  947. if (FallNorthIvy == true) {
  948. Taken = expGained / ivyxp;}
  949. if (FallSouthIvy == true) {
  950. Taken = expGained / ivyxp;}
  951. if (Ivy == true) {
  952. Taken = expGained / ivyxp;}
  953. if (DraynorWillow == true) {
  954. Taken=expGained/ willowxp;}
  955. if (CatherbayWillow == true) {
  956. Taken=expGained/ willowxp;}
  957. if (ChurchYew == true) {
  958. Taken = expGained / yewxp;}
  959. if (Varrock == true) {
  960. Taken = expGained / oakxp;}
  961. if (Draynor == true) {
  962. Taken = expGained / oakxp;}
  963. if (SouthFalador == true) {
  964. Taken = expGained / oakxp;}
  965. if (CatherbayYew == true) {
  966. Taken=expGained/ yewxp;}
  967. if (TowerMagic == true) {
  968. Taken=expGained/ magicxp;
  969. }
  970. if (NorthFalador == true) {
  971. Taken = expGained / oakxp;}
  972. logsPHR = (int) ((Taken) * 3600000.0 / (System.currentTimeMillis() - startTime));
  973.  
  974. int expHour = (int) ((expGained * 3600000D) / runTime);
  975.  
  976. expGained = skills.getCurrentExp(skills.WOODCUTTING) - startExp;
  977.  
  978. runTime = System.currentTimeMillis() - startTime;
  979. g.drawImage(img1, 4, 340, null);
  980. g.setFont(font1);
  981. g.setColor(color1);
  982. g.drawString("Time Ran:"+formatTime(runTime), 359, 385);
  983. g.drawString("XP Gained:"+ expGained, 287, 423);
  984. g.drawString("Chopped:"+ Taken, 29, 419);
  985. g.drawString("Chopped PHR:"+ logsPHR, 27, 458);
  986. g.drawString("XP PHR:"+ expHour, 287, 459);
  987. g.setColor(color2);
  988. g.drawString("Post Your Proggies Please", 557, 437);
  989. g.setFont(font2);
  990. g.setColor(color4);
  991. g.drawString("Post Your Proggies Please", 546, 401);
  992. g.setColor(color5);
  993. g.drawString("Thanks", 611, 235);
  994. g.drawString("For", 626, 279);
  995. g.drawString("Using", 617, 324);
  996. g.setColor(color6);
  997. g.drawRect(142, 18, 234, 33);
  998. g.setFont(font3);
  999. g.setColor(color7);
  1000. g.drawString("Report Bugs Please", 146, 44);
  1001. g.setColor(color6);
  1002. g.drawString("AIO Banking Woodcutter", 12, 283);
  1003. g.setFont(font4);
  1004. g.drawString("Popglass2", 165, 313);
  1005. g.setColor(color8);
  1006. g.setStroke(stroke3);
  1007.  
  1008.  
  1009.  
  1010.  
  1011. }
  1012.  
  1013.  
  1014.  
  1015.  
  1016. @Override
  1017. public void messageReceived(MessageEvent e) {
  1018. String txt = e.getMessage().toLowerCase();
  1019. if(txt.contains("you chop")) {
  1020. Taken++;
  1021. }
  1022. }
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034. /**
  1035. * @author bradley johnson
  1036. */
  1037. public class Tutorial extends JFrame {
  1038. public Tutorial() {
  1039. initComponents();
  1040. }
  1041.  
  1042. private void button1ActionPerformed(ActionEvent e) {
  1043. // TODO add your code here
  1044. }
  1045.  
  1046. private void initComponents() {
  1047. // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
  1048. // Generated using JFormDesigner Evaluation license - bradley johnson
  1049. layeredPane1 = new JLayeredPane();
  1050. comboBox2 = new JComboBox();
  1051. button1 = new JButton();
  1052. label2 = new JLabel();
  1053.  
  1054. //======== this ========
  1055. setBackground(new Color(204, 0, 51));
  1056. setForeground(new Color(204, 0, 0));
  1057.  
  1058. Container contentPane = getContentPane();
  1059. contentPane.setLayout(null);
  1060. contentPane.add(layeredPane1);
  1061. layeredPane1.setBounds(0, 10, 26, layeredPane1.getPreferredSize().height);
  1062. //---- comboBox2 ----
  1063. comboBox2.setModel(new DefaultComboBoxModel(new String[] {
  1064. "Varrock East Oaks", "Draynor Oaks", "South Falador Oaks", "North Falador Oaks",
  1065. "Sorcerer's Tower Magic",
  1066. "Seers Village Magic",
  1067. "Catherbay Yews",
  1068. "EdgeVille Yews",
  1069. "Seers Maple Behind Bank",
  1070. "Seers Church Yews",
  1071. "Grand Exchange Ivy",
  1072. "Varrock Palace East Ivy",
  1073. "Falador North Ivy",
  1074. "Falador South Ivy",
  1075. "GrandExchange Yews",
  1076. "South of GrandExchange Trees",
  1077. "Draynor Willows",
  1078. "Draynor Trees",
  1079.  
  1080. "Catherbay Willow",
  1081. "Catherbay Oak",
  1082. "North of CandleShop Catherbay Oaks"
  1083.  
  1084.  
  1085.  
  1086.  
  1087. }));
  1088. contentPane.add(comboBox2);
  1089. comboBox2.setBounds(10, 120, 310, 40);
  1090. // ---- button1 ----
  1091. button1.setText("Start Script");
  1092. button1.addActionListener(new ActionListener() {
  1093. public void actionPerformed(ActionEvent e) {
  1094. StartButton(e);
  1095. }
  1096.  
  1097. private void StartButton(ActionEvent e) {
  1098. String chosen = comboBox2.getSelectedItem().toString();
  1099. if (chosen.equals("North of CandleShop Catherbay Oaks")) {
  1100. CandleOak = true;
  1101. } else {
  1102. CandleOak = false;
  1103. }
  1104. if (chosen.equals("South Varrock Oak")) {
  1105. SouthVarrockOak = true;
  1106. } else {
  1107. SouthVarrockOak = false;
  1108. }
  1109. if (chosen.equals("Catherbay Oak")) {
  1110. CatherbayOak = true;
  1111. } else {
  1112. CatherbayOak = false;
  1113. }
  1114. if (chosen.equals("Gnome Magic")) {
  1115. GnomeMagic = true;
  1116. } else {
  1117. GnomeMagic = false;
  1118. }
  1119. if (chosen.equals("EdgeVille Yews")) {
  1120. EdgeYew = true;
  1121. } else {
  1122. EdgeYew = false;
  1123. }
  1124. if (chosen.equals("Draynor Trees")) {
  1125. DraynorTree = true;
  1126. } else {
  1127. DraynorTree = false;
  1128. }
  1129. if (chosen.equals("Draynor Willows")) {
  1130. DraynorWillow = true;
  1131. } else {
  1132. DraynorWillow = false;
  1133. }
  1134. if (chosen.equals("South of GrandExchange Trees")) {
  1135. GETree = true;
  1136. } else {
  1137. GETree = false;
  1138. }
  1139. if (chosen.equals("Falador South Ivy")) {
  1140. FallSouthIvy = true;
  1141. } else {
  1142. FallSouthIvy = false;
  1143. }
  1144. if (chosen.equals("Falador North Ivy")) {
  1145. FallNorthIvy = true;
  1146. } else {
  1147. FallNorthIvy = false;
  1148. }
  1149.  
  1150. if (chosen.equals("Varrock Palace East Ivy")) {
  1151. EastIvy = true;
  1152. } else {
  1153. EastIvy = false;
  1154. }
  1155. if (chosen.equals("Grand Exchange Ivy")) {
  1156. Ivy = true;
  1157. } else {
  1158. Ivy = false;
  1159. }
  1160. if (chosen.equals("GrandExchange Yews")) {
  1161. GEYew= true;
  1162. } else {
  1163. GEYew = false;
  1164. }
  1165. if (chosen.equals("Varrock East Oaks")) {
  1166. Varrock = true;
  1167. } else {
  1168. Varrock = false;
  1169. }
  1170. if (chosen.equals("Draynor Oaks")) {
  1171. Draynor = true;
  1172. } else {
  1173. Draynor = false;
  1174. }
  1175. if (chosen.equals("South Falador Oaks")) {
  1176. SouthFalador = true;
  1177. } else {
  1178. SouthFalador = false;
  1179. }
  1180. if (chosen.equals("North Falador Oaks")) {
  1181. NorthFalador = true;
  1182. } else {
  1183. NorthFalador = false;
  1184. }
  1185. if (chosen.equals("Sorcerer's Tower Magic")) {
  1186. TowerMagic = true;
  1187. } else {
  1188. TowerMagic = false;
  1189. }
  1190. if (chosen.equals("Seers Village Magic")) {
  1191. SeersMagic = true;
  1192. } else {
  1193. SeersMagic = false;
  1194. }
  1195. if (chosen.equals("Catherbay Yews")) {
  1196. CatherbayYew = true;
  1197. } else {
  1198. CatherbayYew = false;
  1199. }
  1200. if (chosen.equals("Seers Maple Behind Bank")) {
  1201. BehindMaple = true;
  1202. } else {
  1203. BehindMaple = false;
  1204. }
  1205. if (chosen.equals("Resource Island Maple")) {
  1206. ResourceMaple = true;
  1207. } else {
  1208. ResourceMaple = false;
  1209. }
  1210. if (chosen.equals("Seers Church Yews")) {
  1211. ChurchYew = true;
  1212. } else {
  1213. ChurchYew = false;
  1214. }
  1215. if (chosen.equals("Catherbay Willow")) {
  1216. CatherbayWillow = true;
  1217. } else {
  1218. CatherbayWillow = false;
  1219. }
  1220. guiWait = false;
  1221. g.setVisible(false);
  1222. }
  1223. });
  1224.  
  1225. contentPane.add(button1);
  1226. button1.setBounds(110, 70, 154, button1.getPreferredSize().height);
  1227.  
  1228. //---- label2 ----
  1229. try {
  1230. label2.setIcon(new ImageIcon(new URL("http://i892.photobucket.com/albums/ac124/gamemaste789/rs/GUIBack.jpg")));
  1231. } catch (final java.net.MalformedURLException e1) {
  1232. // TODO Auto-generated catch block
  1233. e1.printStackTrace();
  1234. }
  1235. contentPane.add(label2);
  1236. label2.setBounds(-5, -10, 400, 315);
  1237.  
  1238. { // compute preferred size
  1239. Dimension preferredSize = new Dimension();
  1240. for(int i = 0; i < contentPane.getComponentCount(); i++) {
  1241. Rectangle bounds = contentPane.getComponent(i).getBounds();
  1242. preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
  1243. preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
  1244. }
  1245. Insets insets = contentPane.getInsets();
  1246. preferredSize.width += insets.right;
  1247. preferredSize.height += insets.bottom;
  1248. contentPane.setMinimumSize(preferredSize);
  1249. contentPane.setPreferredSize(preferredSize);
  1250. }
  1251. pack();
  1252. setLocationRelativeTo(getOwner());
  1253. // JFormDesigner - End of component initialization //GEN-END:initComponents
  1254. }
  1255.  
  1256. // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
  1257. // Generated using JFormDesigner Evaluation license - bradley johnson
  1258. private JLayeredPane layeredPane1;
  1259. private JComboBox comboBox2;
  1260. private JButton button1;
  1261. private JLabel label2;
  1262. // JFormDesigner - End of variables declaration //GEN-END:variables
  1263. }
  1264.  
  1265. }
Advertisement
Add Comment
Please, Sign In to add comment