← 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

    Status: Open => Answered

RaiMan proposed the following answer:
The base feature is mouseMove(aLocation) or hover(), which moves the
mouse from the current location (x,y) to the given location.

In the standard a mouse move from a to b takes 0.5 seconds and is a move on a straight line with decreasing steps towards the target.
As such it is already a bit more human-like, then just moving the mouse to b without any delay.

If you want to move the mouse along some curved line, you have to create a function, that calculates the interpolated coordinates of that curve (the more steps, the smoother).
then a series of mouseMove() (with Settings.moveMouseDelay=0) along that list of coordinates finally does what you want.
Be aware: each step on the line itself is a straight move. So a movement like in your example needs an appropriate amount of steps to make it smooth.

I would also like to know, why you think you need that.

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