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 units that pop up on my screen, they 
automatically vanish and appear on my board which has 10 slots. However, every 
now and then my board becomes full and cannot take another unit until I sell 
one. But since the units are still "available" my mouse gets stuck in an 
infinite loop trying to click on them. 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.

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to