Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import java.util.*;
- import java.util.List;
- import java.util.logging.Level;
- import javax.accessibility.*;
- import javax.swing.*;
- import org.rsbot.bot.Bot;
- import org.rsbot.script.*;
- import org.rsbot.script.wrappers.*;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.accessors.*;
- import org.rsbot.event.listeners.ServerMessageListener;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.util.ScreenshotUtil;
- @ScriptManifest(authors = { "dpedroia15" }, category = "Other", name = "EctoFunk Slimer", version = 1.00, description = "<html><head></head><body>Script description here.</body></html\n")
- public class EctoFunkSlimer extends Script {
- private final ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
- public boolean onStart(Map<String, String> args) {
- return true;
- }
- //Enum
- private final int TELEPORTTO = 1;
- private final int LADDERONE = 2;
- private final int LADDERTWO = 3;
- private final int LADDERTHREE = 4;
- private final int LADDERFOUR = 5;
- private final int FILLBUCKETS = 6;
- private final int WALKTOBANK = 9;
- private final int OPENBANK = 10;
- private final int BANK = 11;
- private int ACTION = WALKTOBANK;
- //Random
- public int talk = 0;
- private int failCount = 0;
- //Items
- public int ectophial = 4251;
- public int bucket = 1925;
- public int bucketOfSlime = 4286;
- public int Energy = random(50, 67);
- //Tiles
- public RSTile bankTile = new RSTile(3688, 3466);
- public RSTile altarFromEctophial = new RSTile(3659, 3522);
- public RSTile ladderOneAbove = new RSTile(3654, 3519);
- public RSTile ladderOneBelow = new RSTile(3669, 9888);
- public RSTile ladderTwoAbove = new RSTile(3692, 9888);
- public RSTile ladderTwoBelow = new RSTile(3688, 9888);
- public RSTile ladderThreeAbove = new RSTile(3671, 9888);
- public RSTile ladderThreeBelow = new RSTile(3675, 9888);
- public RSTile ladderFourAbove = new RSTile(3687, 9888);
- public RSTile ladderFourBelow = new RSTile(3683, 9888);
- public RSTile portalAfter = new RSTile(3659, 3507);
- public RSTile portalBefore = new RSTile(3658, 3509);
- //NPCS
- public int ghostGuard = 1706;
- public int banker = 1702;
- //Paths
- public RSTile portalToBank[] = {new RSTile(3661, 3493), new RSTile(3673, 3486), new RSTile(3681, 3477), new RSTile(3687, 3466)};
- public RSTile ladderOneBelowToLadderTwoAbove[] = {new RSTile(3674, 9876), new RSTile(3689, 9879)};
- //Objects
- final int laddderOneAboveClosed = 5267;
- final int laddderOneAboveOpen = 5268;
- final int laddderOneBelow = 5264;
- final int laddderTwoAbove = 5263;
- final int laddderTwoBelow = 5262;
- final int laddderThreeAbove = 5263;
- final int laddderThreeBelow = 5262;
- final int laddderFourAbove = 5263;
- final int laddderFourBelow = 5262;
- final int poolOfSlime = 17119;
- public int loop() {
- try {
- getDemBuckets(false);
- } catch (Exception e) { }
- return random(50,150);
- }
- private void getDemBuckets(boolean abyssal) {
- int randomTile = random(0,5);
- if (abyssal) {
- } else {
- if (ACTION == TELEPORTTO){
- atInventoryItem(ectophial,"Empty");
- wait(random(400,800));
- ACTION = LADDERONE;
- failCount = 0;
- return;
- }
- if (ACTION == LADDERONE){
- {
- if ((getInventoryCount(bucket)) > 0) {
- wait(random(800,1200));
- atObject((getNearestObjectByID(laddderOneAboveOpen)),"Climb-down");
- ACTION = LADDERTWO;
- failCount = 0;
- return;
- }
- else
- ACTION = WALKTOBANK;
- failCount = 0;
- return;
- }
- }
- if ((getNearestObjectByID(laddderOneAboveClosed)) != null) {
- final RSObject ladder = (getNearestObjectByID(laddderOneAboveClosed));
- atObject(ladder,"Open");
- wait(random(400,800));
- return;
- }
- return;
- }
- if (ACTION == LADDERTWO){
- {
- if ((getInventoryCount(bucket)) > 0){
- atObject((getNearestObjectByID(laddderTwoAbove)),"Climb-down");
- ACTION = LADDERTHREE;
- failCount = 0;
- return;
- }
- else
- ACTION = TELEPORTTO;
- failCount = 0;
- return;
- }
- }
- if (ACTION == LADDERTHREE) {
- {
- if ((getInventoryCount(bucket)) > 0){
- atObject((getNearestObjectByID(laddderThreeAbove)), "Climb-down");
- ACTION = LADDERFOUR;
- failCount = 0;
- return;
- }
- else
- ACTION = TELEPORTTO;
- failCount = 0;
- return;
- }
- }
- if (ACTION == LADDERFOUR){
- {
- if((getInventoryCount(bucket)) > 0) {
- if((getNearestObjectByID(laddderFourAbove)) == null) {
- final RSTile ladderfour = getNearestObjectByID(laddderFourAbove).getLocation();
- walkTo(ladderfour);
- if((getNearestObjectByID(laddderFourAbove)) != null)
- atObject((getNearestObjectByID(laddderFourAbove)), "Climb-Down");
- ACTION = FILLBUCKETS;
- failCount = 0;
- return;
- }
- else
- ACTION = TELEPORTTO;
- failCount = 0;
- return;
- }
- }
- if (ACTION == FILLBUCKETS) {
- {
- if((getInventoryCount(bucket)) > 0) {
- atInventoryItem(bucket, "Use");
- atObject((getNearestObjectByID(poolOfSlime)),"-> Pool of Slime");
- }
- else
- ACTION = TELEPORTTO;
- failCount = 0;
- return;
- }
- }
- return;
- }
- if (ACTION == WALKTOBANK) {
- if((getInventoryCount(bucket)) > 0) {
- ACTION = TELEPORTTO;
- failCount = 0;
- return;
- }
- if((getInventoryCount(bucketOfSlime)) > 0) {
- if ((distanceTo(altarFromEctophial)) > 13) {
- walkPathMM(portalToBank);
- {
- if (distanceTo(getDestination()) < random(5, 12)
- || distanceTo(getDestination()) > 40) {
- if (!walkPathMM(portalToBank)) {
- walkToClosestTile(portalToBank);
- }
- }
- }
- return;
- }
- if ((distanceTo(portalBefore)) > 15) {
- ACTION = TELEPORTTO;
- failCount = 0;
- return;
- }
- {
- walkTileMM(portalBefore);
- {
- if (distanceTo(getDestination()) < random(5, 12)
- || distanceTo(getDestination()) > 40) {
- if (!walkTileMM(portalBefore)) {
- walkTo(portalBefore);
- }
- }
- }
- wait(random(400,800));
- }
- if ((distanceTo(portalBefore)) < 1) {
- if(talk == 0) {
- final RSNPC ghost = getNearestNPCByID(ghostGuard);
- atNPC(ghost,"Talk");
- wait(random(500,750));
- talk = 1;
- if (talk == 1)
- clickMouse(random(225,400),random(445,455),true);
- wait(random(500,750));
- talk = 0;
- return;
- }
- }
- }
- }
- if (ACTION == OPENBANK) {
- if((getInventoryCount(bucket)) > 0 && (getInventoryCount(bucketOfSlime)) <= 0) {
- ACTION = TELEPORTTO;
- failCount = 0;
- return;
- }
- if (bank.isOpen()) {
- ACTION = BANK;
- failCount = 0;
- return;
- }
- atTile(bankTile,"Use-quickly");
- return;
- }
- if (ACTION == BANK) {
- if((getInventoryCount(bucket)) > 0 && (getInventoryCount(bucketOfSlime)) <= 0) {
- bank.close();
- wait(random(100,200));
- ACTION = TELEPORTTO;
- failCount = 0;
- return;
- }
- if (bank.isOpen()) {
- if (getInventoryCount() != 0)
- bank.depositAllExcept(ectophial);
- wait(random(400,800));
- if (bank.atItem(bucket, "Withdraw-All")) {
- wait(random(400,800));
- failCount = 0;
- return;
- } else {
- failCount++;
- if (failCount >= 10)
- stopScript();
- else
- return;
- }
- return;
- } else ACTION = OPENBANK;
- return;
- }
- }
- }
Add Comment
Please, Sign In to add comment