|
|
# Python 3.8 or higher required
python --version# Install required packages
pip install ultralytics opencv-python numpy mss pynput pywin32 torch torchvision- Clone or download this repository
- Place your trained model at
runs/detect/train/weights/best.pt - Run the script:
python claude.py
When you run the script, you'll be prompted to configure:
┌─────────────────────────────────────┐
│ Enter screen capture width │
│ (default 1920): │
│ │
│ Enter screen capture height │
│ (default 1080): │
│ │
│ Enter in-game sensitivity │
│ (e.g. 0.6): │
└─────────────────────────────────────┘
After startup, select your target class:
[Input] Enter new class name or index: 0
# Or use class name
[Input] Enter new class name or index: enemy| Parameter | Default | Description |
|---|---|---|
conf |
0.3 | Confidence threshold (0.0-1.0) |
imgsz |
320 | Inference image size |
device |
auto | GPU (0) or CPU |
| Parameter | Default | Description |
|---|---|---|
sens_multiplier |
1.3 / sensitivity | Mouse movement multiplier |
x_threshold |
35 | Horizontal crosshair tolerance |
y_top_threshold |
25 | Vertical top tolerance |
y_bottom_threshold |
50 | Vertical bottom tolerance |
# Targets closest to crosshair (center of screen)
best = min(candidates, key=lambda c:
(c['center'][0] - screen_cx)**2 +
(c['center'][1] - screen_cy)**2
)| Key/Button | Function |
|---|---|
| Ctrl | Snap to Target - Instantly move crosshair to locked target |
| MB5 | Auto-Shoot - Automatically fire when target in crosshair |
| ESC | Exit - Close overlay and quit application |
graph LR
A[Detection] --> B{Target Found?}
B -->|Yes| C[Lock Target]
B -->|No| D[Search]
C --> E{Ctrl Pressed?}
E -->|Yes| F[Snap Cursor]
E -->|No| G[Track Only]
F --> H{In Crosshair?}
G --> H
H -->|Yes + MB5| I[Auto Fire]
H -->|No| J[Wait]
- 🟢 Green Boxes - Detected targets with confidence scores
- 🔴 Red Circles - Target center points (adjusted for headshots)
- 🟡 Yellow Text - Real-time FPS counter
- 🔴/🟢 Status - SHOOTING (red) / READY (green)
- ⚪ Clean Design - Minimal overlay for maximum visibility
# Aims 40% above center of bounding box
cy = int((y1 + y2) / 2 - 0.4 * box_height)# In claude.py, line ~215
results_gen = model.predict(
frame,
conf=0.3, # Change this: lower = more detections, higher = fewer but accurate
device=device,
imgsz=320,
stream=True,
verbose=False
)# Customize for different weapons
pattern = [
(1, 6), (0, 4), (-4, 14), (4, 18),
# Add your weapon's spray pattern here
]# Current: Closest to crosshair
best = min(candidates, key=lambda c: distance)
# Alternative: Highest confidence
best = max(candidates, key=lambda c: c['conf'])Main Thread
├── Frame Grabber Thread (MSS screen capture)
├── Input Thread (class selection)
├── Keyboard Listener (Ctrl detection)
└── Main Loop
├── YOLO Inference (GPU)
├── Detection Processing
├── Target Tracking
├── Mouse Control
└── Overlay Rendering
Screen Capture → Color Conversion → YOLO Inference →
Batch Tensor Transfer → Detection Filtering →
Target Selection → Cursor Control → Overlay Draw
| Hardware | Resolution | FPS | Latency |
|---|---|---|---|
| RTX 3060 | 1920x1080 | 85+ | ~12ms |
| RTX 3070 | 1920x1080 | 110+ | ~9ms |
| RTX 4070 | 1920x1080 | 140+ | ~7ms |
| CPU Only | 1920x1080 | 15-25 | ~60ms |
✅ Batched GPU→CPU tensor transfers
✅ Direct memory access (no frame copying)
✅ Pre-calculated screen coordinates
✅ Integer arithmetic for distance
✅ Minimal overlay rendering
✅ Efficient threading
# Reduce image size for faster inference
imgsz=256 # or even 192
# Increase confidence threshold
conf=0.4 # reduces processing overhead# Lower confidence threshold
conf=0.15
# Check if correct class is selected
[Input] Enter new class name or index: 0- Ensure Ctrl is being held down
- Check
sens_multipliercalculation - Verify target is actually locked (purple line visible)
- Run as Administrator
- Check Windows compatibility mode
- Verify
win32guifunctions executed successfully
CSAI/
├── claude.py # Main application
├── README.md # This file
├── yolov8n.pt # Base model (optional)
├── runs/
│ └── detect/
│ └── train/
│ └── weights/
│ └── best.pt # Your trained model
└── data/
├── train/
├── valid/
└── test/
This software is for educational and research purposes only.
- Use responsibly and ethically
- Respect game terms of service
- Understand local laws regarding automation
- Not responsible for any bans or consequences
Improvements welcome! Areas for contribution:
- Multi-weapon recoil profiles
- Hotkey customization
- Config file support
- Performance profiling tools
- Additional game support
This project is open source and available for educational purposes.