Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Question Teleports/Lodestone checks

Joined
Mar 11, 2018
Messages
19
Hey everyone! I did a quick forum search as well as a look through the jdocs and couldn't find exactly what I was looking for.

My question: if I am developing a bot that has a few teleports in it that use lodestones I was curious as to how I implement the bot to not spam click a lodestone if the user does not have access to said lodestone (ie lunar isle for example). I'm assuming there is some kind of check/return but I cant seem to find it anywhere.

maybe I'm looking right at it under lodestone in the jdocs, but I'm not sure

Any help would be appreciated!

btw I'm a noobie coder so I apologize that this is a bit menial
 
Last edited:
Joined
Mar 11, 2018
Messages
19
Code:
@Override
    public void execute() {
        if (Lodestone.FREMENNIK_PROVINCE.isActivated()) {
            if (Lodestone.FREMENNIK_PROVINCE.teleport()) ;
            Execution.delayWhile(() -> (Players.getLocal().isMoving() || Players.getLocal().getAnimationId() != -1));

            } else {
            Environment.getBot().stop("The player doesn't have the correct Lodestone.");
        }

    }

}

Seeing as I haven't gotten a serious answer yet @Squidl :p would anyone care to let me know if this would work or not??
 
12 year old normie
Joined
Jan 8, 2015
Messages
2,768
Code:
@Override
    public void execute() {
        if (Lodestone.FREMENNIK_PROVINCE.isActivated()) {
            if (Lodestone.FREMENNIK_PROVINCE.teleport()) ;
            Execution.delayWhile(() -> (Players.getLocal().isMoving() || Players.getLocal().getAnimationId() != -1));

            } else {
            Environment.getBot().stop("The player doesn't have the correct Lodestone.");
        }

    }

}

Seeing as I haven't gotten a serious answer yet @Squidl :p would anyone care to let me know if this would work or not??
Breh.

You're closing your if statement without a body. This shit shouldn't even compile.

Edit: it does if you look at the amount of closing brackets but your code will do some fucked up shit like this.
 
Joined
Mar 11, 2018
Messages
19
Breh.

You're closing your if statement without a body. This shit shouldn't even compile.

Edit: it does if you look at the amount of closing brackets but your code will do some fucked up shit like this.

oops I didn't even see that, thanks! and what do you mean by "fucked up shit"? I just want it to simply check to make sure the user has access to the lodestone instead of spamming it if its locked

edit: do you mean because I was closing it without a body or in general?
 
Code:
@Override
    public void execute() {
        if (Lodestone.FREMENNIK_PROVINCE.isActivated()) {
            if (Lodestone.FREMENNIK_PROVINCE.teleport())
            Execution.delayWhile(() -> (Players.getLocal().isMoving() || Players.getLocal().getAnimationId() != -1));

            } else {
            Environment.getBot().stop("The player doesn't have the correct Lodestone.");
        }

    }
}

new one (without the un needed ";" closing it too early

----------------------

Further edit: it works the way I thought it would! Thanks Derk for letting me know I missed something!
 
Last edited:
Top