grape303 1 Share Posted December 12, 2023 I have a mining script that is running OK, but could easily improve performance with 1 fix. My issue is: when I'm mining an ore that is going to take a bit, the animation will revert back to -1 after a few seconds of failed mining rolls & then it will continue mining. During this half second, give or take a few, the window of no animation (-1) will cause my script to attempt to mine again. This is an issue because it resets the chance for a successful mine. Making it extremely inefficient. Any assistance would be greatly appreciated. Thank you! Link to comment Share on other sites More sharing options...
camelCase 240 Share Posted December 12, 2023 Sleep.sleepUntil(Inventory::isFull, Players.getLocal()::isAnimating, 1200, 100) sleeps until your inventory is full, or 1200ms of not animating, checking if you are animating every 100ms the 2nd condition resets the timer when true grape303 1 Link to comment Share on other sites More sharing options...
grape303 1 Author Share Posted December 12, 2023 @camalCaseThis is definitely a major improvement of what I had put, so thank you. Improvement being 1-3 swing attempts vs 4-5. unfortunately, There are still occurrences of of multiple "you swing your pick at the rock" for the very very short -1 animation. I may have to get creative with inventory check & message. Do you think that could be a viable route worth exploring? Link to comment Share on other sites More sharing options...
MaximusPrimo 64 Share Posted December 12, 2023 No need. That snippet should work fine. Change the 1200 timeout to a higher number like 2500 and see if that helps grape303 1 Link to comment Share on other sites More sharing options...
grape303 1 Author Share Posted December 12, 2023 I believe it is working good enough for me to move onto wrapping up paints, cleaning up code, and submitting review! Thank you both MaximusPrimo 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now