Jump to content

Osbot ignoring delays


Nikoman

Recommended Posts

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

Expand  

 

Link to comment
Share on other sites

  On 9/23/2018 at 3:26 PM, 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 -

 

Expand  

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

Link to comment
Share on other sites

  On 9/23/2018 at 3:33 PM, Wife said:

I would say it's you silly random delay that is glitching out. Just use static sleep.

Expand  

Isn't that too sketchy that every single time the delay is exact,for example, 500ms ...? Btw maybe you or @dreameo have some good random delay scripts, that are working fine?

Link to comment
Share on other sites

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