sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #23917
Re: [Question #243125]: Make sikuli click a random link of a the ones that are found
Question #243125 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/243125
Status: Answered => Open
Naus Town is still having a problem:
Thank y'all!
Its working perfectly on my primary monitor but on my secondary one its
giving me: "[error] FindFailed ( can not find P(autoSpectate-3.png) S:
0.8 on the screen. )"
That's the code:
while True: # main loop
scr1 = Screen(1)
scr1.exists(Pattern("1-2.png").similar(0.85),99999) # Wait for Games
scr1.click(Pattern("1-3.png").similar(0.85)) # Click on Games
scr1.exists(Pattern("autoSpectate.png").similar(0.80),99999) # Wait for Spectate
import random
scr1.click(random.choice(list(findAll(Pattern("autoSpectate-3.png").similar(0.80))))) # Click on Spectate
scr1.exists(Pattern("autoturn-1.png").similar(0.95),99999) # Wait for Turn
while scr1.exists(Pattern("autoturn-1.png").similar(0.95)): # Secondary search loop
if scr1.exists(Pattern("autoleftgame.png").similar(0.95)): # TEST " player has left game
Region(3718,1051,117,28).exists(Pattern("autlev-1.png").similar(0.33),99999) # Look for Exit Name
Region(3718,1051,117,28).hover(Pattern("autlev-2.png").similar(0.33)) # find exit lobby button in proper region
scr1.exists(Pattern("backtolob-1.png").similar(0.85),99999)
scr1.click(Pattern("backtolob.png").similar(0.85))
break # end search loop and return to main loop.
else:
wait(2) # wait period before restarting loop
continue # continue search loop if "player has left game" is not found.
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.