SyntaxError ( "no viable alternative at input 'else'", )

Asked by Jembut Nakal

I give up
so all i want to do is
- run the script forever till i close it myself
- look for a image , if it exist do A job
- if image above doesnt exist do B job

here the script i trying to make

while True:
    if exists("1489847064867.png"):
        find(Pattern("1489844078174.png").similar(0.94))
        click(Pattern("1489844364920.png").targetOffset(-17,-1))
        wait(3)
        click("1489844402652.png")
        click(Pattern("1489844426189.png").targetOffset(-69,-50)
    else:
        click("1489844475242.png")
        doubleClick("1489844494184.png")
        wait(1)
        click("1489844525221.png")
        wait(1)
        click("1489844525221.png")
        wait(1)
        doubleClick("1489844579213.png")
        click("1489844579213.png")
        click("1489844525221.png")
        click("1489844525221.png")
        wait(2)
        click("1489844694993.png"
        wait(1)
        click("1489844475242.png")
        click("1489844494184.png")
        wait(1)
        click("1489844525221.png")
        click(Pattern("1489844364920.png").targetOffset(-17,-1))
        wait(3)
        click("1489844402652.png")
        click(Pattern("1489844426189.png").targetOffset(-69,-50)
        wait(1)

error message:
[error] script [ Sikulix ] stopped with error in line 8 at column 4
[error] SyntaxError ( "no viable alternative at input 'else'", )

screen :
http://imgur.com/a/uyFpQ

im really sorry to bother you guys, and thank you for reading this

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Jembut Nakal
Solved:
Last query:
Last reply:
Revision history for this message
Jembut Nakal (engagex) said :
#1

im really sorry, found the problem missed 3 ")" in the script