我正在尝试实现两个新命令,但在我的Sikuli脚本中它们被忽略了

问题描述 投票:0回答:1

我正在尝试添加两个新行(最后一个“if exists”和“doubleClick”),但它们未被识别。

这是我已经拥有的功能:

def do(a, b, ab, abc, ef, efg):
    if not (exists(a, 0) and exists(ab, 0)):
        return

    doubleClick(abc)
    start = time.time()

    while exists(ab, 0):
        wait(0.1)

    while time.time() < (start + 3) and exists(a, 0):
        pass

    if exists(a, 0):
        doubleClick(b)
        return

    #to be implemented, it has been ignored by the function/script. 
    #It should be triggered whenever the img5 appears. 
    #just to be clear, the img5 will only exist if the img1 doesn't exist

    if exists(ef, 0):
        doubleClick(efg)

while True:
    do(a="img1", b="img2", ab="img11", abc="img111", ef="img5", efg="img51")
    do(a="img1", b="img2", ab="img12", abc="img121", ef="img5", efg="img51")

我已经尝试删除返回,添加一个新的传递,添加一个新的返回,但没有任何效果。

除了我试图添加的部分外,一切都运行顺畅。

它只是发生了什么,函数忽略了那一部分。

谢谢你的帮助。

给您带来的任何不便,我深感抱歉。

我还在学习如何编码,我是一个业余爱好者。

python sikuli sikuli-script sikuli-ide
1个回答
1
投票

@Raimaan ku zxsw点。

(解决方案)它应该如何:

helped me in the SikuliX Q&A
© www.soinside.com 2019 - 2024. All rights reserved.