← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #168610]: Loop script, tried but can't understand it

 

Question #168610 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/168610

Mike gave more information on the question:
I have finally figured it out, got it too loop script and then break if
under attack, sorry for being a pain about this today.......

I have loads i want to do with it by adding more to it, i hope i can
work it out. But i have saved it as a working type and will copy to
another saved name when working on it some more.

Below is the working script and its AWESOME......!!! only thing i know
that doesn't happen is popup("UNDER ATTACK!!!") and i believe thats
because i got break, so stops there.

I plan to, do another small script where break is and get rid of it, to
replace with new script when done. One small question is, would it be
possible that when i have while exist( ,0): then my new script i want to
do. can i get it to link back in once that small script is done and do
the whole thing over again.....

# --- this loops forever
while exists( , 0):
      break # but ends if img gets visible
      popup("UNDER ATTACK!!!")
while not exists( , 0):
   click( )# This makes sure your in Space Base
   wait(2)

   # This refuels your fleet
   click( )
   wait(2)
   click( )
   wait(2)
   click( )
   wait(2)
   click( )
   wait(2)

   # This starts your Instances
   click( )
   wait(2)
   click( )
   wait(2)
   click( )#Instance Lvl
   wait(2)
   click( )
   wait(2)
   click( )#Fleet1
   wait(1)
   click( )#Fleet2
   wait(1)
   click( )#Fleet3
   wait(1)
   click( )#Fleet4
   wait(1)
   click( )#Fleet5
   wait(1)
   click( )#Fleet6
   wait(2)
   click( )
   wait(2)
   click( )
   wait( , FOREVER)
   click( )

   #This will sort Instances mail and box
   click( )
   wait(2)
   click( )
   wait(2)
   click( )
   wait(2)
   click( )
   wait(2)
   click( )
   wait(3)

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