MagicScript is a powerful Windows automation tool that allows you to create and execute custom mouse and keyboard macros after a period of system idle time. Perfect for maintaining system activity, automating repetitive tasks, or simulating user presence.
- Idle Detection: Automatically triggers macros after a customizable period of system inactivity
- Multiple Action Types:
- Mouse movements (absolute, relative, or random positions)
- Mouse clicks (left, right, middle buttons with customizable click count)
- Mouse scrolling (fixed or random amounts)
- Keyboard key presses and key combinations
- Wait/delay actions
- Advanced Mouse Movement Options:
- Specific coordinates
- Random position within a defined range
- Fully random position anywhere on screen
- Relative movement from current position
- Random range from current position (for natural-looking movements)
- Customizable Settings:
- Adjustable idle detection threshold
- Random delays between actions
- Run on Windows startup option
- User-Friendly Interface:
- Drag-and-drop action reordering
- System tray integration
- Action testing capabilities
- Visual action editor
- Windows 10 or later
- Python 3.7 or later
- Download the latest release from the Releases page
- Extract the ZIP file to your desired location
- Run
MagicScript.exe
-
Clone the repository:
git clone https://github.com/yourusername/MagicScript.git cd MagicScript -
Install the required dependencies:
pip install -r requirements.txt -
Run the application:
python magic_script.py
- Launch MagicScript
- The application will start in the system tray
- Click the tray icon to open the main window
- In the "Actions" tab, click "Add Action"
- Select an action type from the dropdown menu
- Configure the action parameters
- Click "OK" to add the action to your macro
- Repeat to add more actions
- Use drag-and-drop to reorder actions as needed
Move the mouse cursor to different positions:
- Specific Coordinates: Move to exact X,Y screen coordinates
- Random in Range: Move to a random position within specified X,Y ranges
- Fully Random: Move to a completely random position on screen
- Relative to Current Position: Move a fixed distance from current position
- Random Range from Current Position: Move a random distance within specified ranges from current position
Perform mouse clicks:
- Choose button type (left, right, middle)
- Set number of clicks (1-10)
Scroll the mouse wheel:
- Fixed Amount: Scroll a specific number of clicks (positive = up, negative = down)
- Random in Range: Scroll a random amount between specified minimum and maximum values
Press a single keyboard key:
- Enter any key name (e.g., a, b, enter, space, tab)
Press multiple keys simultaneously:
- Enter comma-separated key names (e.g., ctrl, alt, delete)
Pause between actions:
- Set duration in seconds
In the "Settings" tab:
-
Idle Detection:
- Set the idle time threshold (in seconds)
- Enable/disable macro automation
-
Random Delay:
- Enable/disable random delays between actions
- Set minimum and maximum delay range (in seconds)
-
General Settings:
- Enable/disable run on Windows startup
- Minimize to tray option
- Select an action and click "Test Action" to test individual actions
- Click "Test All Actions" to run through the entire macro sequence
- Click "Minimize to Tray" to keep the application running in the background
- The application will automatically execute your macro when the system has been idle for the specified time
The "Random Range from Current Position" option creates more natural-looking mouse movements by:
- Keeping movements relative to the current cursor position
- Adding randomness within specified ranges
- Preventing large, unnatural jumps across the screen
This is particularly useful for simulating human-like activity.
Enable random delays between actions to:
- Create more natural timing patterns
- Avoid detection by monitoring systems
- Simulate realistic human interaction
-
Application not starting:
- Ensure you have the correct permissions
- Check if another instance is already running (look in system tray)
-
Actions not executing:
- Verify that macro automation is enabled
- Check that the idle time threshold is set appropriately
- Ensure your actions are properly configured
-
Mouse/keyboard actions not working:
- Some applications may block automated input
- Try running MagicScript as administrator
MagicScript creates a log file (magic_script.log) in the application directory. Check this file for detailed information if you encounter issues.
You can create a standalone executable using PyInstaller:
-
Install PyInstaller:
pip install pyinstaller -
Build the executable:
pyinstaller --onefile --windowed --icon=icon.ico --add-data "icon.ico;." magic_script.py -
The executable will be created in the
distdirectory
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Created with ❤️ by [Your Name]