while self.find( "fpump", matching=0.97, waiting_time=9999999):
if waiting_time > 5000:
if self.find( "adress", matching=0.97, waiting_time=10000):
self.click_relative(229, 6)
cont = cont + 1
Can I creat a condition to execute only if “waiting_time” is above a certain time?
@andersoncampolina,
I am not sure I understood exactly what you intend.
Reading your current code, it will:
- Loop until
fpump
is found, waiting for up to 9999999ms.
- If waiting_time > 5000:
- If
adress
is found, click relative to it and increase a counter
What I am understanding from your question is that you want to search for fpump
for up to 5000ms and if this time expires you want to click relative to adress
, is that correct?
- If you answered yes to the code above, this will get you there:
# Look for fpump for up to 5000ms
if not self.find( "fpump", matching=0.97, waiting_time=5000):
# If we could not find it during this time... look for adress and click relative to it
if self.find( "adress", matching=0.97, waiting_time=10000):
self.click_relative(229, 6)
cont = cont + 1
Does this help? Otherwise, could you try to explain what exactly you are trying to achieve?