Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.10 KB | None | 0 0
  1. 1. import java.awt.Graphics;
  2. 2.
  3. 3. import com.rsbuddy.event.events.MessageEvent;
  4. 4. import com.rsbuddy.event.listeners.MessageListener;
  5. 5. import com.rsbuddy.event.listeners.PaintListener;
  6. 6. import com.rsbuddy.script.ActiveScript;
  7. 7. import com.rsbuddy.script.Manifest;
  8. 8.
  9. 9.
  10. 10. @ScriptManifest(authors = "Trepidation", name = "TrepGreenWall", version = 0.1, description = "Hunts GrenWalls")
  11. 11.
  12. 12. public abstract class TrepGrenWallHunter extends Script implements PaintListener, MouseListener, MessageListener{
  13. 13.
  14. 14. //GUI Stuff\\
  15. 15. private boolean GUIwait = true;
  16. 16. //////////////////////////////Walking Path Variables\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  17. 17. public final RSTile[] BanktoTree = {new RSTile(2352, 3162),
  18. 18. new RSTile(2341, 3158), new RSTile(2331, 3168),
  19. 19. new RSTile(2320, 3172), new RSTile(2311, 3173),
  20. 20. new RSTile(2309, 3180), new RSTile(2308, 3188),
  21. 21. new RSTile(3107, 3194)};
  22. 22. /*PASS TREE (8742)*/
  23. 23. public final RSTile[] TreetoStick = {new RSTile(2295, 3187), new RSTile(2288, 3188)};
  24. 24. /*STICK TRAP (3921)*/
  25. 25. public final RSTile[] SticktoForest = {new RSTile(2278, 3189), new RSTile(2274, 3190)};
  26. 26. /*FOREST (3937)*/
  27. 27. /*FOREST (3939)*/
  28. 28. /*FOREST (3938)*/
  29. 29. public final RSTile[] ForesttoLeaf = {new RSTile(2267, 3200)};
  30. 30. /*LEAF TRAP (3925)*/
  31. 31. public final RSTile[] LeaftoForest = {new RSTile(2276, 3210), new RSTile(2282, 3215),
  32. 32. new RSTile(2279, 3220)};
  33. 33. /*FOREST (3938)*/
  34. 34. /*FOREST (3937)*/
  35. 35. /*FOREST (3939)*/
  36. 36. private final RSTile[] ForesttoGW = {new RSTile(2273, 3237), new RSTile(2267, 3240)};
  37. 37. ///////////////////////////Ends Walking Path Variables\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  38. 38. //Constants\\
  39. 39. private int[] food = { 1895, 1893, 1891, 4293, 2142, 291, 2140, 3228, 9980,
  40. 40. 7223, 6297, 6293, 6295, 6299, 7521, 9988, 7228, 2878, 7568, 2343,
  41. 41. 1861, 13433, 315, 325, 319, 3144, 347, 355, 333, 339, 351, 329,
  42. 42. 3381, 361, 10136, 5003, 379, 365, 373, 7946, 385, 397, 391, 3369,
  43. 43. 3371, 3373, 2309, 2325, 2333, 2327, 2331, 2323, 2335, 7178, 7180,
  44. 44. 7188, 7190, 7198, 7200, 7208, 7210, 7218, 7220, 2003, 2011, 2289,
  45. 45. 2291, 2293, 2295, 2297, 2299, 2301, 2303, 1891, 1893, 1895, 1897,
  46. 46. 1899, 1901, 7072, 7062, 7078, 7064, 7084, 7082, 7066, 7068, 1942,
  47. 47. 6701, 6703, 7054, 6705, 7056, 7060, 2130, 1985, 1993, 1989, 1978,
  48. 48. 5763, 5765, 1913, 5747, 1905, 5739, 1909, 5743, 1907, 1911, 5745,
  49. 49. 2955, 5749, 5751, 5753, 5755, 5757, 5759, 5761, 2084, 2034, 2048,
  50. 50. 2036, 2217, 2213, 2205, 2209, 2054, 2040, 2080, 2277, 2225, 2255,
  51. 51. 2221, 2253, 2219, 2281, 2227, 2223, 2191, 2233, 2092, 2032, 2074,
  52. 52. 2030, 2281, 2235, 2064, 2028, 2187, 2185, 2229, 6883, 1971, 4608,
  53. 53. 1883, 1885, 15272 };
  54. 54. private int[] antip = {179,177,175,2446,185,183,181,2448};
  55. 55. private int boxTrap = 10008;
  56. 56. private int batScroll = 12423;
  57. 57. private int batPouch = 12033;
  58. 58. private int[] bankerID = {2354,2355};
  59. 59. //Variable Declaration\\
  60. 60. private double playerProfit;
  61. 61. private boolean useBat;
  62. 62. private boolean pickUpHerbs;
  63. 63. private boolean teleCrystal;
  64. 64. private int startHuntlvl;
  65. 65. private int numOfSpikes;
  66. 66. private double profit;
  67. 67. private long startTime;
  68. 68. private long startExp;
  69. 69. private int startLevel;
  70. 70. private int spikeID;
  71. 71. private Timer runTime;
  72. 72. /*=========================================onStart= ===========================================*/
  73. 73. @Override
  74. 74. public boolean onStart(){
  75. 75. /*
  76. 76. startTime = System.currentTimeMillis();
  77. 77. startExp = skills.getCurrentExp(Skills.HUNTER);
  78. 78. startLevel = skills.getCurrentLevel(Skills.HUNTER);
  79. 79. if (startLevel < 77)
  80. 80. {
  81. 81. stopScript(true);
  82. 82. log("Your hunter level does not meet the minimum requirement.");
  83. 83. }*/
  84. 84. mouse.setSpeed(4);
  85. 85. TrepFORM gui = new TrepFORM();
  86. 86. gui.setVisible(true);
  87. 87.
  88. 88. if(gui.isGuiReady == true)
  89. 89. {
  90. 90. sleep(500);
  91. 91. }
  92. 92. else
  93. 93. {
  94. 94. stopScript(true);
  95. 95. }
  96. 96. if (gui.radioButton1.isSelected())
  97. 97. {
  98. 98. useBat = true;
  99. 99. }
  100. 100. else
  101. 101. {
  102. 102. useBat = false;
  103. 103. }
  104. 104. if (gui.radioButton2.isSelected())
  105. 105. {
  106. 106. pickUpHerbs = true;
  107. 107. }
  108. 108. else
  109. 109. {
  110. 110. pickUpHerbs = false;
  111. 111. }
  112. 112. if (gui.radioButton3.isSelected())
  113. 113. {
  114. 114. teleCrystal = true;
  115. 115. }
  116. 116. else
  117. 117. {
  118. 118. teleCrystal = false;
  119. 119. }
  120. 120. return true;
  121. 121. }
  122. 122. /*=========================================Loop==== ===========================================*/
  123. 123. @Override
  124. 124. public int loop()
  125. 125. {
  126. 126. if (getMyPlayer().getHPPercent() < 50) {
  127. 127. final RSItem foods = inventory.getItem(food);
  128. 128. if (foods != null) {
  129. 129. foods.doAction("Eat");
  130. 130. }
  131. 131. sleep(3000);
  132. 132. }
  133. 133. return 0;
  134. 134. }
  135. 135. /*=======================================onFinish== ===========================================*/
  136. 136. @Override
  137. 137. public void onFinish()
  138. 138. {
  139. 139. log("Thank you for using Trepidation's GrenWall Hunter.");
  140. 140. log("Please post on the thread if any bugs have been found!");
  141. 141. //Progress Report Goes Here\\
  142. 142. }
  143. 143. /*=========================================Other=== ===========================================*/
  144. 144. private void sleep()
  145. 145. {
  146. 146. sleep(400,600);
  147. 147. }
  148. 148. private void summonBat()
  149. 149. {
  150. 150.
  151. 151. }
  152. 152. private void walk(RSTile[] path)
  153. 153. {
  154. 154. walking.walkPathMM(path);
  155. 155. sleep();
  156. 156. }
  157. 157. private double getProfit()
  158. 158. {
  159. 159. spikeID = grandExchange.getItemID("Grenwall spikes");
  160. 160. int spikePrice = grandExchange.lookup(spikeID).getMarketPrice();
  161. 161. int numberofSpikes = inventory.getCount(true, spikeID);
  162. 162. double profit = (spikePrice)*(numberofSpikes);
  163. 163. playerProfit = playerProfit profit;
  164. 164. return playerProfit;
  165. 165. }
  166. 166. private void bankToGW()
  167. 167. {
  168. 168.
  169. 169. }
  170. 170. private void bankInventory()
  171. 171. {
  172. 172.
  173. 173. }
  174. 174. private void eatIfPoisoned()
  175. 175. {
  176. 176. boolean poison = combat.isPoisoned();
  177. 177. if (poison == true)
  178. 178. {
  179. 179. if (inventory.containsOneOf(antip))
  180. 180. {
  181. 181. log("Shit, we got poisoned, time to eat anti.");
  182. 182. inventory.getItem().doAction("Eat");
  183. 183. sleep(1000,250);
  184. 184. }
  185. 185. }
  186. 186. else
  187. 187. {
  188. 188. log("Yay, we didn't get poisoned!");
  189. 189. }
  190. 190. }
  191. 191. /*
  192. 192. private void openBank() {
  193. 193. RSObject bankers = objects.getNearest();
  194. 194. if (bankBooth != null && !bank.isOpen()) {
  195. 195. bankBooth.doAction("uickly"); }
  196. 196. }
  197. 197.
  198. 198.
  199. 199. private void depositItems() {
  200. 200. if(bank.isOpen()){
  201. 201. bank.deposit(ironOreID, 0);
  202. 202. sleep(200, 500);
  203. 203. mouse.click(true); }
  204. 204. }
  205. 205.
  206. 206. private void closeBank() {
  207. 207. if(bank.isOpen()){
  208. 208. mouse.move(490, 36, 3, 3);
  209. 209. mouse.click(true); }
  210. 210. }
  211. 211.
  212. 212. private void bankItems() {
  213. 213. openBank();
  214. 214. depositItems();
  215. 215. closeBank();
  216. 216. }
  217. 217. */
  218. 218. /*=================================onPaint========= ===========================================*/
  219. 219. @Override
  220. 220. public void onRepaint(final Graphics g)
  221. 221. {
  222. 222.
  223. 223. double timeInMS = System.currentTimeMillis() - startTime;
  224. 224. double totalSec = ((System.currentTimeMillis() - startTime) / 1000);
  225. 225. final Font font1 = new Font("Tahoma",1,16);
  226. 226. }
  227. 227. /*===========================================GUI=== ===========================================*/
  228. 228. public class TrepFORM extends JPanel {
  229. 229. public boolean isGuiReady;
  230. 230. public TrepFORM() {
  231. 231. initComponents();
  232. 232. }
  233. 233.
  234. 234. private void radioButton1MouseClicked(MouseEvent e) {
  235. 235. }
  236. 236.
  237. 237. private void radioButton2MouseClicked(MouseEvent e) {
  238. 238. }
  239. 239.
  240. 240. private void radioButton3MouseClicked(MouseEvent e) {
  241. 241. }
  242. 242.
  243. 243. private void radioButton1ActionPerformed(ActionEvent e) {
  244. 244. /*
  245. 245. if (radioButton1.isSelected())
  246. 246. {
  247. 247. useBat = true;
  248. 248. }
  249. 249. else
  250. 250. {
  251. 251. useBat = false;
  252. 252. }*/
  253. 253. }
  254. 254.
  255. 255. private void radioButton2ActionPerformed(ActionEvent e) {
  256. 256. /*
  257. 257. if (radioButton2.isSelected())
  258. 258. {
  259. 259. pickUpHerbs = true;
  260. 260. }
  261. 261. else
  262. 262. {
  263. 263. pickUpHerbs = false;
  264. 264. }
  265. 265. */
  266. 266. }
  267. 267.
  268. 268. private void radioButton3ActionPerformed(ActionEvent e) {
  269. 269. /*
  270. 270. if (radioButton3.isSelected())
  271. 271. {
  272. 272. teleCrystal = true;
  273. 273. }
  274. 274. else
  275. 275. {
  276. 276. teleCrystal = false;
  277. 277. }*/
  278. 278. }
  279. 279.
  280. 280. private void StartActionPerformed(ActionEvent e) {
  281. 281. setVisible(false);
  282. 282. isGuiReady = true;
  283. 283. }
  284. 284.
  285. 285. private void initComponents() {
  286. 286. label1 = new JLabel();
  287. 287. radioButton1 = new JRadioButton();
  288. 288. radioButton2 = new JRadioButton();
  289. 289. radioButton3 = new JRadioButton();
  290. 290. Start = new JButton();
  291. 291.
  292. 292. //======== this ========
  293. 293. setLayout(null);
  294. 294.
  295. 295. //---- label1 ----
  296. 296. label1.setText("Welcome to Trepidation's GrenWall Hunter !");
  297. 297. label1.setFont(new Font("Tahoma", Font.BOLD, 18));
  298. 298. label1.setForeground(Color.blue);
  299. 299. add(label1);
  300. 300. label1.setBounds(40, 35, 405, label1.getPreferredSize().height);
  301. 301.
  302. 302. //---- radioButton1 ----
  303. 303. radioButton1.setText("Use fruit bats?");
  304. 304. radioButton1.addMouseListener(new MouseAdapter() {
  305. 305. @Override
  306. 306. public void mouseClicked(MouseEvent e) {
  307. 307. radioButton1MouseClicked(e);
  308. 308. }
  309. 309. });
  310. 310. radioButton1.addActionListener(new ActionListener() {
  311. 311. @Override
  312. 312. public void actionPerformed(ActionEvent e) {
  313. 313. radioButton1ActionPerformed(e);
  314. 314. }
  315. 315. });
  316. 316. add(radioButton1);
  317. 317. radioButton1.setBounds(new Rectangle(new Point(35, 90), radioButton1.getPreferredSize()));
  318. 318.
  319. 319. //---- radioButton2 ----
  320. 320. radioButton2.setText("Pick up herbs?");
  321. 321. radioButton2.addMouseListener(new MouseAdapter() {
  322. 322. @Override
  323. 323. public void mouseClicked(MouseEvent e) {
  324. 324. radioButton2MouseClicked(e);
  325. 325. }
  326. 326. });
  327. 327. radioButton2.addActionListener(new ActionListener() {
  328. 328. @Override
  329. 329. public void actionPerformed(ActionEvent e) {
  330. 330. radioButton2ActionPerformed(e);
  331. 331. }
  332. 332. });
  333. 333. add(radioButton2);
  334. 334. radioButton2.setBounds(35, 125, 111, 25);
  335. 335.
  336. 336. //---- radioButton3 ----
  337. 337. radioButton3.setText("Use teleport crystal to bank?");
  338. 338. radioButton3.addMouseListener(new MouseAdapter() {
  339. 339. @Override
  340. 340. public void mouseClicked(MouseEvent e) {
  341. 341. radioButton3MouseClicked(e);
  342. 342. }
  343. 343. });
  344. 344. radioButton3.addActionListener(new ActionListener() {
  345. 345. @Override
  346. 346. public void actionPerformed(ActionEvent e) {
  347. 347. radioButton3ActionPerformed(e);
  348. 348. }
  349. 349. });
  350. 350. add(radioButton3);
  351. 351. radioButton3.setBounds(35, 160, 195, 25);
  352. 352.
  353. 353. //---- Start ----
  354. 354. Start.setText("LETS MAKE MONEY");
  355. 355. Start.setForeground(Color.orange);
  356. 356. Start.setFont(new Font("Tahoma", Font.BOLD, 16));
  357. 357. Start.addActionListener(new ActionListener() {
  358. 358. @Override
  359. 359. public void actionPerformed(ActionEvent e) {
  360. 360. StartActionPerformed(e);
  361. 361. }
  362. 362. });
  363. 363. add(Start);
  364. 364. Start.setBounds(250, 100, 190, 55);
  365. 365.
  366. 366. setPreferredSize(new Dimension(470, 235));
  367. 367. }
  368. 368. private JLabel label1;
  369. 369. private JRadioButton radioButton1;
  370. 370. private JRadioButton radioButton2;
  371. 371. private JRadioButton radioButton3;
  372. 372. private JButton Start;
  373. 373. }
  374. 374. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement