League of Legends Last Hit Bot

This repository contains the code for a bot designed to automate the last-hitting process in League of Legends. The bot utilizes object detection techniques to identify and prioritize minions for last hits. The entire development process, from initial concept to final results, is documented in a YouTube video.

Features

  • Object Detection: Uses YOLOv9 for detecting minions.
  • Customizable Parameters: Allows customization of target minion color, screen resolution, and other parameters.
  • Visualization: Option to visualize the bot's decision-making process in real-time.

Installation

  1. Clone this repository:
git clone https://github.com/cengineer13/last-hit-bot.git
cd last-hit-bot
  1. Install the required dependencies:
pip install -r requirements.txt

Note: The requirements.txt includes a dependency on the YOLOv9 repository. Ensure that you have it set up correctly.

  1. Download the trained YOLOv9 weights from this link and place them in the appropriate directory.

Usage

Run the bot using main.py:

python main.py

Parameters

  • monitor_idx: The index of the monitor to capture screenshots from (0 for primary monitor).
  • visualize: Set to True to enable visualization, False to disable.
  • minion_color: Specify the color of minions to target (e.g., blue, red).
  • H: Half the height of the screen resolution.
  • W: Half the width of the screen resolution.

Example:

python main.py --monitor_idx 0 --visualize True --minion_color red --H 540 --W 960

Contributing

If you'd like to contribute, feel free to fork the repository and submit a pull request. Contributions, bug reports, and feature requests are welcome!

Acknowledgments

YOLOv9 for the object detection framework.