Wait for a coordinate to become a certain color
(coords, color)
| 34 | return proc.communicate()[0].split()[0] |
| 35 | |
| 36 | def waitFor(coords, color): |
| 37 | ''' Wait for a coordinate to become a certain color ''' |
| 38 | pyautogui.moveTo(coords) |
| 39 | numWaitedFor = 0 |
| 40 | while color != runCommand("eval $(xdotool getmouselocation --shell); xwd -root -silent | convert xwd:- -depth 8 -crop \"1x1+$X+$Y\" txt:- | grep -om1 '#\w\+'"): |
| 41 | time.sleep(.1) |
| 42 | numWaitedFor += 1 |
| 43 | if numWaitedFor > 25: |
| 44 | return -1 |
| 45 | return 0 |
| 46 | |
| 47 | def downloadCaptcha(): |
| 48 | ''' Navigate to demo site, input user info, and download a captcha. ''' |
no test coverage detected