A comprehensive, AI-driven autonomous bot for fish table arcade games with adaptive learning, advanced targeting, and self-evolution capabilities.
- Autonomous Operation: Fully autonomous shooting with human-controlled safety hotkeys
- Multi-Player Support: Detects and tracks 1-6 player games
- Adaptive Difficulty: Learns from own shots and observes other players
- Dynamic Shot Cost Management: Automatically adjusts shot cost based on bankroll and ROI
- Bankroll Protection: Prevents bankroll from dropping below safe threshold
- YOLO v8 OCR: Real-time score and shot cost detection
- Motion Tracking: ByteTrack + optical flow for fish tracking between OCR updates
- Window Adaptation: Works with any Chrome window size and monitor configuration
- Player Seat Detection: Automatic identification of 1-6 player configurations
- AI-Powered Classification: Learns fish types and multipliers from observations
- Cluster Detection: Identifies and prioritizes groups of fish for multi-kills
- Linear Formation Recognition: Detects linear fish arrangements for burst fire
- Kill Stealing: Intelligently steals kills on low-HP fish
- Multiplier Learning: Updates expected values based on observed player kills
- Q-Learning System: Learns optimal state-action pairs
- Pattern Recognition: Analyzes other players' strategies
- Table Phase Detection: Identifies GIVING vs TAKING modes
- Performance Metrics: Tracks ROI, win rate, and strategy effectiveness
- Aggressiveness Scaling: Continuously adjusts risk level (-100 to +100)
- GitHub Integration: Automatically checks for and tests strategy updates
- Code Self-Healing: Attempts to fix common errors autonomously
- Safe Integration: Validates and tests new strategies before deployment
- Performance Comparison: Reverts strategies if they degrade performance
- Trajectory Prediction: Predicts fish movement and future positions
- Convergence Detection: Identifies when fish will intersect
- ROI Optimization: Adjusts shot costs for optimal return on investment
- Session Persistence: Saves learning state between runs
- Performance History: Tracks all shots and outcomes for analysis
├── main.py # Main orchestrator and game loop
├── config.py # Global configuration and constants
├── window_detector.py # Chrome window detection and adaptation
├── player_detector.py # Player seat detection (1-6 players)
├── yolo_ocr.py # YOLO v8 OCR for scores/shot costs
├── motion_tracker.py # ByteTrack + optical flow tracking
├── fish_classifier.py # Fish classification and multiplier learning
├── game_state.py # Game state and entity management
├── targeting_engine.py # Advanced targeting algorithms
├── shot_manager.py # Shot execution and bankroll management
├── learning_system.py # AI learning from observations
├── strategy.py # Strategy selection and adaptation
├── hotkey_manager.py # Hotkey input handling
├── self_evolution.py # GitHub integration and self-healing
└── strategies/ # Directory for learned strategies
| Key | Action |
|---|---|
a |
Toggle autofire ON/OFF |
[ |
Lower shot cost (-5) |
] |
Raise shot cost (+5) |
p |
Pause/Resume bot |
- |
More conservative (aggressiveness -10) |
+ |
More aggressive (aggressiveness +10) |
Hold q |
Exit program (hold for 2 seconds) |
- Python 3.10+
- Windows OS (tested on Windows 10/11)
- Chrome/Chromium browser
- Tesseract OCR installed (for pytesseract)
- Download Tesseract installer: https://github.com/UB-Mannheim/tesseract/wiki
- Install to default location (usually
C:\Program Files\Tesseract-OCR) - Update
config.pyif installed to different location
git clone <repo-url>
cd f3
python -m venv venv
venv\Scripts\activatepip install -r requirements.txt
# Download YOLO model (will happen automatically on first run)
# But you can pre-download:
python -c "from ultralytics import YOLO; YOLO('yolov8n.pt')"Edit config.py to customize:
OCR_CONFIDENCE_THRESHOLD- YOLO OCR sensitivityBANKROLL_MIN_THRESHOLD- Minimum bankroll to maintainAGGRESSIVENESS_SCALE- Default risk level (-100 to +100)GITHUB_TOKEN- For strategy auto-updates (optional)
python main.py- Launch the fish table game in Chrome
- Run the bot - it will:
- Find Chrome window
- Detect player count and seats
- Identify your seat (bottom player)
- Initialize all systems
- Enable autofire with
akey - Press
aagain to enable shooting
The bot displays real-time status:
[STATUS] Time: 45s | Autofire: ON | Bankroll: 5200 | Shot Cost: 15 | Fish: 8 | Phase: GIVING | Aggr: 20
logs/- Session logs and errorsstrategies/- Learned strategies and databasesmodels/- Downloaded YOLO models
- Observation: Records every shot and its outcome
- Classification: Learns fish types from visual features
- Multiplier Learning: Updates expected values from kills
- Pattern Recognition: Analyzes other players' strategies
- Adaptation: Adjusts own strategy based on performance
[+] Learning Metrics:
- Total observations: 487
- Recent avg ROI: 2.45
- Win rate: 68%
- Fish classes learned: 4
- Players analyzed: 2
Performance
OCR_UPDATE_FREQUENCY = 0.5 # Update OCR every 0.5 seconds
MOTION_UPDATE_FREQUENCY = 0.016 # Motion tracking at ~60 FPS
ENABLE_MOTION_TRACKING = True # Use motion between OCR updatesBankroll Management
BANKROLL_MIN_THRESHOLD = 50 # Never drop below 50 points
BANKROLL_BUFFER_PERCENT = 0.10 # Keep 10% buffer
MIN_SHOT_COST = 1
MAX_SHOT_COST = 100Targeting
CLUSTER_RADIUS = 50 # Pixel radius for clustering
LINEAR_FORMATION_THRESHOLD = 0.95 # Correlation for linear detection
LOW_HP_THRESHOLD = 0.25 # Fish HP for kill stealingAI Learning
LEARNING_RATE = 0.01
DISCOUNT_FACTOR = 0.99
EXPLORATION_RATE = 0.1-
Initial Calibration
- Run bot in practice/demo mode first
- Let it observe 10-20 kills to calibrate multipliers
- Watch aggressiveness adjustment
-
Bankroll Growth
- Start conservative (
-50aggressiveness) - Increase aggressiveness as winrate improves
- Target 2.0+ average ROI before increasing shot cost
- Start conservative (
-
Table Selection
- Works best on GIVING tables
- Automatically becomes conservative on TAKING tables
- Avoid tables with erratic multipliers (game bugs)
-
Monitor Health
- Check
logs/for errors - If OCR fails, verify Tesseract installation
- If motion tracking lags, check CPU usage
- Check
- Ensure game is running in Chrome browser
- Run bot as Administrator
- Check that Chrome window is visible
- Increase
OCR_CONFIDENCE_THRESHOLDin config.py (but may miss detections) - Ensure score boxes are clearly visible
- Try different monitor resolutions
- Increase
BANKROLL_MIN_THRESHOLD - Set more conservative aggressiveness (
-) - Check that initial bankroll detection is correct
- Disable with
ENABLE_MOTION_TRACKING = Falsein config.py - Reduce
FRAME_RATEor skip more frames - Close other heavy applications
Detects groups of fish and shoots through center for multi-kills.
Identifies linear arrangement of fish and fires burst through all targets.
Monitors all fish HP and prioritizes low-HP fish for quick kills.
Calculates expected return vs shot cost:
- Conservative: ROI > 2.5
- Balanced: ROI > 2.0
- Aggressive: ROI > 1.5
- GIVING: 60%+ players gaining points → increase aggressiveness
- TAKING: All players losing → become conservative
- NEUTRAL: Mixed results → balanced approach
Bot automatically:
- Checks GitHub for new strategies (daily)
- Tests strategy safety
- Validates performance improvements
- Integrates if ROI improves >10%
- Reverts if performance degrades
Bot saves between sessions:
learning_state.json- Learned Q-values and shot historyfish_database.json- Classified fish and multipliersevolution_state.json- Integrated strategies- Session logs for analysis
This bot is for:
- Practice/learning games only
- Personal use
- Authorized arcade games only
Not for:
- Real money gambling
- Unauthorized game hacking
- Commercial distribution
Use at your own risk. Always verify legality before use.
MIT License - See LICENSE file
Improvements welcome! Areas for contribution:
- Better fish detection algorithms
- Multiplayer coordination strategies
- Performance optimizations
- Additional game variants
For issues:
- Check troubleshooting section
- Review logs in
logs/directory - Ensure all dependencies installed correctly
- Run in administrator mode
Fish Table Game Bot v1.0 - Master the arcade with AI assistance! 🎯🐟