Advertisement
jeffharbert

Move cursor one pixel to keep your PC awake

Sep 30th, 2022
1,111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Autohotkey 0.65 KB | Software | 0 0
  1. ;--- SETTINGS -----------------------------------------------------------------
  2. distance_x_px := 1
  3. check_interval_secs := 60
  4. minimum_idle_mins := 5
  5.  
  6. ;--- MAIN LOOP ----------------------------------------------------------------
  7. ; If the user has been idle for 2.5 minutes time this script moves
  8. ; the mouse pointer left and right by distance_x_px in regular intervals
  9. ;
  10. movement_x := distance_x_px
  11. check_interval_millis := check_interval_secs * 1000
  12. minimum_idle_millis := minimum_idle_mins * 30000
  13.  
  14. Loop {
  15.         Sleep, 30000
  16.         if (A_TimeIdle > minimum_idle_millis) {
  17.         movement_x := -1 * movement_x
  18.         MouseMove, %movement_x%, 0, 0, R
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement