Jump to content

sleepUntil


Recommended Posts

Posted

Can we get a functional sleep that sleeps until event complete

so like for firemaking sleepUntil(!myPlayer.isAnimating));
or like gaining experience, etc..

Something like that to have clean easy to use code would be awesome, rather than creating abstract, redundant task handlings for it. 

Would really appreciate this function for numerous things. 

Posted
34 minutes ago, Booleans YAY said:

I haven't really looked through the API's conditional sleep until animation is reset to stand index.

Can someone show me a snippet for conditional sleep till animation is reset please?

new ConditionalSleep(1000, 3000)
                    {
                        public boolean condition()
                                throws InterruptedException
                        {
                            return getInventory().contains("item");
                        }
                    }.sleep();

Posted
16 hours ago, IDontEvenBot said:

new ConditionalSleep(1000, 3000)
                    {
                        public boolean condition()
                                throws InterruptedException
                        {
                            return getInventory().contains("item");
                        }
                    }.sleep();

no.

  • Like 1

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...