Guest User

Untitled

a guest
Jul 20th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.76 KB | None | 0 0
  1. import java.awt.*;
  2. import java.awt.event.*;
  3. import java.io.*;
  4. import java.net.*;
  5. import java.util.*;
  6.  
  7. import com.speljohan.rsbot.event.events.*;
  8. import com.speljohan.rsbot.event.listeners.*;
  9. import com.speljohan.rsbot.event.listeners.PaintListener;
  10. import com.speljohan.rsbot.accessors.*;
  11. import com.speljohan.rsbot.account.*;
  12. import com.speljohan.rsbot.bot.*;
  13. import com.speljohan.rsbot.script.wrappers.*;
  14. import com.speljohan.rsbot.script.*;
  15. import com.speljohan.rsbot.event.listeners.ServerMessageListener;
  16. import com.speljohan.rsbot.event.events.ServerMessageEvent;
  17.  
  18. public class SmokinLizards extends Script implements ServerMessageListener, PaintListener {
  19.  
  20. int Caught = 19659;
  21. int whatEXP = 272;
  22.  
  23. int Lizard = 10147;
  24. int caught = 0;
  25. int Net = 303;
  26. int NormalTree = 19662;
  27. int Rope = 954;
  28. int startExp = 0;
  29. public long startTime = System.currentTimeMillis();
  30. public long time = System.currentTimeMillis();
  31. int Trapped = 19678;
  32. int GambleInt;
  33. private final RSTile HunterTile = new RSTile(2474, 3237);
  34.  
  35.  
  36. public static final int[] ReleaseSalamander = new int[] { 10147 };
  37.  
  38. public String getAuthor( ) { //Sets the Authors name
  39. return "SmokeHaze";
  40. }
  41.  
  42. public String getName( ) {
  43. return "SmokinLizards";
  44. }
  45.  
  46. public double getVersion( ) {
  47. return 1.0;
  48. }
  49.  
  50. public String getScriptCategory() { //Sets the category that the script fit's into
  51. return "SmokeHaze Series/Hunter";
  52. }
  53. public String getScriptDescription( ) {
  54. String html="<html>";
  55. html += "<body>";
  56. html += "<center><font size=6><b>Smokin Lizards v1.0</b></font><font size=3><br><br><li>Before you start change the numbers in bold to your position you will be using <br> *private final RSTile HunterTile = new RSTile<b>(2449, 3225)</b>* </li> <br> <li>preferably set the tiles to the middle of where you will be around</li> <br> <li>Make sure camera is angled so you can see all trees you wish to use</li> <br> <li>It helps to check with objects seen, make sure the red object dot is lined up nicely with the tree</li> <br> <li>I recommend using the tiles I set it uses 3 trees flawlessy</li> <br> <li>Make sure to turn off <b><u>Break Handler</b></u> or else you will lose traps</li> <br> <li>There is <b>no</b> antiban so I hold no responsibility if you get banned</li> <br> <li>feel free to add your own anti ban</li> <br> <li>should work great if you follow my instructions ~ I use it myself</li><br> -- Credit goes to my girlfriend Koneko for making my paint -- </font></center>";
  57. html += "</body>";
  58. html += "</html>";
  59. return html;
  60. }
  61.  
  62. public boolean onStart( Map<String, String> args ) {
  63. Bot.getEventManager().addListener(PaintListener.class, this);
  64. return true;
  65. }
  66.  
  67. public void onFinish( ) {
  68. Bot.getEventManager().addListener(PaintListener.class, this);
  69. }
  70.  
  71. public void serverMessageRecieved(ServerMessageEvent e) {
  72. String word = e.getMessage().toLowerCase();
  73. if (word.contains("caught a red")) {
  74. caught++;
  75. }
  76. }
  77.  
  78.  
  79. public void turnCamera() {
  80. char[] LR = new char[] { KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT };
  81. char[] UD = new char[] { KeyEvent.VK_DOWN, KeyEvent.VK_UP };
  82. char[] LRUD = new char[] { KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT,
  83. KeyEvent.VK_UP, KeyEvent.VK_UP };
  84. int random2 = random(0,2);
  85. int random1 = random(0,2);
  86. int random4 = random(0,4);
  87.  
  88. if(random(0,3) == 0 && getMyPlayer().getAnimation() != -1) {
  89. Bot.getInputManager().pressKey(LR[random1]);
  90. try { Thread.sleep(random(50, 100)); } catch (Exception e) {}
  91. Bot.getInputManager().pressKey(UD[random2]);
  92. try { Thread.sleep(random(50, 100)); } catch (Exception e) {}
  93. Bot.getInputManager().releaseKey(UD[random2]);
  94. try { Thread.sleep(random(50, 100)); } catch (Exception e) {}
  95. Bot.getInputManager().releaseKey(LR[random1]);
  96. } else {
  97. Bot.getInputManager().pressKey(LRUD[random4]);
  98. if(random4>1) {
  99. try { Thread.sleep(random(5, 10)); } catch (Exception e) {}
  100. } else {
  101. try { Thread.sleep(random(5, 10)); } catch (Exception e) {}
  102. }
  103. Bot.getInputManager().releaseKey(LRUD[random4]);
  104. }
  105. }
  106.  
  107. public void onRepaint(Graphics g) {
  108. if (isLoggedIn()) {
  109. int exp = 0;
  110. int perNextLvl = 100 - skills.getPercentToNextLevel(STAT_HUNTER);
  111. int nextLvl = skills.getCurrentSkillLevel(STAT_HUNTER) + 1;
  112. long millis = System.currentTimeMillis() - startTime;
  113. long hours = millis / (1000 * 60 * 60);
  114. millis -= hours * (1000 * 60 * 60);
  115. long minutes = millis / (1000 * 60);
  116. millis -= minutes * (1000 * 60);
  117. long seconds = millis / 1000;
  118. long minutes2 = minutes + (hours * 60);
  119. int seconds1 = (int) seconds % 60;
  120. int minutes1 = (int) minutes % 60;
  121. int hours1 = (int) hours % 60;
  122. float fished = caught/(minutes1 + hours1*60 + seconds1/60f) * 60f;
  123.  
  124. if ( startExp == 0) {
  125. startExp = skills.getCurrentSkillExp(STAT_HUNTER);
  126. }
  127. int amt;
  128. amt = skills.getXPToNextLevel(STAT_HUNTER) / whatEXP;
  129. exp = skills.getCurrentSkillExp(STAT_HUNTER) - startExp;
  130. g.setColor(new Color(0, 0, 0, 0));
  131. g.fill3DRect(5, 25, 245, 100, true);
  132. g.setColor(Color.BLUE);
  133. g.drawString(getName() + " v" + getVersion(), 10, 40);
  134. g.setColor(Color.WHITE);
  135. g.drawString("Time you could've done this legitly: " + hours + ":" + minutes + ":"
  136. + seconds + "." , 10, 55);
  137. g.drawString("Smokin Lizards Caught " + Integer.toString(caught), 10, 70);
  138. g.drawString("XP Gained: " + exp + " XP. " ,10, 85);
  139. g.drawString("Smokin Lizards till Lvl: " + amt , 10, 100);
  140. g.drawString("Catching " + fished + "Smokin Lizards Per Hour." , 10, 115);
  141. }
  142. }
  143.  
  144. public boolean atTileTake(RSTile tile, String action) {
  145. int TempCounter = 0;
  146. while (true) {
  147. if (!getMyPlayer().isMoving()) break;
  148. wait(random(5, 10));
  149. }
  150. try {
  151. Point location = Calculations.tileToScreen(tile);
  152. if (location.x == -1 || location.y == -1) return false;
  153. moveMouse(location, 8,8);
  154. wait(random(5, 10));
  155. while(!getMenuItems().get(0).toLowerCase().contains(action.toLowerCase()) && TempCounter < 5){
  156. location = Calculations.tileToScreen(tile);
  157. moveMouse(location, 8,8);
  158. TempCounter++;
  159. }
  160. if(getMenuItems().get(0).toLowerCase().contains(action.toLowerCase())) {
  161. clickMouse(true);
  162. }
  163. else {
  164. clickMouse(false);
  165. atMenu(action);
  166. }
  167. wait(random(5, 10));
  168. return true;
  169. } catch (Exception e) {
  170. return false;
  171. }
  172. }
  173.  
  174. public void Release() {
  175. boolean release = false;
  176. for (int i = 0; i < 27; i++) {
  177. for (int element : ReleaseSalamander) {
  178. if (element == getInventoryItems()[i].getID()) {
  179. release = true;
  180.  
  181. }
  182. }
  183. if (release) {
  184. atInventoryItem(getInventoryItems()[i].getID(), "Release Re");
  185. wait(random(5, 10));
  186. if(!inventoryContains(10147)) {
  187. release = false;
  188. }
  189. }
  190. }
  191. }
  192.  
  193.  
  194.  
  195. public int loop( ) {
  196. if (!isRunning() && getEnergy() > random(5, 10)) {
  197. setRun(true);
  198. }
  199. if(inventoryContains(10147)) {
  200. atInventoryItem(10147, "Release");
  201. }
  202.  
  203. RSItemTile rope=getGroundItemByID(Rope);
  204. if(rope != null && !isInventoryFull()) {
  205. atTileTake(rope,"Take");
  206. wait(random(5,10));
  207.  
  208. }
  209. RSItemTile net=getGroundItemByID(Net);
  210. if(net != null && !isInventoryFull()) {
  211. atTileTake(net,"Take");
  212. wait(random(5,10));
  213. ;
  214. }
  215.  
  216. if(distanceTo(HunterTile) >= 5) {
  217. walkTileMM(HunterTile);
  218. wait(random(5,10));
  219. }
  220.  
  221.  
  222. if (getMyPlayer().getAnimation() == 5215) {
  223. ;
  224. }
  225.  
  226. if (getMyPlayer().isMoving()) { return 800; }
  227.  
  228.  
  229. if (isInventoryFull()) {
  230.  
  231. Release();
  232. }
  233.  
  234. RSObject CaughtSalamander = findObject(19659);
  235.  
  236. if (CaughtSalamander != null && distanceTo(CaughtSalamander.getLocation()) <= 6) {
  237.  
  238. wait(random(5,10));
  239. atObject(CaughtSalamander, "Check Net");
  240. wait(random(5,10));
  241.  
  242.  
  243.  
  244. }
  245. RSObject YoungTree = findObject(19663);
  246.  
  247.  
  248. if (YoungTree != null && distanceTo(YoungTree.getLocation()) <= 6) {
  249. wait(random(5,10));
  250. atObject(YoungTree, "Set-trap You");
  251. wait(random(5,10));
  252.  
  253. }
  254.  
  255.  
  256. return random(5,10);
  257. }
  258. }
Add Comment
Please, Sign In to add comment