Skip to content

Advanced automation tool using YOLOv8 and OpenCV for real-time object detection and autonomous farming in MMORPG (Metin2)

Notifications You must be signed in to change notification settings

muhammetsimssek/Metin2-AI-Vision-Bot

Repository files navigation

Metin2 AI Vision Bot ⚔️💎

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.

🚀 Features

  • 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.

🧠 Pre-trained Models

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.

🛠️ Configuration & Important Notes

  • 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_INTERVAL in config.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.

📈 How to Train for Custom Maps (Roboflow)

To adapt the bot to different maps:

  1. Data Collection: Take 30-50 screenshots of the target stones from various angles. Reference examples are in Stones_img/.
  2. Annotation: Create a project on Roboflow (free), upload images, and draw bounding boxes.
  3. Training: Train a YOLOv8 model using Roboflow's cloud training or locally.
  4. Deployment: Save the .pt weights in the project folder and update config.py.

For a detailed walkthrough, check out the original project foundation: jamnicki/metin2_vision_bot.

📦 Installation

  1. Clone the repository:

    git clone https://github.com/muhammetsimssek/Metin2-AI-Vision-Bot.git
    cd Metin2-AI-Vision-Bot
  2. Install dependencies:

    pip install -r requirements.txt
  3. Launch the Bot:

    python main.py

Developed by Muhammet

About

Advanced automation tool using YOLOv8 and OpenCV for real-time object detection and autonomous farming in MMORPG (Metin2)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages