Created
October 18, 2023 05:06
-
-
Save kskmori/7131d2bb513483a3c388dfa8b56fc7e6 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
@powershell -NoProfile -ExecutionPolicy Unrestricted "&([ScriptBlock]::Create((cat \"%~f0\" | ?{$_.ReadCount -gt 1}) -join \"`n\"))" %* & goto:eof | |
$Signature = @' | |
[DllImport("user32.dll")] | |
public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo); | |
'@ | |
$MouseEvent = Add-Type -MemberDefinition $Signature -Name "Win32MouseEvent" -Namespace Win32Functions -PassThru | |
echo "ASSaver.ps1 started." | |
echo "[Ctrl+C] Press to exit." | |
while ($true) { | |
Start-Sleep -s 50 | |
$MouseEvent::mouse_event(1, 0, 0, 0, 0) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment