← Back to team overview

sikuli-driver team mailing list archive

[Question #163613]: After a script runs 50 times I want to add a different keystroke to the script, how do I code that?

 

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

I'm a user, not a developer so first I must say my apologies.  Here is the code I'm using

for n in range(100):
          wait(6)
          type("T")
          find(<image>)
          click(<image>)
          type(Key.ESC)
          hover(<second image>)
          wait(20)
          rightClick(<third image>)

this code automates tedious farming in a video game, but after about 75 cycles it will stop because an item that a player uses will break.  What I can't figure out while reading is how to add something like 

after 60 cycles 
         type("1")

which will make a player use a new item, without stopping the script.

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