Jump to content

Stop loop when smelting


Jusple

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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);
}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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