September Posted December 2, 2015 Share Posted December 2, 2015 So i am currently in the making of a script which interacts with an object. And it keeps on spam clicking the object. I have the code below after my interaction with the object. sleep(random(4000, 7000)); Even after using the code above it will spam click every 1 seconds. Quote Link to comment Share on other sites More sharing options...
Explv Posted December 2, 2015 Share Posted December 2, 2015 So i am currently in the making of a script which interacts with an object. And it keeps on spam clicking the object. I have the code below after my interaction with the object. sleep(random(4000, 7000)); Even after using the code above it will spam click every 1 seconds. Are you sure its not the rest of your code? :xdoge: 1 Quote Link to comment Share on other sites More sharing options...
Novak Posted December 2, 2015 Share Posted December 2, 2015 show the rest of the code Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted December 2, 2015 Share Posted December 2, 2015 (edited) It works just fine Show us your code ^^ Edited December 2, 2015 by Khaleesi Scripts 1 Quote Link to comment Share on other sites More sharing options...
September Posted December 2, 2015 Author Share Posted December 2, 2015 Are you sure its not the rest of your code? show the rest of the code It works just fine Show us your code ^^ This is from my stealing state Entity chest = objects.closest("Chest"); if (!myPlayer().isAnimating() && chest != null) { chest.interact("Search for traps"); sleep(random(4000, 7000)); } I'm very inexperienced when it comes to coding but i'm going to take a guess maybe the sleep line doesn't trigger because the interacting makes the if statement false? Quote Link to comment Share on other sites More sharing options...
eatshrimp Posted December 2, 2015 Share Posted December 2, 2015 This is from my stealing state Entity chest = objects.closest("Chest"); if (!myPlayer().isAnimating() && chest != null) { chest.interact("Search for traps"); sleep(random(4000, 7000)); } I'm very inexperienced when it comes to coding but i'm going to take a guess maybe the sleep line doesn't trigger because the interacting makes the if statement false? The bot isn't checking for traps either right? It's because your if statement conditional isn't resolving to true, and you have code after this block that's actually doing the spam clicking. Quote Link to comment Share on other sites More sharing options...
Explv Posted December 2, 2015 Share Posted December 2, 2015 Problem has been fixed. OSBot seemed to be using an old version of the script (that didn't contain the sleep). Deleting OSBot folder and rebuilding script solved it. 2 Quote Link to comment Share on other sites More sharing options...