← Back to team overview

sikuli-driver team mailing list archive

[Question #263333]: searching for multiple images in multiple regions

 

New question #263333 on Sikuli:
https://answers.launchpad.net/sikuli/+question/263333

I have been reading questions on here for a week now and cant seem to find what i'm looking for so I figured i'd ask. i'm fairly new to sikuli. I made this script to look for 4 different images in four different regions. my problem is that I cant get the searches to execute quickly enough.  whats happening is it gets to the screen and searches for about 5 sec before moving on and search the next screen for 5 more seconds then repeats. by screen I mean mean gets to another window in the program im trying to work with. 

How would one go about cutting that time down some. I don't know much code but I like to try things for myself. any help would be greatly appreciated. I'll even consider pointing me in the right direction a big plus. 


while exists("imageholder.png",):
    click(x) #searching between two locations 
   
#First location

    if Region(region 1st 1).inside ().exists(Pattern("image1.png").exact(),0): 
   click(Location(xx,yy))
   elif Region(region 1st 2).inside ().exists(Pattern("image2.png").exact(),0): 
   click(Location(xx,yy)
   elif Region(region 1st 3).inside ().exists(Pattern("image3.png").exact(),0): 
   click(Location(xx,yy)   
   elif Region(region 1st 4).inside ().exists(Pattern("image4.png").exact(),0): 
   click(Location(xx,yy)

   click() # gets to next location to search

    if Region(1).inside ().exists(Pattern("image5.png").exact(),0): 
   click(Location(xx,yy))
   elif Region(2).inside ().exists(Pattern("image6.png").exact(),0): 
   click(Location(xx,yy)
   elif Region(3).inside ().exists(Pattern("image7.png").exact(),0): 
   click(Location(xx,yy)   
   elif Region(4).inside ().exists(Pattern("image8.png").exact(),0): 
   click(Location(xx,yy)

   click() # out to start over





-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.