Guest User

Untitled

a guest
Oct 19th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.04 KB | None | 0 0
  1. import org.rsbot.script.Script;
  2.  
  3. import org.rsbot.script.ScriptManifest;
  4.  
  5. import java.awt.event.KeyEvent;
  6. import java.util.Map;
  7.  
  8. import org.rsbot.script.methods.Skills;
  9. import org.rsbot.script.wrappers.RSArea;
  10. import org.rsbot.script.wrappers.RSNPC;
  11. import org.rsbot.script.wrappers.RSObject;
  12. import org.rsbot.script.wrappers.RSTile;
  13. import org.rsbot.script.wrappers.RSWeb;
  14.  
  15. @ScriptManifest(authors = "CravenKnight", name = "ckMagicGlass", version = 1.0, description = "Hahaha")
  16.  
  17. public class KNatureCrafter extends Script {
  18.  
  19. RSTile Bank = new RSTile(2852, 2954);
  20. RSTile innerGateTile = new RSTile(2866, 2952);
  21. RSTile outerGateTile = new RSTile(2880,2952);
  22. RSTile altarTile = new RSTile(2868, 3017);
  23. RSTile exitPortalTile = new RSTile(2400, 4835);
  24.  
  25. int natureRuneID = 561;
  26. int pureEssID = 7936;
  27.  
  28. int gate1ID = 2261;
  29. int gate2ID = 2259;
  30. int cartID = 2216;
  31.  
  32. int outerAltarID = 2460;
  33. int innerAltarID = 2486;
  34. int exitPortalID = 2473;
  35.  
  36. int mosolRei = 500;
  37.  
  38.  
  39. public boolean onStart()
  40. {
  41. log("Welcome to the Test.");
  42. return true;
  43. }
  44.  
  45. private void doDeposit()
  46. {
  47. log("doing banking");
  48. bank.open();
  49. bank.depositAll();
  50. sleep(random(100, 350));
  51. bank.withdraw(natureRuneID, 28);
  52. sleep(random(50, 200));
  53. bank.close();
  54. sleep(random(100, 350));
  55. walkToGate();
  56. }
  57.  
  58. private void walkToGate()
  59. {
  60. RSWeb pitPath = web.getWeb(getMyPlayer().getLocation(), innerGateTile);
  61. log("walking to pit");
  62. if (pitPath != null)
  63. {
  64. pitPath.step();
  65.  
  66. }
  67. if (calc.distanceTo(walking.getDestination()) <=3)
  68. {
  69. openGate();
  70. }
  71. }
  72.  
  73. private void openGate()
  74. {
  75. RSObject gate1 = objects.getNearest(gate1ID);
  76. gate1.doAction("Open");
  77. sleep(random(1000, 2500));
  78. RSObject gate2 = objects.getNearest(gate2ID);
  79. gate2.doAction("Open");
  80. sleep(random(1000, 2500));
  81. RSObject cart = objects.getNearest(cartID);
  82. cart.doAction("Search");
  83. sleep(random(1000, 2000));
  84. }
  85.  
  86. private void walkToAltar()
  87. {
  88. RSWeb pitPath = web.getWeb(getMyPlayer().getLocation(), altarTile);
  89. log("walking to pit");
  90. if (pitPath != null)
  91. {
  92. pitPath.step();
  93.  
  94. }
  95. if (calc.distanceTo(walking.getDestination()) <=3)
  96. {
  97. enterAltar();
  98. }
  99. }
  100. private void enterAltar()
  101. {
  102. RSObject outerAltar = objects.getNearest(outerAltarID);
  103. outerAltar.doClick();
  104. sleep(random(1500,2500));
  105. camera.setPitch(false);
  106. sleep(random(450,800));
  107. RSObject innerAltar = objects.getNearest(innerAltarID);
  108. innerAltar.doAction("Craft-rune");
  109. sleep(random(3000,4000));
  110. camera.setPitch(true);
  111. sleep(random(450,800));
  112. walkToExit();
  113. }
  114.  
  115. private void walkToExit()
  116. {
  117. RSWeb pitPath = web.getWeb(getMyPlayer().getLocation(), exitPortalTile);
  118. log("walking to pit");
  119. if (pitPath != null)
  120. {
  121. pitPath.step();
  122.  
  123. }
  124. if (calc.distanceTo(walking.getDestination()) <=2)
  125. {
  126. RSObject exitPortal = objects.getNearest(exitPortalID);
  127. exitPortal.doAction("Enter");
  128. sleep(random(2000,2500));
  129. walkToOuterGate();
  130. }
  131. }
  132.  
  133. private void walkToOuterGate()
  134. {
  135. RSWeb pitPath = web.getWeb(getMyPlayer().getLocation(), outerGateTile);
  136. log("walking to pit");
  137. if (pitPath != null)
  138. {
  139. pitPath.step();
  140.  
  141. }
  142. if (calc.distanceTo(walking.getDestination()) <=3)
  143. {
  144. enterVillage();
  145. }
  146. }
  147.  
  148. private void enterVillage()
  149. {
  150. RSNPC rei = npcs.getNearest(mosolRei);
  151. rei.doAction("Talk-to");
  152. interfaces.clickContinue();
  153. sleep(random(400,850));
  154. interfaces.clickContinue();
  155. sleep(random(400,850));
  156. interfaces.clickContinue();
  157. sleep(random(400,850));
  158. mouse.click(226,406,true);
  159. sleep(random(400,850));
  160. interfaces.clickContinue();
  161. sleep(random(400,850));
  162. walkToBank();
  163. }
  164.  
  165. private void walkToBank()
  166. {
  167. RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), Bank);
  168. log("walking to bank.");
  169. if (walkWeb != null)
  170. {
  171. walkWeb.step();
  172. }
  173. if (calc.distanceTo(walking.getDestination()) <=4)
  174. {
  175. doDeposit();
  176. }
  177. }
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187. public void onFinish()
  188. {
  189. log("Thank you for using Test.");
  190. }
  191. @Override
  192.  
  193. public int loop() {
  194.  
  195.  
  196.  
  197. return (random(2000, 3000));
  198. }
  199. }
Add Comment
Please, Sign In to add comment