FooBar Posted March 4, 2015 Share Posted March 4, 2015 (edited) Hello everyone, I am currently not planning on writing any scripts for OSBOT at this current moment in time but I may consider scripting in the upcoming months. One thing I have realised in almost every script I have tested is that there is almost no bot that uses dynamic sleeping. Runescape detects patterns in bots and bans the accounts associated if they detect a pattern. Now I am no runescape botting veteran but if I'm correct a static sleep time will enable Jagex to detect a pattern so I thought I would quickly just include a small snippet for dynamic sleeps for all the devs out there. *By sleep times I am referring to the wait time between different interactions. private void randomSleep() { int i; i = Random.nextInt(450,3000); try { ConditionalSleep(i); } catch (InterruptedException e) { e.printStackTrace(); } } Thank you everyone for such a nice welcome and I should be seeing everyone else around the forums a lot more. James **Special thanks to www.krimsky.net for improving the function. Edited March 4, 2015 by Jamesmallon1 Quote Link to comment Share on other sites More sharing options...
Isolate Posted March 4, 2015 Share Posted March 4, 2015 (edited) :') i'm sure most people just do this sleep(random(450,3000)); Edited March 4, 2015 by Isolate Quote Link to comment Share on other sites More sharing options...
Lemons Posted March 4, 2015 Share Posted March 4, 2015 Umm... how is this a dynamic sleep? More of a what not to do :P Quote Link to comment Share on other sites More sharing options...
FooBar Posted March 4, 2015 Author Share Posted March 4, 2015 (edited) Please enlighten me, I know simply nothing about this API, however I have worked in partnership with firms such as google and amazon developing software. So I can tell you that I am well versed in Java, JavaScript, C++ and C sharp Please try not to patronise and deter new developers and users from posting or using the software. ** I was simply trying to draw developers attention to the fact that there are too many static sleeps. James Edited March 4, 2015 by Jamesmallon1 Quote Link to comment Share on other sites More sharing options...
Lemons Posted March 4, 2015 Share Posted March 4, 2015 (edited) Please enlighten me, I know simply nothing about this API, however I have worked in partnership with firms such as google and amazon developing software. So I can tell you that I am well versed in Java, JavaScript, C++ and C sharp Please try not to patronise and deter new developers and users from posting or using the software. James Don't show up somewhere you don't know acting like you know how it works. for (int i = 0; i < 40 && myPlayer().isMoving(); i++) sleep(100); That will check every 100ms that the player is moving, and if either 40 loops (~4 seconds) or the player stops moving it will stop. Edited March 4, 2015 by dudeami Quote Link to comment Share on other sites More sharing options...
Acerd Posted March 4, 2015 Share Posted March 4, 2015 Don't show up somewhere you don't know acting like you know how it works. for (int i = 0; i < 40 && myPlayer().isMoving(); i++) sleep(100); That will check every 100ms that the player is moving, and if either 40 loops (~4 seconds) or the player stops moving it will stop. give him a break geez Quote Link to comment Share on other sites More sharing options...
Kristoffer OSBot Posted March 4, 2015 Share Posted March 4, 2015 This is a dynamic (aka conditional) sleep: http://osbot.org/api/org/osbot/rs07/utility/ConditionalSleep.html Quote Link to comment Share on other sites More sharing options...
Lemons Posted March 4, 2015 Share Posted March 4, 2015 (edited) give him a break geez Well he acted like I gave a damn where he worked before, maybe he should ask for help instead of just posting misleading code that could actually harm new developers. This is a dynamic (aka conditional) sleep: http://osbot.org/api/org/osbot/rs07/utility/ConditionalSleep.html That is also another valid way ^^ I like my for loops though :p Edited March 4, 2015 by dudeami Quote Link to comment Share on other sites More sharing options...
Alek Posted March 4, 2015 Share Posted March 4, 2015 That's not really dynamic because it still creates a pattern. Furthermore I would be safe to say that a majority of bans stem from either client detection (which we are working on), average bot play time vs average human play time, account age, and activities that you are botting. In regards to what sleeps you should be using here at OSBot (or botting in general), it should be conditional. What happens if you get a lag spike and your sleep time of 1kms isn't enough before the next action? Either it will fail the next action or loop through your logic again. Take a look here: http://osbot.org/api/org/osbot/rs07/utility/ConditionalSleep.html 2 Quote Link to comment Share on other sites More sharing options...
Isolate Posted March 4, 2015 Share Posted March 4, 2015 That's not really dynamic because it still creates a pattern. Furthermore I would be safe to say that a majority of bans stem from either client detection (which we are working on), average bot play time vs average human play time, account age, and activities that you are botting. In regards to what sleeps you should be using here at OSBot (or botting in general), it should be conditional. What happens if you get a lag spike and your sleep time of 1kms isn't enough before the next action? Either it will fail the next action or loop through your logic again. Take a look here: http://osbot.org/api/org/osbot/rs07/utility/ConditionalSleep.html Would be great if things like this were put in api checks though.... Quote Link to comment Share on other sites More sharing options...
FooBar Posted March 4, 2015 Author Share Posted March 4, 2015 Never at any point did I pretend I knew anything about "how it works". Now I am no runescape botting veteran but if I'm correct a static sleep time will enable Jagex to detect a pattern so I thought I would quickly just include a small snippet for dynamic sleeps for all the devs out there. I simply don't understand when all I am trying to do is improve peoples scripts that I get slated. Programming is no competition it is the combination of many skill sets that creates great code. I still stand by my sleep function as anyone is able to implement the raw function or its concept. I only want to help, and by no means I do not believe the knowledge I have from a computer science degree and 8 years in the industry is going to hinder people. Please do not treat this as a competition, That's not really dynamic because it still creates a pattern. Furthermore I would be safe to say that a majority of bans stem from either client detection (which we are working on), average bot play time vs average human play time, account age, and activities that you are botting. In regards to what sleeps you should be using here at OSBot (or botting in general), it should be conditional. What happens if you get a lag spike and your sleep time of 1kms isn't enough before the next action? Either it will fail the next action or loop through your logic again. Take a look here: http://osbot.org/api/org/osbot/rs07/utility/ConditionalSleep.html This user here is brilliant, He critiqued me and gave a brilliant explanation of why my sleep method wasn't up to scratch and helped me improve. Thank you, James 2 Quote Link to comment Share on other sites More sharing options...
Lemons Posted March 4, 2015 Share Posted March 4, 2015 By posting the code saying its a Dynamic Sleep (with really not knowing what it means in the context of botting), in the tutorial section, seems to me your stating this is how sleeps should be done (when its not). If you don't have experience in coding for bots, why are you posting tutorials? If your looking for critique, you should post in a proper forum. Sorry, I'm not a nice person like Alek. Quote Link to comment Share on other sites More sharing options...
FooBar Posted March 4, 2015 Author Share Posted March 4, 2015 (edited) hahah jeese alright mate. All I'm saying is that function that I wrote will improve all of the static sleep functions that I am consistently seeing in many bots and snippets. it might not be the optimum way but its a hell of an improvement from the majority of what I've seen Some people just want to watch the world burn I guess. Edited March 4, 2015 by Jamesmallon1 Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted March 4, 2015 Share Posted March 4, 2015 (edited) Burn Burn! Conditional sleeps to stronk If you would read the APi for 2 minutes you would have found there was a object called Contional sleep Where you can pass a time + condition to sleep + I'm pretty sure almost every script here uses random sleep times... Edit your first post to the perfect way, instead leaving it there in the wrong way ;) misleads new scripters ^^ Edited March 4, 2015 by Khaleesi Quote Link to comment Share on other sites More sharing options...
FooBar Posted March 4, 2015 Author Share Posted March 4, 2015 (edited) hahaah, Okay mate I will in future, fuck it I'll have a good crack at writing my own script for something just so i don't look like a twat in future. Ill go have a wee look in the in the requests section. Cheers ** will do Edited March 4, 2015 by Jamesmallon1 2 Quote Link to comment Share on other sites More sharing options...