I am trying to make my script end the loop or exit if a certain image appears inside certain region.
I get an error when I run the script; I am not sure what is wrong as the parts about stopregion
and stopimage
were advised by another person.
The error:
[error] TypeError ( 'tuple' object is not callable )
My code is below:
Image1 = ("1453735625632-12.png")
Image2 = ("1453723117924-16.png")
stopRegion = (815,423,314,136)
stopImage = ("1454946335394.png")
while True:
click(wait("1453202630435-1.png",FOREVER))
if stopRegion.exists("1454946335394.png", 0): # ends in error
break
click(wait("1453994048404-9.png",FOREVER))
click(wait("1453202812250-3.png",FOREVER))
while True:
print('Searching....')
if exists("1453723117924-17.png", 0):
click("1453723117924-18.png")
# Break loop.
break
if exists("1453735625632-14.png", 0):
click("1453735625632-15.png")
# Break loop.
break
click(wait("1453202882292-7.png",FOREVER))
Any help is much appreciated.