stop clicking on the spot where it is clicked before

Asked by VICK

i want to click randomly but not want to click again on the spot where it was clicked before. How I can do that pl?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

use a sequence of
loc = Location(some-x, some-y) # or any other location

for i in range(10)
    click(loc)
    offsetX = i*3 # these you might randomize again
    offsetY = i*3
    x = loc.x + offsetX
    y = loc.y + offsetY
    loc = Location(x,y)
    mousemove(loc)

may be you want to set moveMouseDelay to zero (look docs)

Revision history for this message
RaiMan (raimund-hocke) said :
#2

sorry for some rubbish: the mousemove() is not really needed

this would be sufficient:

loc = Location(some-x, some-y) # or any other location

for i in range(10)
    click(loc)
    offsetX = i*3 # these you might randomize again
    offsetY = i*3
    x = loc.x + offsetX
    y = loc.y + offsetY
    loc = Location(x,y)

Revision history for this message
VICK (vbpatel73) said :
#3

Thanks RaiMan, that solved my question.