← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #640445]: Scan for either of the 3 images during runtime

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
--- didn't work. the program quits.
The above code cannot simply quit silently. So there must have been an error message. In this case because of the
waitVanish(isA)
which needs an image or pattern as parameter.
So please post also error messages, if your code does not work as expected.

--- want the program to ignore this B for next 10 sec
in your code I cannot see any trial to solve this.

the principle solution is something like this:
ignoringB = 0
while True:    
  while True:
    isA = exists(A, 0)
    isB = exists(B, 0)
    isC = exists(C, 0)
    if isB and ignoringB > 0:
      if time.time() < ignoringB:
        isB = False # ignore B
      else:
        ignoringB = 0 # recognize again
    if isA or isB or isC: break
    wait(1)

  # do your work
  # decide somehow to ignore B for a while
  ignoringB = time.time() + 10 # the time 10 secs in the future

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