repeating findBest question
Hi,
I try to optimize my script from:
if exists(img1,0) or exists(img2,0) or ....:
do something
to a better readable version by using a list and findBest.
So I made a list of images and repeat a function to click on different existing images, looking almost the same.
But in my case my function always clicks the same spot, found within the first round, even if it's not existing anymore.
any advice how to tell the function to search again new?
item_list = findBest{
def doIt():
for i in range(1,4,+1):
if item_List:
Lclick(
print('found and clicked item')
sleep(
else:break
Lclick() is my own def to click somewhere inside the region:
def Lclick(region):
CoOrdData = (region)
CoOrdDatax = CoOrdData.x + int(CoOrdData.w * random.random())
CoOrdDatay = CoOrdData.y + int(CoOrdData.h * random.random())
click(
I am also wondering, if I can define a wait time like in using if exists(
Greetings 😄
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Ben Dix
- Solved:
- Last query:
- Last reply: