justanotherkid Posted April 18, 2016 Share Posted April 18, 2016 while(myPlayer().isAnimating()) { sleep(500); } or new ConditionalSleep(30000) { @Override public boolean condition() throws InterruptedException { return !myPlayer().isAnimating(); } }.sleep(); when smelting bars these two snippets are not making the player sleep smelts about 2 bars then loops again to reuse the bar on furnace Link to comment Share on other sites More sharing options...
lisabe96 Posted April 18, 2016 Share Posted April 18, 2016 Use game messages maybe (your retrieve a bar...) and interact on that Link to comment Share on other sites More sharing options...
The Hero of Time Posted April 18, 2016 Share Posted April 18, 2016 (edited) i believe its known that isanimating is not very reliable try while(getInventory().contains("Gold bar") { sleep(500) } Edited April 18, 2016 by The Hero of Time Link to comment Share on other sites More sharing options...
Chicken Wing Posted April 18, 2016 Share Posted April 18, 2016 Why is this a bug? 2 Link to comment Share on other sites More sharing options...
Fruity Posted April 18, 2016 Share Posted April 18, 2016 make a timer, reset the timer if animating, if timer reaches x amount of time start doing the smithing stuff 1 Link to comment Share on other sites More sharing options...
The Hero of Time Posted April 18, 2016 Share Posted April 18, 2016 (edited) make a timer, reset the timer if animating, if timer reaches x amount of time start doing the smithing stuff ehh i think the problem here is that when you smith, you animate to put x in the furnace, and after that the player "waits" , != animating. so to add a timer for that is pretty tedious Edited April 18, 2016 by The Hero of Time Link to comment Share on other sites More sharing options...
Token Posted April 18, 2016 Share Posted April 18, 2016 Only purpose of isAnimating() is to determine when a Character started performing an attack, other than that you don't have any reason to use it. Link to comment Share on other sites More sharing options...
The Hero of Time Posted April 18, 2016 Share Posted April 18, 2016 Only purpose of isAnimating() is to determine when a Character started performing an attack, other than that you don't have any reason to use it. exept for skills like fishing, woodcutting, where the player is constantly animating Link to comment Share on other sites More sharing options...
DragonAlpha Posted April 18, 2016 Share Posted April 18, 2016 while(myPlayer().isAnimating()) { sleep(500); } or new ConditionalSleep(30000) { @Override public boolean condition() throws InterruptedException { return !myPlayer().isAnimating(); } }.sleep(); when smelting bars these two snippets are not making the player sleep smelts about 2 bars then loops again to reuse the bar on furnace Of course it does. You do the animation, then you stop for a split second, and do it again. So waiting for the animation to stop is not a good way, because it stops after each 1 action. Link to comment Share on other sites More sharing options...
The Hero of Time Posted April 18, 2016 Share Posted April 18, 2016 Of course it does. You do the animation, then you stop for a split second, and do it again. So waiting for the animation to stop is not a good way, because it stops after each 1 action. ehh i think the problem here is that when you smith, you animate to put x in the furnace, and after that the player "waits" , != animating. so to add a timer for that is pretty tedious yup Link to comment Share on other sites More sharing options...
Developer Maxi Posted April 18, 2016 Developer Share Posted April 18, 2016 The mechanics of animation are like this. The way the RS client functions is that is loops on a 600ms updating interval. For animations, the client will receive information how to animate in one cycle, and although this animation may last multiple cycles, the animation update flag in the client will only be set in the cycle in which the animation will initiate. Therefor it is only reliable to know whether an animation has started and it gives you no reliable way of knowing whether an animation has ended. In your specific case, a player is performing multiple animations in a row. This means that in between phases in which isAnimating() will return true, it will also return false which will break your sleep. 1 Link to comment Share on other sites More sharing options...
Woody Posted April 18, 2016 Share Posted April 18, 2016 ehh i think the problem here is that when you smith, you animate to put x in the furnace, and after that the player "waits" , != animating. so to add a timer for that is pretty tedious You can have it so the timer begins on a certain animation, you silly. Link to comment Share on other sites More sharing options...
iJodix Posted April 18, 2016 Share Posted April 18, 2016 As Woody already said, use timer, nothing hard. 1 Link to comment Share on other sites More sharing options...
Final Posted April 18, 2016 Share Posted April 18, 2016 As many have stated previously, this is a logical error, I've posted on your original thread with the suitable fix for such an issue. The brief period in between the animation actually is no animation, the animation value returns to -1, meaning the player is no longer animating. However just because the player is no longer animating, does not mean by any margin mean that the player is not actively interacting with an object or is not queued to interact with the object more. I'd also recommend not sleeping your thread, that's lazy and bad practice for the solution you are looking to solve. 1 Link to comment Share on other sites More sharing options...
Woody Posted April 18, 2016 Share Posted April 18, 2016 As Woody already said, use timer, nothing hard. As Fruity said* 1 Link to comment Share on other sites More sharing options...