Thanks a lot, Nbacon - I inserted that condition in my code above, but the thing was still spamclicking.
I looked at the thread you referenced, and the video in there.
Tried the Lambda thing from Explv's thread below - bot is still clicking on trees more than once ... I really don't seem to understand it.
Entity tree = getObjects().closest("Tree");
if (tree != null && tree.interact("Chop down") && !myPlayer().isMoving()) {
Sleep.sleepUntil(() -> !myPlayer().isAnimating(), 5000);
}
Could you tell me what's wrong in my understanding of the code:
1) Defines the object tree as closest tree to the player
2) The if statement works both to initiate the chopping, but also starts the sleep if the tree exists, if the interaction returned a true (so this means my player started chopping already or is this from the point that it clicked once?) and if my player is not moving
3) The sleep runs for either 5s or until my played has stopped chopping
Really would appreciate any help on this - I've actually read through all threads on sleep on here and have a science degree but seems I'm a brainlet for scripting