sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #14920
[Question #215825]: Clicking at different offset of a last match
New question #215825 on Sikuli:
https://answers.launchpad.net/sikuli/+question/215825
Hi,
I have a set of test which I do the below:
while not exists(mines.png):
wait(1)
x,y= mine_coord(mine) #a def which I pre-define special coordinates I would like to click base on the conditions
lastmatch = getLastMatch()
click (Pattern("mines.png").targetOffset(x,y)) #first time I search for mines.png
click("giveup.png")
click("confirm.png")
click (Pattern("mines.png").targetOffset(x,y)) #2nd time I search for mines.png
click("occupy.png")
these sets of codes works find normally, but there are times where the click on "mines.png" didn't work because it couldn't be found, although it has pass the exists condition
I was trying to use "getLastMatch()" to increase the stability of the code, but find that it has no attribute 'targetOffset'... is there anyway other ways I can improve the stability of this code?
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.