Re: [Sikuli-driver] [Question #703916]: How to loop entire Script

2022-11-29 Thread Jeramie Ingram
Question #703916 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/703916

Status: Answered => Solved

Jeramie Ingram confirmed that the question is solved:
Thanks this worked to loop the script.

And thanks for fast reply, I have been away from email for a while.

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #703916]: How to loop entire Script

2022-11-24 Thread Manfred Hampl
Question #703916 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/703916

Status: Open => Answered

Manfred Hampl proposed the following answer:
What you need can be found by a web search for "python while".

running = True

def runHotkey(event):
global running
running = False

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

while running:
click(Location(41,1300))
click(Location(38,1179))
wait(1)
click(Location(367,965))
click(Location(420,991))
...
(all commands to be repeated need to be indented by the same amount of 
whitespace)

Remark: You have to make sure, that the hotkey that you select does not
conflict with hotkeys in other programs, especially in the operating
system. As far as I know, on a Windows system ctrl-shift-esc starts the
task manager and this has precedence, so that key combination does not
work in Sikulix on Windows.

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #703916]: How to loop entire Script

2022-11-23 Thread Jeramie Ingram
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.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp