Guest User

Untitled

a guest
Jul 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.58 KB | None | 0 0
  1. import java.awt.*;
  2. import java.util.*;
  3. import java.util.List;
  4. import java.util.logging.Level;
  5. import javax.accessibility.*;
  6. import javax.swing.*;
  7.  
  8. import org.rsbot.bot.Bot;
  9. import org.rsbot.script.*;
  10. import org.rsbot.script.wrappers.*;
  11. import org.rsbot.script.wrappers.RSNPC;
  12. import org.rsbot.script.wrappers.RSObject;
  13. import org.rsbot.accessors.*;
  14. import org.rsbot.event.listeners.ServerMessageListener;
  15. import org.rsbot.event.events.ServerMessageEvent;
  16. import org.rsbot.util.ScreenshotUtil;
  17.  
  18.  
  19.  
  20.  
  21. @ScriptManifest(authors = { "dpedroia15" }, category = "Other", name = "EctoFunk Slimer", version = 1.00, description = "<html><head></head><body>Script description here.</body></html\n")
  22.  
  23. public class EctoFunkSlimer extends Script {
  24. private final ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
  25.  
  26.  
  27. public boolean onStart(Map<String, String> args) {
  28. return true;
  29. }
  30. //Enum
  31. private final int TELEPORTTO = 1;
  32. private final int LADDERONE = 2;
  33. private final int LADDERTWO = 3;
  34. private final int LADDERTHREE = 4;
  35. private final int LADDERFOUR = 5;
  36. private final int FILLBUCKETS = 6;
  37. private final int WALKTOBANK = 9;
  38. private final int OPENBANK = 10;
  39. private final int BANK = 11;
  40. private int ACTION = WALKTOBANK;
  41.  
  42. //Random
  43. public int talk = 0;
  44. private int failCount = 0;
  45.  
  46.  
  47. //Items
  48. public int ectophial = 4251;
  49. public int bucket = 1925;
  50. public int bucketOfSlime = 4286;
  51.  
  52. public int Energy = random(50, 67);
  53.  
  54. //Tiles
  55. public RSTile bankTile = new RSTile(3688, 3466);
  56. public RSTile altarFromEctophial = new RSTile(3659, 3522);
  57. public RSTile ladderOneAbove = new RSTile(3654, 3519);
  58. public RSTile ladderOneBelow = new RSTile(3669, 9888);
  59. public RSTile ladderTwoAbove = new RSTile(3692, 9888);
  60. public RSTile ladderTwoBelow = new RSTile(3688, 9888);
  61. public RSTile ladderThreeAbove = new RSTile(3671, 9888);
  62. public RSTile ladderThreeBelow = new RSTile(3675, 9888);
  63. public RSTile ladderFourAbove = new RSTile(3687, 9888);
  64. public RSTile ladderFourBelow = new RSTile(3683, 9888);
  65. public RSTile portalAfter = new RSTile(3659, 3507);
  66. public RSTile portalBefore = new RSTile(3658, 3509);
  67.  
  68. //NPCS
  69. public int ghostGuard = 1706;
  70. public int banker = 1702;
  71. //Paths
  72. public RSTile portalToBank[] = {new RSTile(3661, 3493), new RSTile(3673, 3486), new RSTile(3681, 3477), new RSTile(3687, 3466)};
  73. public RSTile ladderOneBelowToLadderTwoAbove[] = {new RSTile(3674, 9876), new RSTile(3689, 9879)};
  74.  
  75. //Objects
  76. final int laddderOneAboveClosed = 5267;
  77. final int laddderOneAboveOpen = 5268;
  78. final int laddderOneBelow = 5264;
  79. final int laddderTwoAbove = 5263;
  80. final int laddderTwoBelow = 5262;
  81. final int laddderThreeAbove = 5263;
  82. final int laddderThreeBelow = 5262;
  83. final int laddderFourAbove = 5263;
  84. final int laddderFourBelow = 5262;
  85. final int poolOfSlime = 17119;
  86.  
  87. public int loop() {
  88. try {
  89. getDemBuckets(false);
  90. } catch (Exception e) { }
  91.  
  92. return random(50,150);
  93. }
  94.  
  95. private void getDemBuckets(boolean abyssal) {
  96. int randomTile = random(0,5);
  97. if (abyssal) {
  98.  
  99. } else {
  100. if (ACTION == TELEPORTTO){
  101. atInventoryItem(ectophial,"Empty");
  102. wait(random(400,800));
  103. ACTION = LADDERONE;
  104. failCount = 0;
  105. return;
  106. }
  107. if (ACTION == LADDERONE){
  108. {
  109. if ((getInventoryCount(bucket)) > 0) {
  110. wait(random(800,1200));
  111. atObject((getNearestObjectByID(laddderOneAboveOpen)),"Climb-down");
  112. ACTION = LADDERTWO;
  113. failCount = 0;
  114. return;
  115. }
  116. else
  117. ACTION = WALKTOBANK;
  118. failCount = 0;
  119. return;
  120. }
  121. }
  122. if ((getNearestObjectByID(laddderOneAboveClosed)) != null) {
  123. final RSObject ladder = (getNearestObjectByID(laddderOneAboveClosed));
  124. atObject(ladder,"Open");
  125. wait(random(400,800));
  126. return;
  127. }
  128. return;
  129.  
  130. }
  131. if (ACTION == LADDERTWO){
  132. {
  133. if ((getInventoryCount(bucket)) > 0){
  134. atObject((getNearestObjectByID(laddderTwoAbove)),"Climb-down");
  135. ACTION = LADDERTHREE;
  136. failCount = 0;
  137. return;
  138. }
  139. else
  140. ACTION = TELEPORTTO;
  141. failCount = 0;
  142. return;
  143. }
  144. }
  145. if (ACTION == LADDERTHREE) {
  146. {
  147. if ((getInventoryCount(bucket)) > 0){
  148. atObject((getNearestObjectByID(laddderThreeAbove)), "Climb-down");
  149. ACTION = LADDERFOUR;
  150. failCount = 0;
  151. return;
  152. }
  153. else
  154. ACTION = TELEPORTTO;
  155. failCount = 0;
  156. return;
  157. }
  158. }
  159. if (ACTION == LADDERFOUR){
  160. {
  161. if((getInventoryCount(bucket)) > 0) {
  162. if((getNearestObjectByID(laddderFourAbove)) == null) {
  163. final RSTile ladderfour = getNearestObjectByID(laddderFourAbove).getLocation();
  164. walkTo(ladderfour);
  165. if((getNearestObjectByID(laddderFourAbove)) != null)
  166. atObject((getNearestObjectByID(laddderFourAbove)), "Climb-Down");
  167. ACTION = FILLBUCKETS;
  168. failCount = 0;
  169. return;
  170. }
  171. else
  172. ACTION = TELEPORTTO;
  173. failCount = 0;
  174. return;
  175. }
  176.  
  177. }
  178. if (ACTION == FILLBUCKETS) {
  179. {
  180. if((getInventoryCount(bucket)) > 0) {
  181. atInventoryItem(bucket, "Use");
  182. atObject((getNearestObjectByID(poolOfSlime)),"-> Pool of Slime");
  183. }
  184. else
  185. ACTION = TELEPORTTO;
  186. failCount = 0;
  187. return;
  188. }
  189. }
  190. return;
  191. }
  192. if (ACTION == WALKTOBANK) {
  193. if((getInventoryCount(bucket)) > 0) {
  194. ACTION = TELEPORTTO;
  195. failCount = 0;
  196. return;
  197. }
  198. if((getInventoryCount(bucketOfSlime)) > 0) {
  199. if ((distanceTo(altarFromEctophial)) > 13) {
  200. walkPathMM(portalToBank);
  201. {
  202. if (distanceTo(getDestination()) < random(5, 12)
  203. || distanceTo(getDestination()) > 40) {
  204. if (!walkPathMM(portalToBank)) {
  205. walkToClosestTile(portalToBank);
  206. }
  207. }
  208. }
  209. return;
  210. }
  211. if ((distanceTo(portalBefore)) > 15) {
  212. ACTION = TELEPORTTO;
  213. failCount = 0;
  214. return;
  215. }
  216. {
  217. walkTileMM(portalBefore);
  218. {
  219. if (distanceTo(getDestination()) < random(5, 12)
  220. || distanceTo(getDestination()) > 40) {
  221. if (!walkTileMM(portalBefore)) {
  222. walkTo(portalBefore);
  223. }
  224. }
  225. }
  226.  
  227. wait(random(400,800));
  228. }
  229. if ((distanceTo(portalBefore)) < 1) {
  230. if(talk == 0) {
  231. final RSNPC ghost = getNearestNPCByID(ghostGuard);
  232. atNPC(ghost,"Talk");
  233. wait(random(500,750));
  234. talk = 1;
  235. if (talk == 1)
  236. clickMouse(random(225,400),random(445,455),true);
  237. wait(random(500,750));
  238. talk = 0;
  239. return;
  240. }
  241. }
  242. }
  243. }
  244.  
  245. if (ACTION == OPENBANK) {
  246. if((getInventoryCount(bucket)) > 0 && (getInventoryCount(bucketOfSlime)) <= 0) {
  247. ACTION = TELEPORTTO;
  248. failCount = 0;
  249. return;
  250. }
  251. if (bank.isOpen()) {
  252. ACTION = BANK;
  253. failCount = 0;
  254. return;
  255. }
  256. atTile(bankTile,"Use-quickly");
  257. return;
  258. }
  259. if (ACTION == BANK) {
  260. if((getInventoryCount(bucket)) > 0 && (getInventoryCount(bucketOfSlime)) <= 0) {
  261. bank.close();
  262. wait(random(100,200));
  263. ACTION = TELEPORTTO;
  264. failCount = 0;
  265. return;
  266. }
  267. if (bank.isOpen()) {
  268. if (getInventoryCount() != 0)
  269. bank.depositAllExcept(ectophial);
  270. wait(random(400,800));
  271. if (bank.atItem(bucket, "Withdraw-All")) {
  272. wait(random(400,800));
  273. failCount = 0;
  274. return;
  275. } else {
  276. failCount++;
  277. if (failCount >= 10)
  278. stopScript();
  279. else
  280. return;
  281. }
  282. return;
  283. } else ACTION = OPENBANK;
  284. return;
  285. }
  286. }
  287. }
Add Comment
Please, Sign In to add comment