← Back to team overview

sikuli-driver team mailing list archive

[Question #703916]: How to loop entire Script

 

New question #703916 on SikuliX:
https://answers.launchpad.net/sikuli/+question/703916

Thanks for any advice on this.

I am trying to make a simple auto click script that I would like to repeat until I stop with Hotkeys.
This is my first try at any kind of scripting. I have no prior knowledge on scripts or python.  I have though looked at all of the FAQs on here looking for looping solutions. I tried a few but cant seem to get any to work. I also saw something that I should create a function and then loop the function. See my code below:

I would like this to run infinite until I stop





 running = True

def runHotkey(event):
    global running
    running = False

Env.addHotkey(Key.ESC, KeyModifier.SHIFT+KeyModifier.CTRL, runHotkey)



click(Location(41,1300))
click(Location(38,1179))
wait(1)
click(Location(367,965))
click(Location(420,991))
click(Location(450,965))
click(Location(475,1055))
click(Location(555,1055))
click(Location(677,968))
click(Location(885,1300))
click(Location(890,1180))
wait(1)
click(Location(1250,967))
click(Location(1265,991))
click(Location(1295,965))
click(Location(1328,1055))
click(Location(1410,1055))
click(Location(1528,968))
wait(300)


-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.