Guest User

Untitled

a guest
Oct 19th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.32 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 = "kNatureCrafter", 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. boolean outOfVillage;
  39.  
  40.  
  41. public boolean onStart()
  42. {
  43. log("Welcome to the Test.");
  44. outOfVillage = false;
  45. return true;
  46. }
  47.  
  48. private void doDeposit()
  49. {
  50. log("doing banking");
  51. bank.open();
  52. sleep(random(2000,3500));
  53. bank.depositAll();
  54. sleep(random(2000, 3500));
  55. bank.withdraw(pureEssID, 28);
  56. sleep(random(2000, 3500));
  57. bank.close();
  58. sleep(random(2000, 3500));
  59. walkToGate();
  60. }
  61.  
  62. private void walkToGate()
  63. {
  64. RSWeb pitPath = web.getWeb(getMyPlayer().getLocation(), innerGateTile);
  65. log("walking to pit");
  66. if (pitPath != null)
  67. {
  68. pitPath.step();
  69.  
  70. }
  71. if (calc.distanceTo(walking.getDestination()) <= 4)
  72. {
  73. log("At gate");
  74. openGate();
  75. }
  76. }
  77.  
  78. private void openGate()
  79. {
  80. outOfVillage = true;
  81. sleep(random(2000,3000));
  82. log("at gate");
  83. RSObject gate1 = objects.getNearest(gate1ID);
  84. gate1.doAction("Open");
  85. sleep(random(1000, 2500));
  86. RSObject gate2 = objects.getNearest(gate2ID);
  87. gate2.doAction("Open");
  88. sleep(random(1000, 2500));
  89. RSObject cart = objects.getNearest(cartID);
  90. cart.doAction("Search");
  91. sleep(random(1000, 2000));
  92. }
  93.  
  94. private void walkToAltar()
  95. {
  96. RSWeb pitPath = web.getWeb(getMyPlayer().getLocation(), altarTile);
  97. log("walking to pit");
  98. if (pitPath != null)
  99. {
  100. pitPath.step();
  101.  
  102. }
  103. if (calc.distanceTo(walking.getDestination()) <=3)
  104. {
  105. enterAltar();
  106. }
  107. }
  108. private void enterAltar()
  109. {
  110. RSObject outerAltar = objects.getNearest(outerAltarID);
  111. outerAltar.doClick();
  112. sleep(random(1500,2500));
  113. camera.setPitch(false);
  114. sleep(random(450,800));
  115. RSObject innerAltar = objects.getNearest(innerAltarID);
  116. innerAltar.doAction("Craft-rune");
  117. sleep(random(3000,4000));
  118. camera.setPitch(true);
  119. sleep(random(450,800));
  120. walkToExit();
  121. }
  122.  
  123. private void walkToExit()
  124. {
  125. RSWeb pitPath = web.getWeb(getMyPlayer().getLocation(), exitPortalTile);
  126. log("walking to pit");
  127. if (pitPath != null)
  128. {
  129. pitPath.step();
  130.  
  131. }
  132. if (calc.distanceTo(walking.getDestination()) <=2)
  133. {
  134. RSObject exitPortal = objects.getNearest(exitPortalID);
  135. exitPortal.doAction("Enter");
  136. sleep(random(2000,2500));
  137. walkToOuterGate();
  138. }
  139. }
  140.  
  141. private void walkToOuterGate()
  142. {
  143. RSWeb pitPath = web.getWeb(getMyPlayer().getLocation(), outerGateTile);
  144. log("walking to pit");
  145. if (pitPath != null)
  146. {
  147. pitPath.step();
  148.  
  149. }
  150. if (calc.distanceTo(walking.getDestination()) <=3)
  151. {
  152. enterVillage();
  153. }
  154. }
  155.  
  156. private void enterVillage()
  157. {
  158. RSNPC rei = npcs.getNearest(mosolRei);
  159. rei.doAction("Talk-to");
  160. interfaces.clickContinue();
  161. sleep(random(400,850));
  162. interfaces.clickContinue();
  163. sleep(random(400,850));
  164. interfaces.clickContinue();
  165. sleep(random(400,850));
  166. mouse.click(226,406,true);
  167. sleep(random(400,850));
  168. interfaces.clickContinue();
  169. sleep(random(400,850));
  170. walkToBank();
  171. }
  172.  
  173. private void walkToBank()
  174. {
  175. RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), Bank);
  176. log("walking to bank.");
  177. if (walkWeb != null)
  178. {
  179. walkWeb.step();
  180. }
  181. if (calc.distanceTo(walking.getDestination()) <=4)
  182. {
  183. doDeposit();
  184. }
  185. }
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. public void onFinish()
  196. {
  197. log("Thank you for using Test.");
  198. }
  199. @Override
  200.  
  201. public int loop() {
  202.  
  203. if(inventory.getCount(pureEssID) == 28 && outOfVillage == false)
  204. {
  205. walkToGate();
  206. }
  207.  
  208. return (random(2000, 3000));
  209. }
  210. }
Add Comment
Please, Sign In to add comment