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.

sleepUntil

Featured Replies

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. 

try using ConditionalSleep

or find explv's snippet in the snippet section

or create your own method.

  • Author

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?

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

You could also even just use a while function

while(myPlayer().isAnimating()){
sleep(random(400, 500));
}

new ConditionalSleep(10000) {	
	@Override
	public boolean condition() throws InterruptedException {
		return !myPlayer().isAnimating();
	}
}.sleep();

Sleeps for max 10 seconds or until the player is not animating anymore

Edited by Reveance

  • Author

I also haven't tried the conditional sleep with animation check since i wrote my first few scripts which one was a firemaking one. I'll review this stuff another day when I get the time. I appreciate the over haul responses from the community.

16 hours ago, IDontEvenBot said:

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

no.

16 hours ago, Slut said:

You could also even just use a while function

while(myPlayer().isAnimating()){
sleep(random(400, 500));
}

Random is unnecessary and while loops like this should have a timeout. 

28 minutes ago, Imateamcape said:

no.

Is there something wrong with it im not seeing?

1 minute ago, IDontEvenBot said:

Is there something wrong with it im not seeing?

Read the ConditionalSleep documentation, your sleep won't do anything. 

5 minutes ago, Alek said:

Read the ConditionalSleep documentation, your sleep won't do anything. 

Whoooops never actually read what Sleeptime was and assumed it was sleep randomly between X - X LMAO! Thank you for enlightening me.

3 minutes ago, IDontEvenBot said:

Whoooops never actually read what Sleeptime was and assumed it was sleep randomly between X - X LMAO! Thank you for enlightening me.

Don't feel bad, even scripters were screwing this up for a while. 

Create an account or sign in to comment

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.