!7 static Pt moveDist = pt(400, 300); static int minWidth = 300; p-subst-autorestart { mouseMover().endAfterInterference = false; while licensed { if (mouseMover().blocked()) { consoleStatus("BLOCKED"); sleepSeconds(1); continue; } else consoleStatus(""); long time = sysNow(); BufferedImage img = shootScreen2(); Rect r = ocr_findTerminalBackground(RGBImage(img)); writeBesideMemoryView(elapsedMS(time) + " ms"); if (rectWidth(r) < minWidth) continue; Rect title = shrinkRect(40, 4, new Rect(r.x, r.y-16, r.w, 16)); //containsColor(clipBufferedImage(img, title), 0x454545) bool isTitle = containsColor(clipBufferedImage(img, new Rect(centerOfRect(title), 10, 10)), 0x454545); if (isTitle) { //print(title); Pt p = centerOfRect(title); Pt p2 = Pt(p.x+random(-moveDist.x, moveDist.x), p.y+random(-moveDist.y, moveDist.y)); Rect usable = shrinkRect(300, 20, Rect(usableWindowArea())); usable.h = max(40, usable.h-300); print("Usable: " + usable + ", p2: " + p2); p2 = limitPtToRect(p2, usable); if (eq(p, p2)) continue; if (robotDragMouse(toPoint(p), 100, toPoint(p2))) { infoBox("Moving the terminal around 'cause I'm bored."); print("Dragging " + p + " to " + p2); sleep(3000); } } } }