Created
May 5, 2021 12:01
-
-
Save royashbrook/d5135adc58a09395da8989a789d866cb to your computer and use it in GitHub Desktop.
jiggles the mouse a little
This file contains 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
#no idea why, but i thought this was kind of funny | |
#get our winform stuff | |
$null = [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | |
$null = [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | |
#move the mouse on x | |
function Nudge($p){ | |
[System.Windows.Forms.Cursor]::Position = ` | |
[System.Drawing.Point]::New( ` | |
[System.Windows.Forms.Cursor]::Position.X+$p, ` | |
[System.Windows.Forms.Cursor]::Position.Y ) | |
} | |
#jiggle the mouse back and forth based on x offset | |
function Jiggle($offset){ | |
while($true){ | |
Start-Sleep -Milliseconds 10 | |
Nudge ($offset = -$offset) | |
} | |
} | |
#jiggle.... | |
"Jiggling..." | |
Jiggle 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment