Results 1 to 10 of 10

Thread: Randomization

  1. #1
    Join Date
    Feb 2012
    Posts
    170
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default Randomization

    I'm assuming the random() function has the same odds for each number, it's just as it goes, random. Now I'm wondering if we have any functions for bell curve randomness//normal random curves. As I believe those would be much more human like for clicking on buttons (you'll normally hit the center, and less and less often click the edges).

    I found gaussRandom but I don't think this is the same thing as a normal curve.

    Thanks


    Edit: what would it look like if you did random(1) and just added it up however many times, basically using the normal-curve-ness of a coin flip to create a normal bell curve.
    Non-RS scripter, if you need a hand with scripting let me know. I have a decent amount of experience scripting for non-RS games.

    How to add text messaging to any script: http://villavu.com/forum/showthread....98#post1151998

  2. #2
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    You could put a mousebox for the center in a random case statement that will 70% of the time use that option and the rest use a larger mousebox

    Something along these lines?

    Code:
    Case Of Random(10)
    Begin
       0..7 : Begin MouseBox(10, 10, 10, 10) End;
       8..10 : Begin MouseBox(20, 20, 20, 20) End;
    End;
    Last edited by DannyRS; 01-05-2013 at 07:46 AM.


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  3. #3
    Join Date
    Feb 2012
    Posts
    170
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    You could put a mousebox for the center in a random case statement that will 70% of the time use that option and the rest use a larger mousebox
    400 edited mouse boxes and if statements later...

    :s gotta be a simpler way to do it.
    Non-RS scripter, if you need a hand with scripting let me know. I have a decent amount of experience scripting for non-RS games.

    How to add text messaging to any script: http://villavu.com/forum/showthread....98#post1151998

  4. #4
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by xdarkshadowx View Post
    400 edited mouse boxes and if statements later...

    :s gotta be a simpler way to do it.
    Sorry musta misunderstood what your trying to do , not sure then

    Edited my first post to show what i meant, i think it would simulate what you want
    Last edited by DannyRS; 01-05-2013 at 07:54 AM.


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  5. #5
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Quote Originally Posted by xdarkshadowx View Post
    I'm assuming the random() function has the same odds for each number, it's just as it goes, random. Now I'm wondering if we have any functions for bell curve randomness//normal random curves. As I believe those would be much more human like for clicking on buttons (you'll normally hit the center, and less and less often click the edges).

    I found gaussRandom but I don't think this is the same thing as a normal curve.

    Thanks


    Edit: what would it look like if you did random(1) and just added it up however many times, basically using the normal-curve-ness of a coin flip to create a normal bell curve.
    What do you mean by 'normal random curves'? If it means a normal distribution, that is exactly what the gauss functions does (and MouseBox uses it as well).

    But you mentioned about 'normal-curve-ness of a coin flip'? Can you elaborate on that?

  6. #6
    Join Date
    Feb 2012
    Posts
    170
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    What do you mean by 'normal random curves'? If it means a normal distribution, that is exactly what the gauss functions does (and MouseBox uses it as well).

    But you mentioned about 'normal-curve-ness of a coin flip'? Can you elaborate on that?
    Yes the normal distribution, but the gauss function doesn't have any imputs for standard deviation ect, so I'm trying to figure out what kind of random curve it makes.


    if you flip a coin, you'll either get heads or tails (1 or 0 in this case). now if you keep going you'll end up with pascals triangle, which mimicks a normal distribution if I recall correctly.
    Non-RS scripter, if you need a hand with scripting let me know. I have a decent amount of experience scripting for non-RS games.

    How to add text messaging to any script: http://villavu.com/forum/showthread....98#post1151998

  7. #7
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Quote Originally Posted by xdarkshadowx View Post
    Yes the normal distribution, but the gauss function doesn't have any imputs for standard deviation ect, so I'm trying to figure out what kind of random curve it makes.


    if you flip a coin, you'll either get heads or tails (1 or 0 in this case). now if you keep going you'll end up with pascals triangle, which mimicks a normal distribution if I recall correctly.
    One of them generates a standard normal curve (mean 0 SD 1), you can use
    Simba Code:
    function GaussRand(mean, dev: Extended): Extended;
    for customized mean and dev.

    Flipping a coin is a binomial distribution which can be approximate to a normal distribution, of which the accuracy increases as sample size increases.

  8. #8
    Join Date
    Feb 2012
    Posts
    170
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    One of them generates a standard normal curve (mean 0 SD 1), you can use
    Simba Code:
    function GaussRand(mean, dev: Extended): Extended;
    for customized mean and dev.

    Flipping a coin is a binomial distribution which can be approximate to a normal distribution, of which the accuracy increases as sample size increases.
    Yes Yes yes, you're right. now my only dillema is that the GaussRand function has no bounds (whereas I could easily give a binomial curve bounds). Now to decide how to randomize from now on..

    Mostly just worried that the computer will decide to hate me and generate a number that +/- 5 or so SD and totally kill itself
    Non-RS scripter, if you need a hand with scripting let me know. I have a decent amount of experience scripting for non-RS games.

    How to add text messaging to any script: http://villavu.com/forum/showthread....98#post1151998

  9. #9
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Quote Originally Posted by xdarkshadowx View Post
    Yes Yes yes, you're right. now my only dillema is that the GaussRand function has no bounds (whereas I could easily give a binomial curve bounds). Now to decide how to randomize from now on..

    Mostly just worried that the computer will decide to hate me and generate a number that +/- 5 or so SD and totally kill itself
    You can simply set up a simple loop to regenerate the numbers until it is within the intended bounds. Technically this won't be a normal distribution anymore (since an actual normal dist extends to +/- infinity), but that's the most accurate way to model a practical situation after the normal distribution.

  10. #10
    Join Date
    Feb 2012
    Posts
    170
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    You can simply set up a simple loop to regenerate the numbers until it is within the intended bounds. Technically this won't be a normal distribution anymore (since an actual normal dist extends to +/- infinity), but that's the most accurate way to model a practical situation after the normal distribution.
    Perfect Idea, Thank you
    Non-RS scripter, if you need a hand with scripting let me know. I have a decent amount of experience scripting for non-RS games.

    How to add text messaging to any script: http://villavu.com/forum/showthread....98#post1151998

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
  •