Jump to content

Dynamic Sleeping


FooBar

Recommended Posts

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 by Jamesmallon1
Link to comment
Share on other sites

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 by Jamesmallon1
Link to comment
Share on other sites

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 by dudeami
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by dudeami
Link to comment
Share on other sites

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

  • Like 2
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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 

  • Like 2
Link to comment
Share on other sites

 

 

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.

Link to comment
Share on other sites

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 by Jamesmallon1
Link to comment
Share on other sites

Burn Burn! biggrin.png

 

Conditional sleeps to stronk biggrin.png

If you would read the APi for 2 minutes you would have found there was a object called Contional sleep biggrin.png

Where you can pass a time + condition to sleep wink.png

 

+ 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 by Khaleesi
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...