Updated - Automatic Mouse Mover
This commit is contained in:
@@ -71,16 +71,13 @@ echo using System.Runtime.InteropServices;
|
|||||||
echo public class MouseMover {
|
echo public class MouseMover {
|
||||||
echo [DllImport("user32.dll"^)]
|
echo [DllImport("user32.dll"^)]
|
||||||
echo public static extern bool GetCursorPos(out POINT lpPoint^);
|
echo public static extern bool GetCursorPos(out POINT lpPoint^);
|
||||||
echo
|
|
||||||
echo [DllImport("user32.dll"^)]
|
echo [DllImport("user32.dll"^)]
|
||||||
echo public static extern uint SendInput(uint nInputs, INPUT[] pInputs, int cbSize^);
|
echo public static extern uint SendInput(uint nInputs, INPUT[] pInputs, int cbSize^);
|
||||||
echo
|
|
||||||
echo [StructLayout(LayoutKind.Sequential^)]
|
echo [StructLayout(LayoutKind.Sequential^)]
|
||||||
echo public struct INPUT {
|
echo public struct INPUT {
|
||||||
echo public uint type;
|
echo public uint type;
|
||||||
echo public MOUSEINPUT mi;
|
echo public MOUSEINPUT mi;
|
||||||
echo }
|
echo }
|
||||||
echo
|
|
||||||
echo [StructLayout(LayoutKind.Sequential^)]
|
echo [StructLayout(LayoutKind.Sequential^)]
|
||||||
echo public struct MOUSEINPUT {
|
echo public struct MOUSEINPUT {
|
||||||
echo public int dx;
|
echo public int dx;
|
||||||
@@ -90,12 +87,10 @@ echo public uint dwFlags;
|
|||||||
echo public uint time;
|
echo public uint time;
|
||||||
echo public IntPtr dwExtraInfo;
|
echo public IntPtr dwExtraInfo;
|
||||||
echo }
|
echo }
|
||||||
echo
|
|
||||||
echo public struct POINT {
|
echo public struct POINT {
|
||||||
echo public int X;
|
echo public int X;
|
||||||
echo public int Y;
|
echo public int Y;
|
||||||
echo }
|
echo }
|
||||||
echo
|
|
||||||
echo public const uint INPUT_MOUSE = 0;
|
echo public const uint INPUT_MOUSE = 0;
|
||||||
echo public const uint MOUSEEVENTF_MOVE = 0x0001;
|
echo public const uint MOUSEEVENTF_MOVE = 0x0001;
|
||||||
echo }
|
echo }
|
||||||
@@ -109,7 +104,7 @@ echo $moveCount = 0
|
|||||||
echo.
|
echo.
|
||||||
echo Write-Host ""
|
echo Write-Host ""
|
||||||
echo Write-Host "========================================" -ForegroundColor Green
|
echo Write-Host "========================================" -ForegroundColor Green
|
||||||
echo Write-Host "Mouse Mover Active (Hardware Simulation^)" -ForegroundColor Green
|
echo Write-Host "Mouse Mover Active (Hardware Simulation)" -ForegroundColor Green
|
||||||
echo Write-Host "========================================" -ForegroundColor Green
|
echo Write-Host "========================================" -ForegroundColor Green
|
||||||
echo Write-Host ""
|
echo Write-Host ""
|
||||||
echo Write-Host "Monitoring mouse movement..."
|
echo Write-Host "Monitoring mouse movement..."
|
||||||
@@ -156,7 +151,7 @@ echo [void][MouseMover]::SendInput(1, $inputs, [System.Runtime.InteropServic
|
|||||||
echo $moveCount++
|
echo $moveCount++
|
||||||
echo.
|
echo.
|
||||||
echo $time = Get-Date -Format 'HH:mm:ss'
|
echo $time = Get-Date -Format 'HH:mm:ss'
|
||||||
echo Write-Host "[$time] Auto-moved mouse ($moveCount moves^)" -ForegroundColor Green
|
echo Write-Host "[$time] Auto-moved mouse ($moveCount moves)" -ForegroundColor Green
|
||||||
echo.
|
echo.
|
||||||
echo [void][MouseMover]::GetCursorPos([ref]$lastPos^)
|
echo [void][MouseMover]::GetCursorPos([ref]$lastPos^)
|
||||||
echo.
|
echo.
|
||||||
@@ -168,6 +163,15 @@ echo Write-Host "========================================" -ForegroundColor Yell
|
|||||||
echo Write-Host "Mouse Mover Stopped" -ForegroundColor Yellow
|
echo Write-Host "Mouse Mover Stopped" -ForegroundColor Yellow
|
||||||
echo Write-Host "Total moves: $moveCount" -ForegroundColor Yellow
|
echo Write-Host "Total moves: $moveCount" -ForegroundColor Yellow
|
||||||
echo Write-Host "========================================" -ForegroundColor Yellow
|
echo Write-Host "========================================" -ForegroundColor Yellow
|
||||||
|
echo.
|
||||||
|
echo Start-Sleep -Seconds $interval
|
||||||
|
echo }
|
||||||
|
echo.
|
||||||
|
echo Write-Host ""
|
||||||
|
echo Write-Host "========================================" -ForegroundColor Yellow
|
||||||
|
echo Write-Host "Mouse Mover Stopped" -ForegroundColor Yellow
|
||||||
|
echo Write-Host "Total moves: $moveCount" -ForegroundColor Yellow
|
||||||
|
echo Write-Host "========================================" -ForegroundColor Yellow
|
||||||
) > "%TEMP%\MouseMover.ps1"
|
) > "%TEMP%\MouseMover.ps1"
|
||||||
|
|
||||||
REM Execute PowerShell script
|
REM Execute PowerShell script
|
||||||
|
|||||||
Reference in New Issue
Block a user