My script is using a furnace and I am currently using if (!myPlayer().isAnimating()) to check if I am already using the furnace. It works most of the time but it occasionally breaks and tries to restart the crafting while it already is crafting. I am guessing it is because there is a small delay between the smithing animations so the script will think the player is not animating. I have experimented with sleeps and seen into getAnimationDelay() but cannot figure it out.
Any help is appreciated