Jump to content

Abysm's CrackTheClue Bot!


Abysm

Recommended Posts

This bot gets Clue hunter outfit for you!

The outfit acts as a warm clothing in wintertodt or you can just keep it as fashionscape

Requirements: Have spade, Nature rune, Superantipoison (1), leather boots and Coins (chartering) in your inventory!

 You Might die as lvl 3!

Download

 

Havent tested the helm location, please report to me if it digs in wrong spots :D 

Source code

Spoiler

import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

import java.awt.*;

@ScriptManifest(author = "Abysm", info = "Gets clue hunter outfit for you", name = "CrackTheClue Bot", version = 0, logo = "")
public class main extends Script {

    Area ClueAreaGloves = new Area(2581, 3380, 2577, 3376);
    Area ClueAreaCloak = new Area(2614, 3065, 2616, 3063);
    Area ClueAreaTrouser = new Area(2818, 3128, 2820, 3126);
    Area ClueAreaGarb = new Area(1593, 3625, 1595, 3627);
    Area ClueAreaHelm = new Area(2589, 3231, 2591, 3229);

    private long startTime;

    @Override
    public void onStart() {
        startTime = System.currentTimeMillis();
    }

    public enum State {
        CANTDO, CANTDOFINAL, CLUE1, CLUE2, CLUE3, CLUE4, CLUE5, DONE
    }

    private State getState() {
        if (!getInventory().contains("Spade", "Coins"))
            return State.CANTDO;
        if (!getInventory().contains("Clue hunter gloves", "Clue hunter boots"))
            return State.CLUE1;
        if (!getInventory().contains("Clue hunter cloak"))
            return State.CLUE2;
        if (!getInventory().contains("Clue hunter trousers"))
            return State.CLUE3;
        if (!getInventory().contains("Clue hunter garb"))
            return State.CLUE4;
        if (!getInventory().contains("Nature rune", "leather boots", "Superantipoison (1)"))
            return State.CANTDOFINAL;
        if (!getInventory().contains("Helm of raedwald"))
            return State.CLUE5;
        return State.DONE;
    }

    @Override
    public int onLoop() throws InterruptedException {
        switch (getState()) {
            case CANTDO:
                log("No spade/Coins found, logging off...");
                getLogoutTab().logOut();
                stop();
                break;
            case CLUE1:
                if (!ClueAreaGloves.contains(myPlayer())) {
                    getWalking().webWalk(ClueAreaGloves.getRandomPosition());
                } else {
                    inventory.interact("Dig", "Spade");
                    sleep(random(1000, 2000));
                }
                break;
            case CLUE2:
                if (!ClueAreaCloak.contains(myPlayer())) {
                    getWalking().webWalk(ClueAreaCloak.getRandomPosition());
                } else {
                    inventory.interact("Dig","Spade");
                    sleep(random(1000, 2000));
                }
                break;
            case CLUE3:
                if (!ClueAreaTrouser.contains(myPlayer())) {
                    getWalking().webWalk(ClueAreaTrouser.getRandomPosition());
                } else {
                    inventory.interact("Dig", "Spade");
                    sleep(random(1000, 2000));
                }
                break;
            case CLUE4:
                if (!ClueAreaGarb.contains(myPlayer())) {
                    getWalking().webWalk(ClueAreaGarb.getRandomPosition());
                } else {
                    inventory.interact("Dig", "Spade");
                    sleep(random(1000, 2000));
                }
                break;
            case CANTDOFINAL:
                log("You don't have required items, please make sure you have nature rune, leather boots and superantipoison (1)");
                getLogoutTab().logOut();
                stop();
                break;
            case CLUE5:
                if (!ClueAreaHelm.contains(myPlayer())) {
                    getWalking().webWalk(ClueAreaHelm.getRandomPosition());
                } else {
                    inventory.interact("Dig", "Spade");
                    sleep(random(1000, 2000));
                }
                    break;
            case DONE:
                log("Gz you got the outfit!");
                getLogoutTab().logOut();
                stop();
                break;
        }
        return random(200, 300);
    }

    @Override
    public void onExit() {
        log("Thanks for running my CrackTheClue bot!");
    }

    @Override
    public void onPaint(Graphics2D g) {
        Graphics2D paint = (Graphics2D) g.create();

        long Runtime = System.currentTimeMillis() - startTime;

        paint.drawString("Time running: " + formatTime(Runtime), 10, 310);
        paint.drawString("Current state: " + getState(), 10, 325);
    }

    public final String formatTime(final long ms) {

        long s = ms / 1000, m = s / 60, h = m / 60;

        s %= 60;

        m %= 60;

        h %= 24;

        return String.format("%02d:%02d:%02d", h, m, s);
    }
}

 

Edited by Abysm
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
56 minutes ago, UkBenH said:

Thanks for this, I'm crazy lazy & just started an ironman who's staying 10HP for wintertodt.. This will be so useful, thanks!

 

Can we select not to get the helm or is it all built in?

It just currently goes through all the items but because the helm is last you can stop it

56 minutes ago, UkBenH said:

Thanks for this, I'm crazy lazy & just started an ironman who's staying 10HP for wintertodt.. This will be so useful, thanks!

 

Can we select not to get the helm or is it all built in?

you should also watch it because 10hp's can die at the karamja or zeah

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 4 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...