An advanced automation tool for Metin2 using YOLOv8 for real-time object detection and OpenCV for visual processing. This bot is designed to detect and farm stones (Metins) autonomously.
Disclaimer: This project is for educational purposes and to demonstrate computer vision applications. Use at your own risk.
- AI-Powered Detection: Uses YOLOv8 to identify stones in real-time.
- Smart Logic: Prioritizes the nearest stone and avoids redundant clicks.
- Auto Skill Casting: Automatically dismounts, casts predefined skills, and remounts at set intervals.
- Auto Respawn: Detects character death and clicks the "Restart" button via template matching.
- GUI Control Panel: User-friendly interface to manage bot states and timings.
This repo includes two specialized YOLOv8 models:
best.pt: Optimized for Red Forest (Kızıl Orman) stones.best2.pt: Optimized for the Custom Map (snow_stone).
Switch between them by modifying MODEL_PATH in config.py.
- Skill Setup: Place your buff/utility skills on slots 1 and 2. The bot is configured to use these keys.
- Attack Duration: In the GUI, set the Attack Duration (s) (e.g., 5.0 or 7.0). This defines the time the bot waits before looking for the next stone after a click.
- Buff Interval: By default, the bot casts skills every 25 minutes (1500 seconds). You can change this by editing
SKILL_INTERVALinconfig.py. - Admin Privileges: You MUST run your terminal/IDE as Administrator for the mouse and keyboard emulation (SendInput) to work within the game.
- Window Mode: The game must not be in full screen. Run it in windowed mode for the bot to function properly.
To adapt the bot to different maps:
- Data Collection: Take 30-50 screenshots of the target stones from various angles. Reference examples are in
Stones_img/. - Annotation: Create a project on Roboflow (free), upload images, and draw bounding boxes.
- Training: Train a YOLOv8 model using Roboflow's cloud training or locally.
- Deployment: Save the
.ptweights in the project folder and updateconfig.py.
For a detailed walkthrough, check out the original project foundation: jamnicki/metin2_vision_bot.
-
Clone the repository:
git clone https://github.com/muhammetsimssek/Metin2-AI-Vision-Bot.git cd Metin2-AI-Vision-Bot -
Install dependencies:
pip install -r requirements.txt
-
Launch the Bot:
python main.py
Developed by Muhammet