1

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

if exists("1642200162130.png"):

它只输入一个 if 语句,其中只有一个click()

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

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

谢谢 !

4

1 回答 1

1

是的,如此处文档中所述您可以像这样重载该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.
于 2022-01-27T09:46:22.387 回答