Help with Random

Asked by Richard Vela

I am currently exploring ways to randomize my code so that it becomes less predictable and more human like for a game I play. I have explored methods using import random function but all I have been able to do is randomize my sleep or wait time between two values. Such as sleep(random.randint(10,20)). Although this seems to be an effective way to randomize wait times to surpass bot detection, it seems flawed over long periods of time because 10-20 seconds will average to 15. Is there a way to add a third variable to help truly randomize my sleep/wait times? Also, can sikuli be changed to MS instead of seconds??

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Richard Vela (socalemt) said :
#1

Will this work??
 ——Code——

Import random

Click(image)
Wait(random.randint(10,20)*(random.random()))

Revision history for this message
Chetan (cshamdas) said :
#2
Revision history for this message
Richard Vela (socalemt) said :
#3

That post has to do with movement of the mouse. This did not help, but thank you.

Revision history for this message
Chetan (cshamdas) said :
#4

ok understood then earlier solution posted by Richard should work

Revision history for this message
TestMechanic (ndinev) said :
#5

You can use milliseconds in sikuli -> for example 0.1 is 100ms

For making random more random you can seed your random with time

import random
import time
random.seed(time.time())

Revision history for this message
Richard Vela (socalemt) said :
#6

So would it be:

random.seed(time.time(10,20))

??

Also, how would this be more random? Would it avoid the problem of averaging over time?

Revision history for this message
Richard Vela (socalemt) said :
#7

Random.randint didn’t seem to work between two numbers with decimals.

For example:

wait(random.randint(10.9, 20.8))

Revision history for this message
TestMechanic (ndinev) said :
#8

Int means integer. You are asking for randint and getting it

Can you help with this problem?

Provide an answer of your own, or ask Richard Vela for more information if necessary.

To post a message you must log in.