Jump to content

Stop loop when smelting


Recommended Posts

Posted

do {

 

sleep(10);

 

} while(myPlayer().isAnimating());

 

not the best way of doing it but it should work

The animation stops between each bar that is smelted.

 

The best way to do this is to record the currentTimeMillis when the player is animating, then check if that recorded time has been increased by x amount of milliseconds, and if thats true then allow it to continue.

 

I can show you a snippet perhaps when I get home.

Posted

The animation stops between each bar that is smelted.

 

The best way to do this is to record the currentTimeMillis when the player is animating, then check if that recorded time has been increased by x amount of milliseconds, and if thats true then allow it to continue.

 

I can show you a snippet perhaps when I get home.

Just add a sleep long enough till it animates again if it will take 1 second for it to animate again add a sleep of 1000ms before the smelt method.

Posted

Just add a sleep long enough till it animates again if it will take 1 second for it to animate again add a sleep of 1000ms before the smelt method.

You would have to return out of the method, a simple method like this would work better

 

public boolean canAnimate(){
 
return System.currentTimeMillis() > (lastAnimation + 3000);
}

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...