← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #227548]: How do I get Sikuli to click randomly?

 

Question #227548 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/227548

    Status: Open => Answered

RaiMan proposed the following answer:
import random
r = someRegion
for i in range(100): # click randomly 100 times 
    locx = int(r.w * random.random()) 
    locy = int(r.h * random.random())
    click(Location(locx, locy))
    wait(0.3) # optional: some time for the GUI to react

random.random() returns a float between 0 and 1

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.