Jump to content

sleepUntil


Booleans YAY

Recommended Posts

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. 

Link to comment
Share on other sites

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();

Link to comment
Share on other sites

16 hours ago, IDontEvenBot said:

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

no.

  • Like 1
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...