Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • completely new, need help with a simple lms script


    TTB1
     Share

    Recommended Posts

    private State getState() {
            GameObject Competitive = getGameObjects().closest("Competitive");
            if (Competitive != null)
                return State.NOTSTARTED;
            return State.STARTED;
            // add a lowhp
        }

        @Override
        public int onLoop() {
            switch (getState()) {
            case STARTED:
                // pray dumbass
                break;
            case LOWHP:
                // fucking eat kid
                break;
            case NOTSTARTED:
                GameObject Competitive = getGameObjects().closest("Competitive");
                Competitive.interact("Pass-Through");
                break;
            }

    Pay no attention to the comments, just a todo list :)

    How do i make it so that it just clicks the competitive barrier once instead of spamming it? i would assume that it would be adding something like wait until (case STARTED) but i have no idea.

    i also need to know how to activate quick prayers, which will be way easier than the above

    Link to comment
    Share on other sites

    5 minutes ago, TTB1 said:

    How do i make it so that it just clicks the competitive barrier once instead of spamming it? i would assume that it would be adding something like wait until (case STARTED) but i have no idea.

    Use a conditional sleep,  you'd put your case started for the condition, and then a sleep timer to wait in case the condition is never met. It'll either sleep until the condition is met or the sleep timer is met.
     

    sleepUntil(() -> condition, sleeptimer);

     

    Here's one that I use for when I'm walking.

    sleepUntil(() -> Walking.shouldWalk(10), 3600);

    So I sleep until either I'm 10 tiles away from the point I'm walking to or until the 3600 has passed.

    Link to comment
    Share on other sites

    43 minutes ago, Cystic said:

    Use a conditional sleep,  you'd put your case started for the condition, and then a sleep timer to wait in case the condition is never met. It'll either sleep until the condition is met or the sleep timer is met.
     

    sleepUntil(() -> condition, sleeptimer);

     

    Here's one that I use for when I'm walking.

    sleepUntil(() -> Walking.shouldWalk(10), 3600);

    So I sleep until either I'm 10 tiles away from the point I'm walking to or until the 3600 has passed.

    so i did this

    sleepUntil((!getInventory().isEmpty()));

    but i get an error saying The method sleepUntil(Condition, long) in the type MethodProvider is not applicable for the arguments (boolean)

    Link to comment
    Share on other sites

    4 minutes ago, TTB1 said:

    so i did this

    sleepUntil((!getInventory().isEmpty()));

    but i get an error saying The method sleepUntil(Condition, long) in the type MethodProvider is not applicable for the arguments (boolean)

    You need

    sleepUntil(() -> !getInventory().isEmpty(), 3600);
    Link to comment
    Share on other sites

    3 minutes ago, Cystic said:

    You need

    sleepUntil(() -> !getInventory().isEmpty(), 3600);

    my god, thank you so much. i've been going at this for hours

    Link to comment
    Share on other sites

    Just now, TTB1 said:

    my god, thank you so much. i've been going at this for hours

    nevermind lol now i get the error Syntax error on tokens, Expression expected instead

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.