!7 static double interval = 1.0; static new LatestAppearance latest; sS tooltip, tooltipMD5; p-experiment { autoRestart(); startBotHere("Screen Segmenter.", #1015121); onGlobalMousePress(voidfunc(NativeMouseEvent e) { lock defaultLock(); int x = e.getX(), y = e.getY(); makeToolTip(Pt(x, y)); S text; if (empty(tooltip)) text = "User clicked at " + x +"/" + y + " (" + screenWidth() + "x" + screenHeight() + ")"; else text = "User clicked on " + multiLineQuote(tooltip) + " at " + x + "/" + y + " (screen: " + screenWidth() + "x" + screenHeight() + ", md5: " + tooltipMD5 + ")"; mechAppend_noUniq_inQ("Mouse log", text); }); S tooltip = ""; // mouse repeat with sleep interval { time2 { L list = latest.recordAndSort(thingsOnScreen2()); makeToolTip(mousePt()); } print(localDateWithSeconds() + ": Found: " + list); consoleTitle(l(list) + " " + joinWithComma(list)); } } svoid makeToolTip(Pt mousePt) { lock defaultLock(); L rects = segmentedScreenFromCacheFile_last; mouse = firstRectAndMD5Containing(rects, mousePt); S name = ""; if (mouse != null) name = unnull(thingsOnScreenDefinitions().get(mouse.md5)); if (neq(name, tooltip)) flatInfoBox_topRightCorner(tooltip = name, 1.0); }