Search code examples
botssikulisikuli-scriptsikuli-idesikuli-x

Sikulix - exists function has timeout?


i have a sikulix code with 5 if statement like this :

if exists("1642200162130.png"):

It enter in only one if statement, where there is only one click()

click(Location(me.x + paddingx, me.y + paddingy))

For a complete run, the scritp take ~7seconds to execute. It's too slow for me. Do you know if there is a timeout on exists function ? And if we can lower it ?

Thank you !


Solution

  • Yes, as described in the documentation here, you can overload the exists() function like this:

    exists(PS[, seconds])
    Check whether the give pattern is visible on the screen.
    
    Parameters: 
    PS – a Pattern object or a string (path to an image file or just plain text)
    seconds – a number, which can have a fraction, as maximum waiting time in seconds. The internal granularity is milliseconds. If not specified, the auto wait timeout value set by Region.setAutoWaitTimeout() is used. Use the constant FOREVER to wait for an infinite time.