sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #57475
[Question #698272]: Loop is not workin (while, if)
New question #698272 on SikuliX:
https://answers.launchpad.net/sikuli/+question/698272
Hi guys,
I'm sure that something trivial like this will make you laugh, but I cannot fix it, even trying for hours:
In this spcipt, the execution stops with this error message:
"[error] script [ 000_ArtWar ] stopped with error in line 13 at column 4
[error] SyntaxError ( "no viable alternative at input 'exists'", )"
This is the script:
Settings.MoveMouseDelay = 0.0
andAndo = True
def runHotkey(event):
global andando
andando = False
Env.addHotkey(Key.F1, KeyModifier.CTRL, runHotkey)
war = switchApp("Moto G_Play")
while(war.hasWindow() and andAndo and brigar <> 5):
#for brigar in range(2): #roda 2 vezes
If exists("enon.png"): #ERROR MESSAGE POINTS TO HERE
click("Toran.png".similar(0.90)
wait("Batalhar-1.png",50)
click("Batalhar-2.png")
wait("tien.png",50)
click("tien.png")
If brigar = 3
wait(Pattern("1627992723202.png").targetOffset(58,171),30)
click(Pattern("1627992723202.png").targetOffset(57,162))
wait("Goletar.png",50)
click("Goletar.png")
brigar += 1
I've tried to change "exists" for "find", but I got same error.
Any tip or clue?
--
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.