Guest User

Untitled

a guest
Jun 21st, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.47 KB | None | 0 0
  1. package com.scripts;
  2.  
  3. import com.kbot2.scriptable.Script;
  4. import com.kbot2.scriptable.methods.wrappers.*;
  5.  
  6.  
  7.  
  8. public class EssenceMiner extends Script {
  9. /*Path*/
  10. Tile[] fromBanktoMiddle = {new Tile(3253, 3420), new Tile(3258, 3410)};
  11. Tile[] fromMiddletoAubury = {new Tile(3258, 3410), new Tile(3253, 3401)};
  12. Tile[] fromAuburytoBank = {new Tile(3253, 3401), new Tile(3258, 3410), new Tile(3253, 3420)};
  13.  
  14. /*Define*/
  15. NPC aubury;
  16. Obj essence;
  17. Obj port;
  18. Obj b;
  19.  
  20. /*ID's*/
  21. int AUBURY_ID = 553;
  22. final int ESSENCE_ID = 2491;
  23. int PORTAL_ID = 2492;
  24. int BANK_ID = 11402;
  25. int status = 0;
  26.  
  27. @Override
  28. public boolean active() {
  29. return true;
  30. }
  31.  
  32. public String getName() {
  33. return "EssenceMiner";
  34. }
  35.  
  36. @Override
  37. public String getAuthor() {
  38. return "SuperTaranta";
  39. }
  40.  
  41. @Override
  42. public String getDescription() {
  43. return "Essence Miner";
  44. }
  45. @Override
  46. public boolean onStart() {
  47. log("Starting SuperTaranta's GayClub");
  48. return true;
  49. }
  50.  
  51.  
  52. public int loop() {
  53. if (!isLoggedIn()) {
  54. return random(1000, 1100);
  55. }
  56. if(walking.getEnergy() > 30)
  57. walking.setRunning(true);
  58. switch (status) {
  59.  
  60.  
  61.  
  62. case 0:
  63. if (inventory.isFull()) {
  64. status = 6;
  65. } else {
  66. status = 1;
  67. }
  68. return random(300, 500);
  69. case 1:
  70. // From Bank To Aubury
  71. log("Walking from Bank to Middle");
  72. walking.walkPath(fromBanktoMiddle);
  73. while(getMyPlayer().isMoving())
  74. sleep(100);
  75. status = 2;
  76. return random(150, 300);
  77. case 2:
  78. // From Bank To Aubury
  79. log("Walking from Middle to Aubury");
  80. walking.walkPath(fromMiddletoAubury);
  81. while(getMyPlayer().isMoving())
  82. sleep(100);
  83. status = 3;
  84. return random(150, 300);
  85.  
  86. case 3:
  87. //Teleport
  88. aubury = npcs.getClosest(20, AUBURY_ID);
  89. log("Teleporting");
  90. if (aubury != null) {
  91. aubury.doAction("Teleport");
  92. sleep(100);
  93. status = 2;
  94. } else {
  95. status = 4;
  96. return random(150,300);
  97. }
  98. case 4:
  99. //Find and Mine the Essence
  100. log("Looking and Mining Essence");
  101. essence = objects.getClosestObject(10, ESSENCE_ID);
  102.  
  103. if (essence != null) {
  104. essence.doAction("Mine");
  105. if(inventory.isFull()){
  106. sleep(100);
  107. status = 5;
  108. }
  109.  
  110. } else {
  111. log("Shit can't find ess");
  112. //whatever you want to do to find ess
  113. walking.objects.getClosestObject(30, ESSENCE_ID);
  114. sleep(100);
  115. return random(150, 300);
  116. }
  117. case 5:
  118. //Find Portal
  119. port = objects.getClosestObject(15, PORTAL_ID);
  120. log("Inventory full, looking for portal");
  121. if (inventory.isFull()) {
  122. port.doAction("Use");
  123. status = 6;
  124. } else {
  125. status = 4;
  126. return random(150, 300);
  127. }
  128. case 6:
  129. // From Aubury To Bank
  130. log("Walking from Aubury to Bank");
  131. walking.walkPath(fromAuburytoBank);
  132. while(getMyPlayer().isMoving())
  133. sleep(100);
  134. status = 7;
  135. return random(150, 300);
  136. case 7:
  137. // Check Bank
  138. b = getClosestObject(7, BANK_ID);
  139. log("Checking/Opening Bank");
  140. while (!bank.isOpen()) {
  141. if (b != null)
  142. b.doAction("Use-quickly");
  143. sleep(750, 1000);
  144. }
  145. status = 8;
  146. return random(150, 300);
  147. case 8:
  148. // Banking
  149. log("Banking");
  150. if (!bank.isOpen()) {
  151. status = 7;
  152. return 100;
  153. }
  154. while (inventory.getCount() > 1) {
  155. bank.depositAll(1436);
  156. }
  157. bank.close();
  158. sleep(350, 500);
  159. if (bank.isOpen())
  160. bank.close();
  161. status = 0;
  162. return random(150, 300);
  163. }
  164.  
  165. return random(100, 300);
  166. }
  167.  
  168.  
  169. }
Add Comment
Please, Sign In to add comment