← Back to team overview

sikuli-driver team mailing list archive

[Question #213008]: Clueless!

 

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

actually i just started and have no real clue of what im doing right now.

the gernal idea of what im trying to accomplish is a loop. It should look for 6 pictures in total.  if one is found. it should perform a click on it, if not it should type serveral  DOWN's and repeat the search.

after various attempts myself i tried coping this:
https://answers.launchpad.net/sikuli/+faq/1437

and below you find my outcome, which i still cant get to work

help is very much appreciated


m_wolf = "1351782204476-1.png"
m_ride = "Fs-1.png"
m_skel = "1351781181964-1.png"
m_mage = "1351781228804-1.png"
m_grump = "3-1.png"
m_liz = "1351784475467-1.png"



weWait = 20 # max seconds we want to wait
while weWait > 0:

  mImg1 = exists(m_wolf,0) # see comment
  mImg2 = exists(m_ride,0)
  mImg3 = exists(m_skel,0) # see comment
  mImg4 = exists(m_mage,0)
  mImg5 = exists(m_grump,0) # see comment
  mImg6 = exists(m_liz,0)
  if mImg1 or mImg2 or mImg3 or mImg4 or mImg5 or mImg6: break # leave the loop if at least one found
  wait(1)
  type(key.DOWN)
  type(key.DOWN)
  type(key.DOWN)
  type(key.DOWN)
  type(key.DOWN)
  type(key.DOWN)
  weWait -= 1 # count down wait time 

if not (mImg1 and mImg2 and mImg3 and mImg4 and mImg5 and mImg6):
 #print "images did not appear"; 
 exit(1)

if mImg1:
  click(m_wolf)
          
if mImg2:
  click(m_ride)

if mImg3:
  click(m_skel)

if mImg4:
  click(m_mage)
  
if mImg5:
  click(m_grump)

if mImg6:
  click(m_liz)



  

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.