← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #692019]: [request] 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:
I am a bit lost.

My interpretation of your request was twofold:
- If you click on a found image, don't click in the center, but on some random spot in the image
- If you move the mouse from one spot to another one, don't use straight line, but random path.
Unfortunately these two aspects got somehow mixed in the solutions presented so far.

For just the "random" equivalent of

if exists("1595917673821.png"):
        click("1595917673821.png")
        wait(random.randint(5,10))

I suggest

if exists("1595917673821.png"):
        mouseMoveRandom(gestlastmatch(), 50, 50) # move the mouse randomly to a random spot in the image
        click(Mouse.at()) # do a mouse-click where the mouse currently is
        wait(random.randint(5,10))

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