Updated - Automatic Mouse Mover

This commit is contained in:
2026-01-26 11:02:12 +01:00
parent 5297f9fa70
commit 5366daa302

View File

@@ -26,6 +26,26 @@ if %INTERVAL% GTR 10 (
goto GET_INTERVAL
)
echo.
REM Get cursor movement option
echo Cursor movement:
echo [1] Visible cursor movement
echo [2] Invisible (cursor stays in place)
echo.
set /p CURSOR_CHOICE="Select option (1-2): "
if "%CURSOR_CHOICE%"=="1" (
set CURSOR_MOVE=true
set CURSOR_TEXT=Visible movement
) else if "%CURSOR_CHOICE%"=="2" (
set CURSOR_MOVE=false
set CURSOR_TEXT=Invisible
) else (
echo Invalid selection!
timeout /t 2 >nul
goto GET_INTERVAL
)
echo.
REM Get duration
echo Duration options:
@@ -51,6 +71,7 @@ echo ========================================
echo Configuration:
echo - Interval: %INTERVAL% seconds
echo - Duration: %DURATION_TEXT%
echo - Cursor: %CURSOR_TEXT%
echo - Movement: Random 1-5 pixels
echo - Auto-pause when you move the mouse
echo ========================================
@@ -73,6 +94,9 @@ echo [DllImport^("user32.dll"^)]
echo public static extern bool GetCursorPos^(out POINT lpPoint^);
echo.
echo [DllImport^("user32.dll"^)]
echo public static extern bool SetCursorPos^(int x, int y^);
echo.
echo [DllImport^("user32.dll"^)]
echo public static extern uint SendInput^(uint nInputs, INPUT[] pInputs, int cbSize^);
echo.
echo [StructLayout^(LayoutKind.Sequential^)]
@@ -103,6 +127,7 @@ echo "@
echo.
echo $interval = %INTERVAL%
echo $durationMinutes = %DURATION_MINUTES%
echo $cursorMove = $%CURSOR_MOVE%
echo $random = New-Object System.Random
echo $startTime = Get-Date
echo $moveCount = 0
@@ -153,6 +178,12 @@ echo $input.mi.dwExtraInfo = [IntPtr]::Zero
echo.
echo $inputs = @^($input^)
echo [void][MouseMover]::SendInput^(1, $inputs, [System.Runtime.InteropServices.Marshal]::SizeOf^($input^)^)
echo.
echo if ^($cursorMove^) {
echo $newX = $currentPos.X + $moveX
echo $newY = $currentPos.Y + $moveY
echo [void][MouseMover]::SetCursorPos^($newX, $newY^)
echo }
echo $moveCount++
echo.
echo $time = Get-Date -Format 'HH:mm:ss'