save as mousemove.ps1, right click 用powershell 執行
改下 max_x, max_y 做你個screen size- Add-Type -AssemblyName System.Windows.Forms
- $max_x = 2560
- $max_y = 1440
- while ($true)
- {
- $Pos = [System.Windows.Forms.Cursor]::Position
- $rand = (Get-Random -Minimum -10 -Maximum 10)
- $x = $Pos.X + $rand
- $rand = (Get-Random -Minimum -10 -Maximum 10)
- $y = $Pos.Y + $rand
-
- if($x -lt 0) {
- $x = 0
- }
-
- if($x -gt $max_x) {
- $x = $max_x
- }
-
- if($y -lt 0) {
- $y = 0
- }
-
- if($y -gt $max_y) {
- $y = $max_y
- }
-
- [System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y)
-
- $rand = (Get-Random -Minimum 50 -Maximum 500)
- Start-Sleep -Milliseconds $rand
- }
複製代碼 |