A package that simplifies the creation of bots that react to the screen in real time, for example your health gets low in a game so it automatically drinks a potion. Only works on Windows.
- Screen Capture: Take screenshots of specific regions or entire screens
- Image Recognition: Find images on screen with template matching and scaling
- OCR (Optical Character Recognition): Extract text and numbers from screen regions
- Color Detection: Detect specific colors in screen regions
- Automated Input: Click, move mouse, and interact with applications
- Window Management: Work with specific windows or full screen
- Custom Interpreter: Secure script execution environment
- Bar/Gauge Reading: Extract percentage values from health bars, progress bars, etc.
pip install simple-botmaker
git clone https://github.com/yourusername/simple-botmaker.git
cd simple-botmaker
pip install -e .
- Operating System: Windows (uses Windows-specific libraries)
- Python: 3.7 or higher
- Dependencies: All dependencies are automatically installed via pip
import simple_botmaker as sb
# Initialize settings for a specific window (optional)
sb.SETTINGS.window_name = "My Game Window" # Leave None for full screen
sb.SETTINGS.monitor = 0 # Monitor index
sb.SETTINGS.debug = True # Enable debug mode
# Take a screenshot of a region
screenshot = sb.TakeRegionScreenshot(100, 100, 200, 150)
# Find an image on screen
result = sb.FindImageInRegion(0, 0, 1920, 1080, "template.png", threshold=0.8)
if result:
print(f"Found image at: {result['x']}, {result['y']}")
sb.Click(result['x'], result['y'])
# Read text from a screen region
text = sb.GetText(100, 100, 300, 150)
print(f"Extracted text: {text}")
# Get health bar percentage
health_percent = sb.GetBar(50, 50, 200, 70, threshold=128)
print(f"Health: {health_percent}%")
# Get color-based bar (e.g., red health bar)
health_percent = sb.GetBarByColour(50, 50, 200, 70, 'red', tolerance=30)
print(f"Red bar: {health_percent}%")
TakeRegionScreenshot(x, y, width, height, grayscale=False, monitor=0)
- Capture screen regionGetPixelColour(x, y)
- Get color of a specific pixel
FindImageInRegion(x, y, width, height, template_path, threshold=0.8, ...)
- Find template imageLoadFrameFromPath(path, grayscale=False)
- Load image from file
GetText(x1, y1, x2, y2, one_word=False, threshold=128, ...)
- Extract textGetValue(x1, y1, x2, y2, threshold=128, ...)
- Extract numeric valuesCapture2Text(frame, numeric_only=False, ...)
- OCR on image frame
GetBar(x1, y1, x2, y2, threshold=128, ...)
- Get percentage from binary thresholdGetBarByColour(x1, y1, x2, y2, color, tolerance=30, ...)
- Get percentage by color
Click(x, y, delay=100)
- Click at coordinatesMouseMove(x, y, delay=100)
- Move mouseFocusedClick(x, y, focusDelay=100, delay=100)
- Move then click
SaveObject(fileName, obj)
- Save object to fileLoadObject(fileName)
- Load object from fileSetRegions()
- Interactive region selection tool
GetWindowByName(window_name)
- Get window objectGetScreenResolution(monitor=0)
- Get screen dimensionsGetScreenCoordinatesFromWindowCoordinates(window_name, x, y)
- Convert coordinates
Use the SetRegions()
function to interactively select regions on your screen:
import simple_botmaker as sb
# Launch interactive region selector
sb.SetRegions()
This will:
- Show you a list of available windows
- Let you select regions, pixels, or screenshots
- Save the coordinates and images to a timestamped folder
- Generate a text file with all coordinates for easy copying
The package includes a secure interpreter for running scripts with restricted access:
# Run a script with the custom interpreter
simple-botmaker-interpreter your_script.py
# Check script for issues without running
simple-botmaker-interpreter --check your_script.py
Configure global settings:
import simple_botmaker as sb
# Configure for a specific window
sb.SETTINGS.window_name = "Game Window"
sb.SETTINGS.monitor = 0 # Primary monitor
sb.SETTINGS.debug = True # Enable debug output
# Or work with full screen (default)
sb.SETTINGS.window_name = None
import simple_botmaker as sb
import time
sb.SETTINGS.window_name = "My Game"
while True:
# Check health bar (red color)
health = sb.GetBarByColour(100, 50, 200, 70, 'red')
if health < 30: # Health below 30%
# Click health potion
sb.Click(500, 600)
print("Used health potion!")
time.sleep(2)
time.sleep(0.5) # Check every 500ms
import simple_botmaker as sb
# Read game score
score_text = sb.GetValue(800, 50, 900, 80)
print(f"Current Score: {score_text}")
# Check if specific text appears
status_text = sb.GetText(400, 200, 600, 230, one_word=True)
if status_text == "READY":
sb.Click(500, 300) # Click start button
- Windows: Full support (primary platform)
- macOS/Linux: Not supported (uses Windows-specific libraries)
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add 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.
This software is intended for educational and automation purposes. Users are responsible for ensuring compliance with the terms of service of any applications they interact with. The authors are not responsible for any misuse of this software.
- Issues: GitHub Issues
- Documentation: This README and inline code documentation
- Examples: See the examples in the repository
- Initial release
- Core screen capture functionality
- Image recognition with template matching
- OCR support with Capture2Text integration
- Bar/gauge reading capabilities
- Interactive region selection tool
- Custom secure interpreter
- Full Windows automation support