Last active
August 31, 2019 02:14
-
-
Save ryancole/04491a497e2590fa521821f67dd82b5c to your computer and use it in GitHub Desktop.
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
# https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.sendkeys | |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | |
while (1) { | |
$duration = Get-Random -Minimum 10 -Maximum 60 | |
Write-Output "Waiting $duration seconds ..."; | |
Start-Sleep -Seconds $duration | |
$inputs = ('w', 'a', 's', 'd', ' '); | |
$input = $inputs[(Get-Random -Maximum $inputs.Length) - 1] | |
Write-Output "Sending $input ..."; | |
[System.Windows.Forms.SendKeys]::SendWait($input); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment