Whenever I get this problem, the quickest fix is to click away from the anvil. The bot will then correct itself and continue smithing. Can you implement click away as a temporary fix to the problem? Try and write the script so that it detects when the bot has been idling for more than 2 or 3...