【问题标题】:Sikulix - exists function has timeout?Sikulix - 存在函数有超时吗?
【发布时间】:2022-01-27 17:46:22
【问题描述】:

我有一个带有 5 个 if 语句的 sikulix 代码:

if exists("1642200162130.png"):

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

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

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

谢谢!

【问题讨论】:

    标签: bots sikuli sikuli-script sikuli-ide sikuli-x


    【解决方案1】:

    是的,如文档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.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-10-09
      • 1970-01-01
      • 2012-06-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-31
      相关资源
      最近更新 更多