← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #692019]: Randomized mouse route from A to B?

 

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

Manfred Hampl proposed the following answer:
To randomly click somewhere inside a region, use something like

a = Region(x, y, w, h) # define a as region, either by giving its
coordinates, or as a match from a find action, etc.

click(Location(random.randint(a.getX(),a.getX()+a.getW()),random.randint(a.getY(),a.getY()+a.getH())))

Don't forget to initialize random at the beginning, e.g. with
random.seed()

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.