← Back to team overview

sikuli-driver team mailing list archive

[Question #261815]: visible recognition too slow

 

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


#setFindFailedResponse(SKIP)

# REGIONS:

checkboxreg=Region(670,391,46,204)


# beginning of loop    

while True: 
    wait("Stab.png",50)
    type("fff") 
    
    wait("O_Stab-2.png",10)
    click("O_Stab-2.png")

    wait   ("Begin.png",2)
    click   ("Begin.png")


    setROI(checkboxreg) #setting the region defined previously to make scanning coz of moving objects
    
# below is where the trouble starts. as everything is moving i think too many icons are within the defined region at a given time but it would be needed that whenever the icons appear the mouse needs to be hovered over to the according collection point next to the row where the icons appear. sometimes they are so close together that the mouse moves as soon as the 1st icon is recognized but stays there til the end of the cycle. sometimes it works just not always. i can't figure how to speed things up so the mouse move more often.

    if checkboxreg.exists("Row_1-1.png",10):                 
        hover(Location(760,411)) #next to row_1
    
    elif checkboxreg.exists("Row_2-1.png",10):
        hover(Location(760,463)) #next to row_2

    elif checkboxreg.exists("Row_3-1.png",10): 
        hover(Location(760,519)) #next to #row_3   
    
    elif checkboxreg.exists("Row_4-1.png",10):
        hover(Location(760,575)) #next to row_4
 
     setROI(SCREEN)     #resetting recognition to whole screen

# also since the cycle above ends after some time i need to find a way checking if the cycle has ended since there is a random length involved when. preferably when another picture appears like the wait command below, as it always shows up after the cycle is complete.

    wait("O_Stab_Collect.png", 55)
    find("O_Stab-2.png")    #doing this to move window to front again coz of overlaying items
    click("O_Stab-2.png")
        
    exists("O_Stab-2.png",10)
    click ("O_Stab-2.png")
      
    wait (1)





   
else:    
   
                
        
  
        #find("1423254661154.png")
        #click("1423254661154.png")
        #wait (1)       
    
    
        
    type("i")
    wait (1)
    type("i")
    wait (1)
        
                               

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