Sikulix - 存在函数有超时吗?

Sikulix - exists function has timeout?

我有一个带有 5 个 if 语句的 sikulix 代码,如下所示:

if exists("1642200162130.png"):

它只进入一个if语句,这里只有一个click()

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

对于完整的 运行,脚本执行需要大约 7 秒。这对我来说太慢了。你知道 exists 函数是否超时吗?如果我们可以降低它?

谢谢!

是的,如文档 here 中所述,您可以像这样重载 exists() 函数:

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.