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

Spam-ish Interacting?

Featured Replies

As some of u know, I put out a little powerminer for the WWF area, it works all dandy and well besides the spam clicking for object interaction:

 

https://vid.me/ZXMF

 

And code:

  if (MINING.contains(this.myPlayer())) {
            final Entity rock = objects.closest("Pile of rock");
            if (rock != null && rock.isVisible() && !this.myPlayer().isAnimating()) {
                rock.interact("Mine");
               ConditionalSleep(2000);
            } else {
                camera.toEntity(rock);

Could anyone provide insight on to why it spam clicks?

ConditionalSleep(2000);

Does nothing. You want to either do:

sleep(2000);

or

new ConditionalSleep(2000) { //Until condition() is met OR 2000 ms passes
    @Override
    public boolean condition() {
        return myPlayer().isAnimating();
    }
}.sleep();

When you are mining, like cooking, there are breaks in animations while you are still mining. 

If you are only using isAnimating, then even though you are still mining, there will be a split second where isAnimating will return false, i.e. a break in the animation. 

Even though your player will continue mining after that split second break, the script will only know that the player is not animating, and it will try to interact again. 

 

You need to have some tracker to see how long you have been idle for. 

 

For example, only interact if you are idle for > 300 ms. 

Then if a animation break last 100 ms, the animation break will not trigger another interaction.

 

If that makes sense. 

  • Author
ConditionalSleep(2000);

Does nothing. You want to either do:

sleep(2000);

or

new ConditionalSleep(2000) { //Until condition() is met OR 2000 ms passes
    @Override
    public boolean condition() {
        return myPlayer().isAnimating();
    }
}.sleep();

 

I'll look into both methods, thanks!

When you are mining, like cooking, there are breaks in animations while you are still mining. 

If you are only using isAnimating, then even though you are still mining, there will be a split second where isAnimating will return false, i.e. a break in the animation. 

Even though your player will continue mining after that split second break, the script will only know that the player is not animating, and it will try to interact again. 

 

You need to have some tracker to see how long you have been idle for. 

 

For example, only interact if you are idle for > 300 ms. 

Then if a animation break last 100 ms, the animation break will not trigger another interaction.

 

If that makes sense. 

 

I didn't know that actually, thanks for the info! (I haven't run into this problem in my cooking script, although that's probably cause I test multiple conditions, I'll look into this more) 

 

@OP Use normal sleep as mentioned above or properly implement conditional sleep 

Edited by Omicron

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.