In this instance, I'm trying to set a conditional sleep to sleep after my script has interacted with lure until my player is animating ie player has reached the spot so that the script doesn't spam other spots whilst tying to run to one.
public void Fish() throws InterruptedException {
NPC spot = getNpcs().closest("Rod fishing spot");
if ((!myPlayer().isAnimating()) && spot != null) {
spot.interact("Lure");
new ConditionalSleep(10000) {
@Override
public boolean condition() {
return myPlayer().isAnimating();
}
}.sleep();
}
}
So, if the player is not animating and the spot is not equal to null, interact with lure, then sleep until the player is animating OR 10 seconds has elapsed? Am I writing this correctly? Additionally, what are the two other values that ConditionalSleep can take?
Cheers