!7 cmodule GMail > DynVisualBot { transient bool foundSomething; //transient RandomScreenScan scan = new(400, 100); transient IF1 scan = foundSomething -> rect(0, 0, 400, 100); transient Rect lookingAt; S regexp = "Inbox\\s?\\(([0-9,]+)"; start-thread { useShooter = false; // we shoot ourselves if (segmenter == null) segmenter = mandatorySegmenterFromAGIBlue("find inbox count in task bar using standard gmail segmenter #1"); while not null (lookingAt = scan.get(foundSomething)) { while (!enabled) sleepSeconds(1); BufferedImage img = shootScreen2(lookingAt); ImageInfo info = segment(img); L rects = rects(info.segments); rects = ocr_mergeOverlappingY(rects); L texts = ocr_recognizeMultiLine_scored(img, rects); print(texts); //texts = ocr_mergeRecognizedTextsIfClose(texts); foundSomething = notNull(print(regexpFirstGroup_any(regexp, texts(texts)))); } } }