Advertisement
Guest User

Untitled

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