Entity tree = getObjects().closest("Tree");
if (tree != null && tree.interact("Chop down")) {
new ConditionalSleep(5000) {
@Override
public boolean condition() {
return myPlayer().isAnimating() || !tree.exists();
}
}.sleep();
}
New to OSBot, but not new to Java. I was following through your tutorial, and I am curious about your sleep condition in this snippet. Why do we want to stop sleeping if myPlayer is animating. Maybe I do not understand what that method will return, but my naive assumption is that myPlayer is animating while in the act of "chopping". It seems to me that this wouldn't sleep at all as it would meet the condition upon either "chopping" or walking to the next tree. Your thoughts on this would be much appreciated Thank you for an awesome guide.