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.

Sleep until?

Featured Replies

Sorry for noob question but how can I use sleep until for example sleep until my player hasnt animated in say 10 seconds?

 

isAnimating() isn't reliable for furnaces etc :(?

6 minutes ago, OllieW said:

Sorry for noob question but how can I use sleep until for example sleep until my player hasnt animated in say 10 seconds?

 

isAnimating() isn't reliable for furnaces etc :(?

There's one of two ways to solve this: Either you get creative and look for something else to sleep for or create a method which sleeps until player hasnt animated for 10 seconds. Im pretty sure the first one would be easier for you. ex: check for items in inv or something

1 hour ago, Deceiver said:

sleepuntil() -> !getinv.contains(ore/bar), 30000

Do NOT do this. If anything goes wrong, you'll be sitting there for up to 30 seconds just doing nothing.

I normally use a Timer class for the following code, but this will still work and maintains the same jist.

Here is the pastebin because the forums won't let me post it:

https://pastebin.com/7H9GYHcK

 

Edit #2: For some reason, my last edit deleted everything I wrote (?) so I just rewrote it.

Edited by Team Cape

For furnace, you would want to cond sleep when widget are null or no longer visible.

You want to interact with furnace if you been idle for x seconds 

  private boolean idleFor(int millis){

        if(myPlayer().isAnimating())
        {
            timeSinceAnimation = System.currentTimeMillis();
        }
        else
        {
            timeSinceIdle = System.currentTimeMillis();
        }

        return timeSinceAnimation + millis < timeSinceIdle;
    }

variables are global

Edited by dreameo

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.