Created
April 29, 2025 12:47
-
-
Save Rio-Nyx/750b33440de3fe0570fa2a65f8f6c934 to your computer and use it in GitHub Desktop.
Move mouse by 1 pixel in x coordinate and return back to original position
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Used to stop windows from sleeping | |
Add-Type -AssemblyName System.Windows.Forms | |
while ($true) { | |
$pos = [System.Windows.Forms.Cursor]::Position | |
# Move mouse slightly | |
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point(($pos.X + 1), $pos.Y) | |
Start-Sleep -Milliseconds 500 | |
[System.Windows.Forms.Cursor]::Position = $pos | |
# Wait for 2 minutes | |
Start-Sleep -Seconds 120 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment