Jump to content

Osbot ignoring delays


Recommended Posts

Posted

When i run the script, in the beginning it is fine, everything is happening like it is supposed, delays are working just fine, but after like 10-20 mins script start glitching (looks like it is running without any delays, just spam clicking every single task etc.) when i RR script everything is working fine again. Kinda interesting. Script im using for delay -

Quote

 void randomDelay(float min, float max){
            int random = (int)(max * Math.random() + min);
            try 
            {
                sleep(random);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

 

Posted
15 minutes ago, Nikoman said:

When i run the script, in the beginning it is fine, everything is happening like it is supposed, delays are working just fine, but after like 10-20 mins script start glitching (looks like it is running without any delays, just spam clicking every single task etc.) when i RR script everything is working fine again. Kinda interesting. Script im using for delay -

 

Seems like your sleeps are being interrupted. Why, idk.

Posted
void randomDelay(float min, float max){
            int random = (int)(max * Math.random() + min);
            try 
            {
                sleep(random);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

@Nikoman you don't need to create a whole new method just for this, you don't need to declare a local variable and you don't need to use the Math class to get a random number. Everything can be done using the OSBot API in one line:

sleep(random(min, max));

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