← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #688352]: Mouse stuck in loop

 

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

Description changed to:
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 can't really think of a solution to end the infinite mouse clicks
other than using waitVanish(Reg.getLastMatch()) to set while loop to
false...but that didn't work out

please help haha

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