Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

isAnimating() is returning false during the brief period between sequence of animations

Featured Replies

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

i believe its known that isanimating is not very reliable

 

try

while(getInventory().contains("Gold bar")
{
   sleep(500)
}

Edited by The Hero of Time

make a timer, reset the timer if animating, if timer reaches x amount of time start doing the smithing stuff

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 by The Hero of Time

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.

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

 

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.

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

  • Developer

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.

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.

As Woody already said, use timer, nothing hard.

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.

As Woody already said, use timer, nothing hard.

As Fruity said*

 

smile.png  QwPha8E.png

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.