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