August 14, 20178 yr Sorry for noob question but how can I use sleep until for example sleep until my player hasnt animated in say 10 seconds? isAnimating() isn't reliable for furnaces etc :(?
August 14, 20178 yr 6 minutes ago, OllieW said: Sorry for noob question but how can I use sleep until for example sleep until my player hasnt animated in say 10 seconds? isAnimating() isn't reliable for furnaces etc :(? There's one of two ways to solve this: Either you get creative and look for something else to sleep for or create a method which sleeps until player hasnt animated for 10 seconds. Im pretty sure the first one would be easier for you. ex: check for items in inv or something
August 14, 20178 yr 1 hour ago, Deceiver said: sleepuntil() -> !getinv.contains(ore/bar), 30000 Do NOT do this. If anything goes wrong, you'll be sitting there for up to 30 seconds just doing nothing. I normally use a Timer class for the following code, but this will still work and maintains the same jist. Here is the pastebin because the forums won't let me post it: https://pastebin.com/7H9GYHcK Edit #2: For some reason, my last edit deleted everything I wrote (?) so I just rewrote it. Edited August 14, 20178 yr by Team Cape
August 14, 20178 yr Sleep timer. I have a snippet posted in the Snippet section, might be a few pages back
August 14, 20178 yr For furnace, you would want to cond sleep when widget are null or no longer visible. You want to interact with furnace if you been idle for x seconds private boolean idleFor(int millis){ if(myPlayer().isAnimating()) { timeSinceAnimation = System.currentTimeMillis(); } else { timeSinceIdle = System.currentTimeMillis(); } return timeSinceAnimation + millis < timeSinceIdle; } variables are global Edited August 14, 20178 yr by dreameo
Create an account or sign in to comment