Sikuli how to check multiple images at the same time
Sikuli
I need to check if there is a specific area in which there are images that I want to click and the images will appear randomly, I am writing a code to check that, however, it takes more than 10 seconds to test the area, is there anyway I can shorten the time.
Settings.MinSimilarity = 0.95
Reg = Region(582,404,214,187)
img = capture(Reg)
search = True
Settings.MoveMouseDelay = 0
while search :
if Reg.exists("12.png") or Reg.exists("13.png") or Reg.exists("14.png")or Reg.exists("15.png")or Reg.exists("28.png"):
click(Reg.getLastMatch())
search = False
+3
source to share
1 answer
You can add a parameter 0
to the call exists()
.
So instead of
if Reg.exists("12.png") or Reg.exists("13.png") or Reg.exists("14.png")or Reg.exists("15.png")or Reg.exists("28.png"):
You will have:
if Reg.exists("12.png",0) or Reg.exists("13.png",0) or Reg.exists("14.png",0)or Reg.exists("15.png",0)or Reg.exists("28.png",0):
According to this , a null parameter means that
0 as the second parameter for the existence of forces, only one lookup is performed and the result is returned immediately. It doesn't wait for the standard 3 seconds, so it's very responsive.
The smaller the area, the faster it will be.
0
source to share