← Back to team overview

sikuli-driver team mailing list archive

[Question #673806]: NameError ( name "logout" is not defined) - strange?

 

New question #673806 on Sikuli:
https://answers.launchpad.net/sikuli/+question/673806

Here is my script:


--------------------


wait("1536669464524.png")
click("1536669473041.png")
click("1536669473041.png")
wait("1536669757342.png",30)
if find("1536669757342.png"):
    
    #Use pre-defined hotkeys on api app 
    type('u', KeyModifier.CTRL)
    wait(1)
    type('c', KeyModifier.CMD)
    username = Env.getClipboard()
    
    type('p', KeyModifier.CTRL)
    wait(1)
    type('c', KeyModifier.CMD)
    password = Env.getClipboard()

    type('s', KeyModifier.CTRL)
    wait(1)
    type('c', KeyModifier.CMD)
    search = Env.getClipboard()    

    wait("1536657404192.png")
    click("1536657070381.png")

    click("1536657070381.png")

    wait(1) 
    type(username)
    type(Key.TAB)
    wait(1) 
    type(password)

click("1536657336512.png")
if exists("1536672253666.png") :

    print('PASS IS INCORRECT')
    type(Key.ESC)
    wait(1)
    click("1536687573573.png")
    click("1536687573573.png")

else :

    wait("1536671840980.png")
    while exists(Pattern("1536683293833.png").similar(0.90), 0):
        
        click("1536671852025.png")
        click("1536671852025.png")
        click("1536671878418.png")
        wait(1)
        type(search)
        wait("1536675224487.png")
        click("1536675224487.png")
        wait(1)

        if exists("1536685239396.png") :

            print('ACCOUNT INVALID')
            logout()
            click(Pattern("1536687625649.png").similar(0.79))
            click(Pattern("1536687625649.png").similar(0.79))

        else: 
            click("1536677027804.png")
            wait(1)
            type(Key.ESC)
            wait(10)
            click(Pattern("1536676724489.png").targetOffset(-18,-1))
            click("1536675568133.png")
            click("1536675568133.png")
            wait(1)
            type('s', KeyModifier.CTRL)
            wait(1)
            type('c', KeyModifier.CMD)
            search = Env.getClipboard()
    
    logout()
    click("1536689430382.png")
    click("1536689430382.png")

    

def logout():

    click("1536684131754.png")
    click("1536684131754.png")

    click("1536683889988.png")
    click("1536683905637.png")
    click("1536683920971.png")
    

-------------------------------------------

It was working fine, but for some reason this message started popping up. any clues?

Thanks

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.