I was hoping to find out a way to generate a random number (for use in a delay/sleep command) from a Gaussian distribution rather than a flat one. For example, if I'm trying to click consistently every ~1 minute while away from my computer, I would normally use a general click, sleep (rand, 50000, 70000), click loop. This would make the delay anywhere between 50-70 seconds between clicks, but there would be no weight towards any section of that range. Ideally, I would have all my clicks over a large period of time represent a normal/Gaussian distribution centered around 60,000 ms with a standard deviation of 5,000 ms, for example.
Is there a concise way of writing a script that would accomplish this? I was thinking something like a loop in which an integer is defined and assigned a value based on a given mean and standard deviation, but my thought was to use the mathematical function of a Gaussian curve with is... a bit cumbersome (roots, natural logs, etc.). I feel like there must be a much simpler/more concise way of doing this! Is there a Gaussian random command or something, which determines a random value given mean and std? Would the code be something like:
Code: Select all
loop 100
{
Click
int j = gaussian_random(mean, std)
sleep j
}