Jump to content

Easy Sleeping Snippet


Kati2

Recommended Posts

 

 

I think you would be much better off using this (quick writeup)

public void newSleep(int min, int max) {
   int x = 0;
   do {
      x = gRandom(min,max,(double)(max-min)/2);
   } while (x < min || x > max);
   sleep(x);
}
This way you can refine it in certain areas of your code, instead of it being generally around one area.

 

 

 

That's not as randomized as the method I posted, nor is it as simplified. 

I'd have to disagree.  I did a little bit of statistical analysis on your method:

 

Case one yields an average range of 750 to 2000 if not using a dynamic base. 

Case one yields an average range of 250 to 1500 if using a dynamic base. 

 

Case two yields an average range of 750 to 1675 if not using a dynamic base.

Case two yields an average range of 50 to 975 if using a dynamic base.

 

Case three yields an average range of 750 to 1675 if not using a dynamic base.

Case three yields an average range of 23 to 948 if using a dynamic base.

 

(all of these are bell curves with their peak at the mean)

 

If you logged every time the bot slept, you would have a graph that looks like 2 or 3 superimposed bell curves (or 5 if you randomly use the dynamic base).

 

To have something truly random, you have to use this method along with a way of changing the base to better suit your needs in a script.  Such as an action that requires 1 tick compared to something that needs 5.  If you slept the same way every time, it would look obvious by the randomness of it.

 

By default, humans are not random.  There was a study done that asked a human to flick on and off a light switch in a random pattern.  The study concluded that there was a non-random pattern that the person followed subconsciously.  When humans do actions, they get tuned to what they are doing.  It is very easy to keep the beat in a song, compared to trying to play something in random intervals.  Its not how our brains work.

 

This is a very well written video explaining what I'm walking about http://www.youtube.com/watch?v=H2lJLXS3AYM

 

 

 

I'm very aware of the constant patterns in subconcious timing. When flipping a lightswitch you are aware that it flips on and off, two reasonable options, while only one is optional at a time. If you've gone up, your only option is to go down, meaning that your brain will naturally flip it at a constant rate. This isn't the same in RuneScape. There are many actions you can do, and they happen randomly. You don't attack an npc every 5.0 seconds, you may attack one at 1.2 seconds, attack another at 6.8 seconds, then another at 9.1 seconds. The randomized core of RuneScape's engine, the random hits, the random spawns. The set delays are the only ticks that would be remembered by your brain. Even so, the numbers are changeable for a reason. Everyone would have their own set "ticks" they'd be accustom to using, which is why you can change the sleeps, add more, or remove some.

 

Thanks for the nice discussion!

Link to comment
Share on other sites

 

 

 

I think you would be much better off using this (quick writeup)

public void newSleep(int min, int max) {
   int x = 0;
   do {
      x = gRandom(min,max,(double)(max-min)/2);
   } while (x < min || x > max);
   sleep(x);
}
This way you can refine it in certain areas of your code, instead of it being generally around one area.

 

 

 

That's not as randomized as the method I posted, nor is it as simplified. 

I'd have to disagree.  I did a little bit of statistical analysis on your method:

 

Case one yields an average range of 750 to 2000 if not using a dynamic base. 

Case one yields an average range of 250 to 1500 if using a dynamic base. 

 

Case two yields an average range of 750 to 1675 if not using a dynamic base.

Case two yields an average range of 50 to 975 if using a dynamic base.

 

Case three yields an average range of 750 to 1675 if not using a dynamic base.

Case three yields an average range of 23 to 948 if using a dynamic base.

 

(all of these are bell curves with their peak at the mean)

 

If you logged every time the bot slept, you would have a graph that looks like 2 or 3 superimposed bell curves (or 5 if you randomly use the dynamic base).

 

To have something truly random, you have to use this method along with a way of changing the base to better suit your needs in a script.  Such as an action that requires 1 tick compared to something that needs 5.  If you slept the same way every time, it would look obvious by the randomness of it.

 

By default, humans are not random.  There was a study done that asked a human to flick on and off a light switch in a random pattern.  The study concluded that there was a non-random pattern that the person followed subconsciously.  When humans do actions, they get tuned to what they are doing.  It is very easy to keep the beat in a song, compared to trying to play something in random intervals.  Its not how our brains work.

 

This is a very well written video explaining what I'm walking about http://www.youtube.com/watch?v=H2lJLXS3AYM

 

 

 

I'm very aware of the constant patterns in subconcious timing. When flipping a lightswitch you are aware that it flips on and off, two reasonable options, while only one is optional at a time. If you've gone up, your only option is to go down, meaning that your brain will naturally flip it at a constant rate. This isn't the same in RuneScape. There are many actions you can do, and they happen randomly. You don't attack an npc every 5.0 seconds, you may attack one at 1.2 seconds, attack another at 6.8 seconds, then another at 9.1 seconds. The randomized core of RuneScape's engine, the random hits, the random spawns. The set delays are the only ticks that would be remembered by your brain. Even so, the numbers are changeable for a reason. Everyone would have their own set "ticks" they'd be accustom to using, which is why you can change the sleeps, add more, or remove some.

 

Thanks for the nice discussion!

 

If you wanted to achieve that type of randomness you would have to do a dynamic sleep then add that. This is because the dynamic sleep only acts when the condition is false. So if you were to attack an Npc with your sleep it would try to click it at random intervals which might mean the npc is still not dead. With a dynamic sleep it would wait for the npc to die, then you can implement that type of sleep which would make it wait before the next attack

  • Like 1
Link to comment
Share on other sites

 

I'm very aware of the constant patterns in subconcious timing. When flipping a lightswitch you are aware that it flips on and off, two reasonable options, while only one is optional at a time. If you've gone up, your only option is to go down, meaning that your brain will naturally flip it at a constant rate. This isn't the same in RuneScape. There are many actions you can do, and they happen randomly. You don't attack an npc every 5.0 seconds, you may attack one at 1.2 seconds, attack another at 6.8 seconds, then another at 9.1 seconds. The randomized core of RuneScape's engine, the random hits, the random spawns. The set delays are the only ticks that would be remembered by your brain. Even so, the numbers are changeable for a reason. Everyone would have their own set "ticks" they'd be accustom to using, which is why you can change the sleeps, add more, or remove some.

 

Thanks for the nice discussion!

 

 

No problem :P

 

I feel you didn't understand the test:

 

If the light switch was already down, keeping it down is still an option.  All I was trying to say was it needs a semi-dynamic base that the user can manipulate.

  • Like 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...