Results 1 to 14 of 14

Thread: QUESITON: Using wait, randomRange, and random as basic anti-ban

  1. #1
    Join Date
    Aug 2014
    Location
    Australia
    Posts
    932
    Mentioned
    53 Post(s)
    Quoted
    495 Post(s)

    Default QUESITON: Using wait, randomRange, and random as basic anti-ban

    Sup,

    I'm using "wait(randomRange(int, int))" as basic anti-ban between some actions in my scripts, but I think that waiting for a period between two values like "500" and "1000" every time the script goes through the procedure is far too bot-like and would be the exact kind of thing that Jagex would detect. A little bit of searching found that you can add "+ random(int)" inside of randomRange() for even more randomness, like this:

    Simba Code:
    wait(randomRange(500 + random(50), 1000 + random(50)));

    But I'm unsure as to just how much or little would would be necessary. Should I stick to small numbers (20-50) for smaller ranges, and larger numbers (200-500) for larger ranges, or should I be just be sticking to smaller ranges for everything? Or, should I just scrap the idea altogether?

    Finally, am I actually understanding random(int) right? I can't find any documentation for it... it does actually return a random int between 0 and the given int, right?

    Thanks for the help.

  2. #2
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    By adding those extra random 50ms all you're doing is making the time to wait between 500ms and 1050ms, so there's still a static window and there always will be. Instead of using a random range you could just do a random wait, so going from 0 to, for example, 5000ms. That might look a bit more human like as the human could delay by something as small as 10ms.

    And you're right on Random; that's exactly what it does.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  3. #3
    Join Date
    Aug 2014
    Location
    Australia
    Posts
    932
    Mentioned
    53 Post(s)
    Quoted
    495 Post(s)

    Default

    Quote Originally Posted by Rich View Post
    By adding those extra random 50ms all you're doing is making the time to wait between 500ms and 1050ms, so there's still a static window and there always will be. Instead of using a random range you could just do a random wait, so going from 0 to, for example, 5000ms. That might look a bit more human like as the human could delay by something as small as 10ms.

    And you're right on Random; that's exactly what it does.
    My idea is that the static window would look less like a human wrote it if you added a random to it. For example, I have a bad habit of always writing neat wait times between numbers divisible by 500, and that sounds far too neat and scripted to me. If that static window was between 486 and 1072 instead of 500 and 1000, wouldn't that look more human?

    I'm not quite sure I follow the second half of your post, are you suggesting using a really long wait time so that the ms returned is in a much larger range? Because that sounds inefficient when you just want to wait a short amount of time, but don't want to move on to the next action almost instantly.

    Thanks.

    EDIT: I suppose that you could even use GetTimeRunning to change the window after a random amount of time, but that could just be too much...
    Last edited by Incurable; 08-25-2014 at 12:40 PM.

  4. #4
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    I suppose using more obscure numbers do make sense.

    And I was just giving 5000ms as an example. What I mean is that instead of using a range of 500ms and 1000ms like you gave in your first post you could simply use a Random(1000) (or something like 1092 for a more obscure number), because a human might not always pause for a minimum of half a second; it could be a very brief delay.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  5. #5
    Join Date
    Aug 2014
    Location
    Australia
    Posts
    932
    Mentioned
    53 Post(s)
    Quoted
    495 Post(s)

    Default

    I get it now, thank you, but wouldn't random(1000) have a chance of returning a very low number like 30, therefore making the next action almost instant, hence the use of randomRange?

    I'm sorry if my questions are repetitive, thanks again.

    EDIT: I think I'm just going to have to remember to force myself to use obscure numbers on top of randomness, as you suggested.

  6. #6
    Join Date
    Jun 2012
    Posts
    122
    Mentioned
    0 Post(s)
    Quoted
    40 Post(s)

    Default

    Quote Originally Posted by Incurable View Post
    I get it now, thank you, but wouldn't random(1000) have a chance of returning a very low number like 30, therefore making the next action almost instant, hence the use of randomRange?

    I'm sorry if my questions are repetitive, thanks again.

    EDIT: I think I'm just going to have to remember to force myself to use obscure numbers on top of randomness, as you suggested.
    Yes. To avoid the almost instant you want a lower bound and a higher bound. If I am not mistaken the higher bound is exclusive. So code like this:
    Code:
    randomRange(1, 10);
    Can produce:
    Code:
    1, 2, 3...9

  7. #7
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by Incurable View Post
    I get it now, thank you, but wouldn't random(1000) have a chance of returning a very low number like 30, therefore making the next action almost instant, hence the use of randomRange?

    I'm sorry if my questions are repetitive, thanks again.

    EDIT: I think I'm just going to have to remember to force myself to use obscure numbers on top of randomness, as you suggested.
    The numbers are random, so there is just as big a chance of RandomRange(0,1000) returning 599, as there is for it returning 1, the chance in this case for any number from 0, to 999 is "1 in 1000". If you add another Random(50) to that.. you simply write RandomRange(0,1050) in a more clumsy way, as mentioned. It does not make it "more random", random+random=random no matter what you do.


    An alternative to a random number, is to use a gaussian function to produce a normally distributed number, a number that usually ends up as `mean` +/- the `standard deviation`, but it has the property to generate peaks that are (much) further away then the standard dev, making it very optimal for things like these.
    Simba Code:
    (*
     Mu is the mean, sigma is the standard deviation.
    *)

    procedure GaussWait(Mu,Sigma:Double; vmin:Double=30);
    var t,g:Double;
    begin
      t := 2 * PI * Random();
      g := mu + (sigma * Sqrt(-2 * Ln(Random()))) * Cos(t);
      // WriteLn('Waiting: ', Round( MaxE(g,vmin) ),'ms');
      Wait(Round(MaxE(g,vmin)));
    end;

    begin
      //wait normally around 700ms +/- 200ms, except for peaks which will/can go far above, or far below.
      GaussWait(700,200);
    end.
    The example code, could peak as low as 30 (a limit is set), and over 1600ms, but usually ends up between 500 and 900ms.
    Last edited by slacky; 08-25-2014 at 12:58 PM.
    !No priv. messages please

  8. #8
    Join Date
    Aug 2014
    Location
    Australia
    Posts
    932
    Mentioned
    53 Post(s)
    Quoted
    495 Post(s)

    Default

    Quote Originally Posted by slacky View Post
    The numbers are random, so there is just as big a chance of RandomRange(0,1000) returning 599, as there is for it returning 1, the chance in this case for any number from 0, to 999 is "1 in 1000". If you add another Random(50) to that.. you simply write RandomRange(0,1050) in a more clumsy way, as mentioned. It does not make it "more random", random+random=random no matter what you do.


    An alternative to a random number, is to use a gaussian function to produce a normally distributed number, a number that usually ends up as `mean` +/- the `standard deviation`, but it has the property to generate peaks that are (much) further away then the standard dev, making it very optimal for things like these.
    Simba Code:
    (*
     Mu is the mean, sigma is the standard deviation.
    *)

    procedure GaussWait(Mu,Sigma:Double; vmin:Double=30);
    var t,g:Double;
    begin
      t := 2 * PI * Random();
      g := mu + (sigma * Sqrt(-2 * Ln(Random()))) * Cos(t);
      // WriteLn('Waiting: ', Round( MaxE(g,vmin) ),'ms');
      Wait(Round(MaxE(g,vmin)));
    end;

    begin
      //wait normally around 700ms +/- 200ms, except for peaks which will/can go far above, or far below.
      GaussWait(700,200);
    end.
    The example code, could peak as low as 30 (a limit is set), and over 1600ms, but usually ends up between 500 and 900ms.
    That explanation made perfect sense, thank you.

    GaussWait looks very interesting, could you expand on the names of the variables used? I understand how it works (I think), but I'm not sure what vmin, t, g, Ln, and MaxE are and I would like to know before I steal it. Scrap that, I Googled the crap out of it. That is a wicked procedure and I'll be using it, thank you for sharing.
    Last edited by Incurable; 08-25-2014 at 01:57 PM.

  9. #9
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by Incurable View Post
    That explanation made perfect sense, thank you.

    GaussWait looks very interesting, could you expand on the names of the variables used? I understand how it works (I think), but I'm not sure what vmin, t, g, Ln, and MaxE are and I would like to know before I steal it.

    Thank you to everyone who posted.
    `g`: short for gaussian, it holds the produced value, this number gets limited by a lower bound (vmin), otherwise it could "peak" to a negative number if the Sigma (std dev) is too high compared to Mu (mean),
    and that is something we don't want in this case.

    `vmin`: is the minimum waittime allowed in the GaussWait-function, it's automaticly set to 30ms, which might seem a bit low (depending on what's happening next).
    But controlling the vmin to much makes the outcome more predictable, as it's more controlled, which is of course not a good thing. So I default it at 30ms, as I don't want it to limit to many lower-value peaks.
    - You should never need change it, unless it's to set it even lower. Decrease the sigma if anything, that will also limit the peaks, but in a better manner..

    `t`: is just short for theta, and is part of what produces the "angle" (in radians) which we "project" our outcome value at.
    * Function can easly be modified to spit out two independent cartesian-values, one for x, and one for y, not that it matter now, but maybe it helps you to wrap your head around what's actually happening.

    `MaxE`: is a function that returns the larger of the two given floating-point numbers, MaxE(1.0, 10.0) would return 10.0.

    `Ln`: computes the natural logarithm of a number.

    `Random()`: produces a random floating point value between 0.0 and 1.0.
    Last edited by slacky; 08-27-2014 at 10:13 AM.
    !No priv. messages please

  10. #10
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    My bad, I skim-read your first post and didn't see that this was for waiting between separate action, just assumed it was a standalone anti-ban method!
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  11. #11
    Join Date
    Aug 2014
    Location
    Australia
    Posts
    932
    Mentioned
    53 Post(s)
    Quoted
    495 Post(s)

    Default

    Quote Originally Posted by slacky View Post
    -snip-
    Thank you, it's much appreciated. I'm already in love with GaussWait.


    Quote Originally Posted by Rich View Post
    My bad, I skim-read your first post and didn't see that this was for waiting between separate action, just assumed it was a standalone anti-ban method!
    No problem, thanks anyway!

  12. #12
    Join Date
    Nov 2012
    Location
    OKC
    Posts
    123
    Mentioned
    5 Post(s)
    Quoted
    56 Post(s)

    Default

    Why not just use the built in anitban that comes packaged with srl?

  13. #13
    Join Date
    Aug 2014
    Location
    Australia
    Posts
    932
    Mentioned
    53 Post(s)
    Quoted
    495 Post(s)

    Default

    Quote Originally Posted by o0Matthius0o View Post
    Why not just use the built in anitban that comes packaged with srl?
    I do, I was just asking about waiting between actions.

  14. #14
    Join Date
    Nov 2012
    Location
    OKC
    Posts
    123
    Mentioned
    5 Post(s)
    Quoted
    56 Post(s)

    Default

    Quote Originally Posted by Incurable View Post
    I do, I was just asking about waiting between actions.
    Ohhh... my bad lol. I thought you were trying to re create your own anti ban. Which is a mistake I made.ugh... I was so relieved when I found all the built in anti ban

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •