Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. import org.rsbot.script.Script;
  2. import org.rsbot.script.ScriptManifest;
  3. import org.rsbot.script.wrappers.RSObject;
  4. import org.rsbot.script.wrappers.RSTile;
  5. import org.rsbot.script.wrappers.RSWeb;
  6.  
  7. @ScriptManifest(
  8. authors = ("Qubiz"),
  9. version = 1.11,
  10. keywords = {"Qubiz", "Cosmic", "Runes", "Runecrafting"},
  11. description = "Crafts cosmic runes. Made by Qubiz.",
  12. name = "qCosmicCrafter")
  13.  
  14. /* What does this bot do:
  15. *
  16. * The bot walks to the cosmic altar to craft cosmic runes (eventually by using pouches), and then banks them at the local bank in Zanaris.
  17. * When your agility level is 1 to 46 it will use the normal route, when your agility level is 46 to 66 it will use the second route, when your
  18. * level is 66 or higher it will use the third route (fastest route).
  19. * It will be supporting the talisman and the tiara.
  20. * The bot should stop when all of the pure essence is used, or when the user stops the bot (obviously).
  21. *
  22. */
  23.  
  24.  
  25. public class qCosmicCrafter extends Script {
  26.  
  27. ////////////Variables////////////
  28. //items//
  29. int cosmicID = 564;
  30. int cosmicTiaraID = 5539;
  31. int cosmicTalismanID = 1454;
  32. int pureEssID = 7936;
  33.  
  34. //objects//
  35. int cosmicAltarOutsideID = 2458;
  36. int cosmicAltarInsideID = 2484;
  37. int boothID = 52589;
  38. int portalID = 2471;
  39.  
  40. RSObject altar = objects.getNearest(cosmicAltarOutsideID);
  41.  
  42. //tiles//
  43.  
  44. RSTile altarTile = new RSTile(2407,4379,0);
  45. RSTile insideAltarTile = new RSTile (0,0,0);
  46. RSTile bankTile = new RSTile(2381,4458,0);
  47.  
  48. //time//
  49. long startTime;
  50. /////////////////////////////////
  51.  
  52.  
  53. public boolean onStart() {
  54. log("The bot started doing his stuff!");
  55. startTime = System.currentTimeMillis();
  56. return true;
  57. }
  58.  
  59. // private boolean atBank() {
  60. // RSObject bank = objects.getNearest(boothID);
  61. // if (bank.isOnScreen()) {
  62. // return true;
  63. // } else { return false; }
  64. // }
  65.  
  66. private boolean atAltar() {
  67. if (altar.isOnScreen()) {
  68. return true;
  69. } else { return false; }
  70. }
  71.  
  72. // private void useAltar() {
  73. // if (altar.isOnScreen()) {
  74. // altar.doClick();
  75. // }
  76. // }
  77.  
  78. // private void bank() {
  79. // if(inventory.contains(cosmicID) && atBank() == true) {
  80. // bank.open();
  81. // if (bank.isOpen()) {
  82. // sleep(50);
  83. // bank.depositAll();
  84. // sleep(random(1000, 1500));
  85. // bank.close();
  86. // }
  87. // }
  88. // }
  89.  
  90. // private void setRun() {
  91. // if (walking.getEnergy()> random(30,100)) {
  92. // walking.setRun(true);
  93. // sleep(random(700,800));
  94. // }
  95. // }
  96.  
  97. // private void walkToAltar() {
  98. // if (inventory.contains(pureEssID) && atBank() == true) {
  99. // RSWeb walkWeb = web.getWeb(altarTile);
  100. // if (walkWeb != null && !walkWeb.finished()) {
  101. // walkWeb.step();
  102. // if (calc.distanceTo(altarTile) <= 6) {
  103. // useAltar();
  104. // }
  105. // }
  106. // }
  107. // }
  108.  
  109. private void walkToBank() {
  110. if (inventory.contains(cosmicID)) {
  111. RSWeb walkWeb = web.getWeb(bankTile);
  112. walkWeb.step();
  113. }
  114. }
  115.  
  116.  
  117. public void onFinish() {
  118. log("The bot finished doing his stuff.");
  119. }
  120.  
  121.  
  122. @Override
  123. public int loop() {
  124. walkToBank();
  125. return random(300, 500);
  126. }
  127.  
  128. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement