A Python-based automation tool designed to assist with the masterworking process in Diablo IV by automatically detecting and selecting desired affixes.
READ THIS BEFORE USING:
- This is an unofficial third-party tool not affiliated with or endorsed by Blizzard Entertainment
- Use of automation tools may violate Diablo IV's Terms of Service
- Your account could face penalties, suspension, or permanent bans
- You assume all risks associated with using this software
- The developers are not responsible for any account actions taken by Blizzard
- Check the current Terms of Service before deciding to use this tool
- Automatic Affix Detection: Recognizes when your desired masterwork affix appears
- Human-like Mouse Movement: Configurable natural movement patterns with randomization
- Failsafe Mechanisms: Multiple safety stops including ESC key and mouse corner failsafe
- Customizable Settings: Adjustable detection thresholds, movement speeds, and success targets
- Sound Effects: Optional audio notifications for start/completion (requires pygame)
- Statistics Tracking: Real-time tracking of attempts, successes, and failures
- Developer Logs: Detailed debugging information for troubleshooting
- Operating System: Windows (tested)
- Python: Version 3.7 or higher
- Screen Resolution: Any (tool captures specific UI elements)
- Game: Diablo IV
-
Install Python 3.7+ from python.org
-
Install required dependencies:
pip install opencv-python numpy pyautogui keyboard Pillow
-
Optional: Install pygame for sound effects:
pip install pygame
-
Download the tool and extract to a folder
-
Run the application:
python "Diablo-IV-Masterwork-Companion.py"
- Download the executable release
- Extract to a folder
- Run the
.exefile - All dependencies are included
The tool requires several reference images to function. These should be placed in a resources/ folder:
Required Images:
upgrade_1.png- The upgrade buttonupgrade_2.png- Alternate upgrade button stateupgrade_3.png- Third upgrade button variantskip.png- The skip buttonreset.png- The reset buttonconfirm.png- The confirmation dialog buttonaffix.png- YOUR DESIRED AFFIX (captured during setup)
Optional Images:
mw_window.png- Reference image for tooltips
Sound Files (optional, in resources/sound/):
start_effect.mp3- Plays when bot startsdone.mp3- Plays when masterworking completes
- Launch Diablo IV and navigate to the Blacksmith
- Open the Masterworking interface
- Place your item in the masterworking slot
This is the most critical step:
- Perform one manual upgrade in Diablo IV to reveal potential affixes
- Click "Drag to Select" button in the tool
- When the affix selection screen appears, drag to select ONLY your desired affix
- Be precise - capture only the affix text you want
- The tool will save this as
affix.pngand keep a record of them in subfolderscreenshot_history
Tips for affix capture:
- Make sure the affix is clearly visible and unobstructed
- Capture just the affix text, not surrounding elements
- Avoid capturing when other UI elements overlap
- Test different lighting/contrast if detection fails
Detection Thresholds:
- Affix Detection: 0.80 (higher = more strict matching)
- Other Elements: 0.50 (for buttons like upgrade, skip, etc.)
Mouse Behavior:
- Enable human-like movement for more natural automation
- Adjust speed multipliers (higher = faster movement)
- Configure click randomness
Success Target:
- Choose 2 or 3 consecutive successes before stopping
- Ensure Diablo IV is running and focused
- Navigate to Blacksmith > Masterworking
- Place your item in the masterworking interface
- Click "START BOT" in the helper tool
- The bot will automatically click upgrade buttons
- It monitors for your desired affix after each attempt
- Press ESC at any time to stop the bot immediately
- Move mouse to screen corner to trigger PyAutoGUI failsafe
- Bot stops automatically after reaching success target
- Completion sound plays (if enabled)
- Statistics show total attempts and success rate
Multiple Failsafe Mechanisms:
- ESC Key: Immediately stops all automation
- PyAutoGUI Failsafe: Move mouse to corner to stop
- Window Focus Detection: Pauses when Diablo IV loses focus
- Maximum Attempt Limits: Prevents infinite loops
- Configurable Delays: Reduces detection as automation
"Missing required images" error:
- Ensure all reference images are in the
resources/folder - Check that image files are PNG format
- Verify filenames match exactly (case-sensitive)
Bot doesn't detect buttons:
- Lower the "Other Elements Threshold" in settings
- Ensure Diablo IV UI language is English
- Check that UI elements aren't obstructed
- Try different screen resolution or UI scale
Affix detection not working:
- Recapture your desired affix with more precision
- Adjust "Affix Detection Threshold" (try 0.70-0.85)
- Ensure affix image captures only the text/icon
- Verify the affix appears exactly as captured
Bot clicks wrong locations:
- Check Windows display scaling settings
- Ensure Diablo IV is in Fullscreen mode
- Recapture reference images at current resolution
- Close unnecessary applications to improve detection speed
- Use borderless windowed mode for better compatibility
- Ensure stable FPS in Diablo IV for consistent UI
- Avoid moving/resizing the Diablo IV window after setup
Diablo-IV-Masterworker-Helper/
├── Diablo-IV-Masterwork-Companion.py # Main application
├── resources/ # Reference images
│ ├── *.png # UI element images
│ └── sound/ # Sound effects
│ └── *.mp3
├── README.md # This file
└── requirements.txt # Python dependencies
The code is structured with modular classes:
ImageManager: Handles reference image loadingBotEngine: Core automation logicMouseUtils: Human-like movement algorithmsSoundManager: Audio effect handlingMasterworkerGUI: User interface
- Fork the repository
- Create a feature branch
- Test thoroughly with various scenarios
- Submit a pull request with detailed description
- English UI Tested only - Other languages unsure
- Windows primarily tested - macOS/Linux may have issues
- Screen resolution dependent - May require recapture at different resolutions
- Game updates - Major UI changes may break functionality
- v1.0.0 - Initial release with basic automation
- v1.1.0 - Added human-like mouse movement
- v1.2.0 - Improved detection algorithms and GUI enhancements
- Issues: Report bugs via GitHub issues (if applicable)
- Discussions: Community forum or Discord (https://discord.gg/E2vFCTCk)
- Updates: Check for new releases regularly
This software is provided "as is" without warranty of any kind. The developers disclaim all liability for any damages or account actions resulting from use of this tool. Users are responsible for complying with all applicable terms of service and local laws.
Diablo IV is a trademark of Blizzard Entertainment, Inc. This project is not affiliated with or endorsed by Blizzard Entertainment.
Remember: Use at your own risk. Game automation tools can result in account penalties or bans.