New question #665546 on Sikuli:

Hi! I'm new to Python (but not to coding) and there's something I'm trying to 
do but I'm not sure how to do it. 

I want to click an image that appears in the screen several times (not one 
after other, after clicking it one time it disappears and appears again after a 
while), but I don't want to click it always in the center, I want to click it 
each time in a random place inside the image. 

I've been messing with the Region class and the functions getTopLeft(), 
getBottonLeft() etc and the Random class of Python, I've changed my code a 
million times but I still can't figure it out. If you could help me it would be 
great. I've seen similar answers in the forum but I'm not sure how to implement 
them in my code. 

This is what I have:

import random
m = find(imageIwantToClick)

And I get this error:
[error] Error caused by: Traceback (most recent call last): File 
"C:\Users\Penguin\Documents\Sikuli Pruebas.sikuli\Sikuli", line 3, 
in <module> l = 
 File "C:\Users\Irene A\Desktop\Sikuli\sikulix.jar\Lib\", line 241, in 
randint TypeError: unsupported operand type(s) for +: 
'org.sikuli.script.Location' and 'int' 

>From what I understand, I always have to introduce an image inside the 
>function click() to make it work? But then, I don't know how to click in a 
>place that isn't an image, just a coordinate in the screen.

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

Mailing list:
Post to     :
Unsubscribe :
More help   :

Reply via email to