← Back to team overview

sikuli-driver team mailing list archive

[Question #688352]: Mouse stuck in loop

 

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

Trying to teach myself programming, having a lot of issues with looping...can someone please help me out? I've been stumped for a while.

this is the part I'm having trouble with


if selected == Comps[0]:
    while True:
        if Reg.exists("pic1",0) or Reg.exists("pic2",0) or Reg.exists("pic3",0) or Reg.exists("pic4",0)or Reg.exists("pic 5",0):
            click(Reg.getLastMatch())


It is for a game, I need to click the pictures that pop up from a pool of randomly generated pictures and they automatically vanish and appear on my board. However, every now and then my board becomes full and my mouse gets stuck in an infinite loop trying to click on the pictures from the pool. I don't want to put a wait(2) or something at the end because it would compromise a lot of speed. I also cannot use hotkeys or shift alt c when I constantly click in the game window.


I've tried putting waitVanish(Reg.getLastMatch()) and using onAppear as well...to no success

please help haha


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