commit 4b3242ac3cdf084f1d42b0759c26e60dcfa007ef Author: Andreas Bail Date: Thu Jul 23 15:09:02 2026 +0200 inital commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b883f1f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.exe diff --git a/ArteKaffee.ahk b/ArteKaffee.ahk new file mode 100644 index 0000000..8fae40f --- /dev/null +++ b/ArteKaffee.ahk @@ -0,0 +1,96 @@ +#Requires AutoHotkey v2.0 +#SingleInstance Force +Persistent + +CorrectPassword := "Kaffeebohne" + +result := InputBox( + "Bitte Passwort eingeben:", + "Authentifizierung", + "Password w200 h90" +) + +if (result.Result != "OK") { + ExitApp() +} + +if (result.Value != CorrectPassword) { + MsgBox("Falsches Passwort!", "Fehler", "Iconx") + ExitApp() +} + +global IdleTime := 240 ; seconds +global Enabled := true +global LastX := 0 +global LastY := 0 +global LastMoveTime := A_TickCount + +MouseGetPos &LastX, &LastY + +; Create tray menu +A_TrayMenu.Delete() + +A_TrayMenu.Add("Enabled", ToggleEnabled) +A_TrayMenu.Add() +A_TrayMenu.Add("Set idle time...", SetIdleTime) +A_TrayMenu.Add() +A_TrayMenu.Add("Exit", (*) => ExitApp()) + +UpdateTray() + +; Check mouse every second +SetTimer(CheckMouse, 20000) + +; ---------------------- + +CheckMouse() { + global Enabled, IdleTime, LastX, LastY, LastMoveTime + + if !Enabled + return + + MouseGetPos &x, &y + + if (x != LastX || y != LastY) { + LastX := x + LastY := y + LastMoveTime := A_TickCount + return + } + + if (A_TickCount - LastMoveTime >= IdleTime * 1000) { + MouseMove x + 1, y, 0 + MouseMove x, y, 0 + + LastMoveTime := A_TickCount + } +} + +ToggleEnabled(*) { + global Enabled + + Enabled := !Enabled + UpdateTray() +} + +SetIdleTime(*) { + global IdleTime + + result := InputBox("Enter idle time in seconds:", "Mouse mover settings", "w200 h90", IdleTime) + + if result.Result = "OK" && IsNumber(result.Value) { + IdleTime := Integer(result.Value) + } +} + +UpdateTray() { + global Enabled + + if Enabled { + A_TrayMenu.Check("Enabled") + A_IconTip := "Mouse Mover - Active" + } else { + A_TrayMenu.Uncheck("Enabled") + A_IconTip := "Mouse Mover - Disabled" + } +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..985df36 Binary files /dev/null and b/favicon.ico differ