Nikoman Posted September 23, 2018 Share Posted September 23, 2018 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 Quote Link to comment Share on other sites More sharing options...
Wife Posted September 23, 2018 Share Posted September 23, 2018 I would say it's you silly random delay that is glitching out. Just use static sleep. Quote Link to comment Share on other sites More sharing options...
dreameo Posted September 23, 2018 Share Posted September 23, 2018 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. Quote Link to comment Share on other sites More sharing options...
Nikoman Posted September 23, 2018 Author Share Posted September 23, 2018 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? Quote Link to comment Share on other sites More sharing options...
Wife Posted September 23, 2018 Share Posted September 23, 2018 On 9/23/2018 at 3:49 PM, Nikoman said: 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? Expand (200, 700) Quote Link to comment Share on other sites More sharing options...
Nikoman Posted September 23, 2018 Author Share Posted September 23, 2018 Sleep(random) works well. Thank you guys, can close this topic . Quote Link to comment Share on other sites More sharing options...
Script Kid Posted September 24, 2018 Share Posted September 24, 2018 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)); Quote Link to comment Share on other sites More sharing options...
liverare Posted September 24, 2018 Share Posted September 24, 2018 Why are you using float types? Why aren't you using conditional sleeps? Quote Link to comment Share on other sites More sharing options...