Guest User

Untitled

a guest
Dec 11th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.67 KB | None | 0 0
  1. //PLEASE DONT STEAL MY SCRIPT, IN THE FORUM IT EXPLAINS WHAT USERS MAY DO TO EDIT THIS, OTHER THAN THAT PLEASE DONT CANNIBALIZE!!! ENJOY!
  2. import org.rsbot.script.ScriptManifest;
  3. import org.rsbot.script.Script;
  4. import java.awt.*;
  5. import javax.imageio.ImageIO;
  6. import java.io.IOException;
  7. import java.net.URL;
  8. import org.rsbot.event.events.MessageEvent;
  9. import org.rsbot.event.listeners.PaintListener;
  10. import org.rsbot.script.methods.Skills;
  11. import org.rsbot.script.methods.Game;
  12. import org.rsbot.script.methods.*;
  13. import org.rsbot.script.wrappers.RSNPC;
  14. import org.rsbot.script.wrappers.RSObject;
  15. import org.rsbot.script.wrappers.RSTile;
  16. import org.rsbot.script.wrappers.RSWeb;
  17. import org.rsbot.script.methods.Walking;
  18. import org.rsbot.script.wrappers.RSGroundItem;
  19. import org.rsbot.script.wrappers.RSItem;
  20. import java.awt.event.MouseEvent;
  21. import java.awt.event.MouseListener;
  22. import org.rsbot.script.ScriptManifest;
  23. import org.rsbot.script.Script;
  24. import java.awt.*;
  25. import javax.imageio.ImageIO;
  26. import java.io.IOException;
  27. import java.net.URL;
  28. import org.rsbot.event.events.MessageEvent;
  29. import org.rsbot.event.listeners.MessageListener;
  30. import org.rsbot.script.util.Timer;
  31. import org.rsbot.script.wrappers.*;
  32. import java.awt.event.MouseEvent;
  33. import java.awt.event.MouseListener;
  34. import org.rsbot.script.wrappers.RSComponent;
  35.  
  36. @ScriptManifest(authors={"Nightfox"}, keywords={"Citadel"}, name="NightRooter", description="Chops roots in clan citadel", version=99.0)
  37. public class NightRooter extends Script implements PaintListener, MessageListener {
  38.  
  39.  
  40. int Roots1 = 18921;
  41. int Roots2 = 18920;
  42. int Roots3 = 18907;
  43. int Roots4 = 18901;
  44. int Roots5 = 18883;
  45. int Roots6 = 18874;
  46. private String status = "Loading...";
  47. private int gainedExp0;
  48. private int gainedLevel;
  49. public int f = 0;
  50. public int d = 0;
  51. public int p = 0;
  52. public long startTime = 0;
  53. public long millis = 0;
  54. public long hours = 0;
  55. public long minutes = 0;
  56. public long seconds = 0;
  57. public long last = 0;
  58. public int rootCut = 0;
  59. private int startExp = 0;
  60. public int expGained = 0;
  61. public int expHour = 0;
  62. public int expTNL = 0;
  63. public int rootshour = 0;
  64. public int rootsTNL;
  65. public int currLevel;
  66. public int startLevel;
  67. public int lvlsGained;
  68. private int percentTNL;
  69. public int findme = 0;
  70. private Timer GetRecourceCount = new Timer(100);
  71. public boolean onStart() {
  72. log("Welcome to NightFox's Root Cutter!");
  73. log.warning("WARNING may get you kicked out of clan, enjoy!");
  74. keyboard.sendText("Im going to max out my resource cap, so no one bother me......;)", true);
  75. startTime = System.currentTimeMillis();
  76. startExp = skills.getCurrentExp(skills.WOODCUTTING);
  77. startLevel = skills.getCurrentLevel(skills.WOODCUTTING);
  78. log("Loading Is Complete");
  79. log("Thanks For Choosing Nightfox's Root Cutter");
  80. log("Please Leave Comments In The Forum, Ejoy!");
  81. keyboard.sendText("my woodcutting lvl is " +startLevel + "!", true);
  82. return true;
  83. }
  84. public int loop() {
  85. checkRecource();
  86. RootCut();
  87. sleep(3500);
  88. RootCut1();
  89. sleep(3500);
  90. RootCut2();
  91. sleep(3500);
  92. RootCut3();
  93. sleep(3500);
  94. RootCut4();
  95. sleep(3500);
  96. RootCut5();
  97. sleep(3500);
  98. sleep(3500);
  99. sleep(3500);
  100. return (random(800, 1300));
  101. }
  102.  
  103. private boolean RootCut() {
  104. status = "Finding Root #1";
  105. if (getMyPlayer().getAnimation() == 5781) {
  106. sleep(3500);
  107. sleep(3500);
  108. sleep(3500);
  109. }else{
  110. mouse.setSpeed(3);
  111. if (getMyPlayer().getAnimation() == -1) {
  112. RSObject root = objects.getNearest(Roots1);
  113. if (root != null) {
  114. if (calc.tileOnScreen(root.getLocation())) {
  115. if (getMyPlayer().getInteracting() == null)
  116. root.doAction("Chop");
  117. status = "Chopping";
  118. rootCut++;
  119. sleep(2000);
  120. sleep(3500);
  121. sleep(3500);
  122. return true;
  123. } else if (!calc.tileOnScreen(root.getLocation())) {
  124. walking.walkTo(root.getLocation());
  125. return false;
  126. }
  127. }
  128. return true;
  129. }
  130. return false;
  131. }
  132. return false;
  133. }
  134. private boolean RootCut1() {
  135. if (getMyPlayer().getAnimation() == 5781) {
  136. sleep(3500);
  137. }else{
  138. mouse.setSpeed(3);
  139. if (getMyPlayer().getAnimation() == -1) {
  140. RSObject root1 = objects.getNearest(Roots2);
  141. if (root1 != null) {
  142. if (calc.tileOnScreen(root1.getLocation())) {
  143. if (getMyPlayer().getInteracting() == null)
  144. root1.doAction("Chop");
  145. status = "Chopping";
  146. rootCut++;
  147. sleep(2000);
  148. return true;
  149. } else if (!calc.tileOnScreen(root1.getLocation())) {
  150. walking.walkTo(root1.getLocation());
  151. return false;
  152. }
  153. }
  154. return true;
  155. }
  156. return false;
  157. }
  158. return false;
  159. }
  160. private boolean RootCut2() {
  161. if (getMyPlayer().getAnimation() == 5781) {
  162. sleep(3500);
  163. }else{
  164. mouse.setSpeed(3);
  165. if (getMyPlayer().getAnimation() == -1) {
  166. RSObject root2 = objects.getNearest(Roots3);
  167. if (root2 != null) {
  168. if (calc.tileOnScreen(root2.getLocation())) {
  169. if (getMyPlayer().getInteracting() == null)
  170. root2.doAction("Chop");
  171. status = "Chopping";
  172. rootCut++;
  173. sleep(2000);
  174. return true;
  175. } else if (!calc.tileOnScreen(root2.getLocation())) {
  176. walking.walkTo(root2.getLocation());
  177. return false;
  178. }
  179. }
  180. return true;
  181. }
  182. return false;
  183. }
  184. return false;
  185. }
  186. private boolean RootCut3() {
  187. if (getMyPlayer().getAnimation() == 5781) {
  188. sleep(3500);
  189. }else{
  190. mouse.setSpeed(3);
  191. if (getMyPlayer().getAnimation() == -1) {
  192. RSObject root3 = objects.getNearest(Roots4);
  193. if (root3 != null) {
  194. if (calc.tileOnScreen(root3.getLocation())) {
  195. if (getMyPlayer().getInteracting() == null)
  196. root3.doAction("Chop");
  197. status = "Chopping";
  198. rootCut++;
  199. sleep(2000);
  200. return true;
  201. } else if (!calc.tileOnScreen(root3.getLocation())) {
  202. walking.walkTo(root3.getLocation());
  203. return false;
  204. }
  205. }
  206. return true;
  207. }
  208. return false;
  209. }
  210. return false;
  211. }
  212. private boolean RootCut4() {
  213. if (getMyPlayer().getAnimation() == 5781) {
  214. sleep(3500);
  215. }else{
  216. mouse.setSpeed(3);
  217. if (getMyPlayer().getAnimation() == -1) {
  218. RSObject root4 = objects.getNearest(Roots5);
  219. if (root4 != null) {
  220. if (calc.tileOnScreen(root4.getLocation())) {
  221. if (getMyPlayer().getInteracting() == null)
  222. root4.doAction("Chop");
  223. status = "Chopping";
  224. rootCut++;
  225. sleep(2000);
  226. return true;
  227. } else if (!calc.tileOnScreen(root4.getLocation())) {
  228. walking.walkTo(root4.getLocation());
  229. return false;
  230. }
  231. }
  232. return true;
  233. }
  234. return false;
  235. }
  236. return false;
  237. }
  238. private boolean RootCut5() {
  239. if (getMyPlayer().getAnimation() == 5781) {
  240. sleep(3500);
  241. }else{
  242. mouse.setSpeed(3);
  243. if (getMyPlayer().getAnimation() == -1) {
  244. RSObject root5 = objects.getNearest(Roots6);
  245. if (root5 != null) {
  246. if (calc.tileOnScreen(root5.getLocation())) {
  247. if (getMyPlayer().getInteracting() == null)
  248. root5.doAction("Chop");
  249. status = "Starting over";
  250. rootCut++;
  251. sleep(2000);
  252. return true;
  253. } else if (!calc.tileOnScreen(root5.getLocation())) {
  254. walking.walkTo(root5.getLocation());
  255. return false;
  256. }
  257. }
  258. return true;
  259. }
  260. return false;
  261. }
  262. return false;
  263. }
  264. private void checkRecource() {
  265. if(game.isLoggedIn() && !game.isWelcomeScreen()) {
  266. if (GetRecourceCount.isRunning()!=true){
  267. String Recources = interfaces.get(1117).getComponent(122).getText();
  268. log ("Recource Count: " +Recources);
  269. GetRecourceCount.reset();
  270. }
  271. }
  272. }
  273. private void antiBan() {
  274. status = "Antiban";
  275. int r = random(0, 30);
  276. switch(r) {
  277.  
  278. case 1:
  279. mouse.setSpeed(random(6, 9));
  280. mouse.moveSlightly();
  281. mouse.moveSlightly();
  282.  
  283. case 2: // Checking XP Counter
  284. mouse.move(530, 62);
  285. mouse.click(true);
  286.  
  287. case 3:
  288. mouse.moveSlightly();
  289.  
  290. case 7:
  291. mouse.moveRandomly(10, 55);
  292.  
  293. case 16:
  294. mouse.moveOffScreen();
  295.  
  296. case 18:
  297. camera.setAngle(random(200, 350));
  298.  
  299. case 20:
  300. camera.setAngle(random(100, 200));
  301.  
  302. case 26:
  303. game.openTab(1);
  304. skills.doHover(Skills.INTERFACE_WOODCUTTING);
  305. keyboard.sendText("zzzzzzzzzzzzzzzz", true);
  306.  
  307. case 28:
  308. game.openTab(Game.TAB_FRIENDS);//Looks at friends list
  309. game.openTab(Game.TAB_INVENTORY);
  310.  
  311. case 29:
  312. game.openTab(Game.TAB_QUESTS);//Looks at quests tab
  313. game.openTab(Game.TAB_INVENTORY);
  314. keyboard.sendText("ive chopped" +rootCut + "roots", true);
  315. }
  316. }
  317.  
  318. private final Color color1 = new Color(48, 198, 200, 86);
  319. private final Color color2 = new Color(0, 0, 0);
  320. private final BasicStroke stroke1 = new BasicStroke(1);
  321. private final Font font1 = new Font("Arial", 0, 20);
  322. private final Font font2 = new Font("Arial", 0, 10);
  323. public void onRepaint(Graphics g1) {
  324. Graphics2D g = (Graphics2D)g1;
  325.  
  326. int currentLVL = 0;
  327.  
  328. millis = System.currentTimeMillis() - startTime;
  329. hours = millis / (1000 * 60 * 60);
  330. millis -= hours * (1000 * 60 * 60);
  331. minutes = millis / (1000 * 60);
  332. millis -= minutes * (1000 * 60);
  333. seconds = millis / 1000;
  334.  
  335. expHour = (int) ((expGained) * 3600000D / (System.currentTimeMillis() - startTime));
  336. expGained = skills.getCurrentExp(Skills.WOODCUTTING) - startExp;
  337. currLevel = skills.getCurrentLevel(Skills.WOODCUTTING);
  338. lvlsGained = skills.getCurrentLevel(Skills.WOODCUTTING) - startLevel;
  339. rootshour = (int) ((rootCut) * 3600000D / (System.currentTimeMillis() - startTime));
  340.  
  341. g.setColor(color1);
  342. g.fillRoundRect(6, 4, 223, 219, 16, 16);
  343. g.setColor(color2);
  344. g.setStroke(stroke1);
  345. g.drawRoundRect(6, 4, 223, 219, 16, 16);
  346. g.setFont(font1);
  347. g.drawString("Night's Root Cutter", 47, 30);
  348. g.setFont(font2);
  349. g.drawString("Roots Cut: ", 20, 52);
  350. g.drawString("Roots P/H: ", 20, 67);
  351. g.drawString("WoodCutting Lvl: ", 20, 87);
  352. g.drawString("Levels Gained: ", 20, 100);
  353. g.drawString("XP gained: ", 20, 111);
  354. g.drawString("XP P/H: ", 20, 122);
  355. g.drawString("Status: " + status, 20, 158);
  356. g.drawString("Time running: " + hours + ": " + minutes + ": " + seconds, 20, 138);
  357. g.drawString("" + rootCut, 120, 52);
  358. g.drawString("" + rootshour, 120, 67);
  359. g.drawString("" + currLevel, 120, 87);
  360. g.drawString("" + lvlsGained, 120, 100);
  361. g.drawString("" + expGained, 120, 111);
  362. g.drawString("" + expHour, 120, 122);
  363.  
  364. g.setColor(Color.black);
  365. g.drawLine(0, (int)(mouse.getLocation().getY()), 800, (int)(mouse.getLocation().getY()));
  366. g.drawLine((int)(mouse.getLocation().getX()), 0, (int)(mouse.getLocation().getX()), 800);
  367. g.setColor(Color.orange);
  368. g.drawLine(0, (int)(mouse.getLocation().getY()) +1, 800, (int)(mouse.getLocation().getY())+1);
  369. g.drawLine((int)(mouse.getLocation().getX()) +1, 0, (int)(mouse.getLocation().getX())+1, 800);
  370. g.setColor(Color.red);
  371. g.drawLine(0, (int)(mouse.getLocation().getY()) +2, 800, (int)(mouse.getLocation().getY())+2);
  372. g.drawLine((int)(mouse.getLocation().getX()) +2, 0, (int)(mouse.getLocation().getX())+2, 800);
  373.  
  374. }
  375. @Override
  376. public void messageReceived(MessageEvent e){
  377. String txt = e.getMessage();
  378. if(txt.contains("You have reached your resource cap")){
  379. log.warning("Thank You For Using Nightfox's Scripts!");
  380. stopScript();
  381. }else{
  382. if(txt.contains("You have reached your resource cap")){
  383. log.warning("Thank You For Using Nightfox's Scripts!");
  384. stopScript();
  385. }
  386. }
Add Comment
Please, Sign In to add comment