ericlove02 / Valorant-Bot

Python bot using Computer Vision and Arduino to play VALORANT practice bot challenges
8 stars 1 forks source link

Valorant-Bot

Forks Stargazers Issues

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contact

About The Project

I play a fair amount of VALORANT in my free time, so I decided to combine two of my hobbies and challenged myself to create a bot that could complete the practice session of VALORANT without human input. VALORANT and Riot Games in general has a very storng anti-cheat system, so the task was not as easy as other games, which could use injection bots or easily manipulate game inputs.
For this project, the bot needed to be GUI based, with minimal interaction with the game. This meant usint PyTorch and OpenCV to do all of the detection. While the game is open, the program runs in the background, taking around 20 screenshots second and using a pretrained PyTorch model to search for bots in the field of view. When a bot is detected, the program uses a the height of the selected bot to target the head, as shooting the head is a one-shot kill in VALORANT. At this point, the detection portion of the bot is complete, and it us up to the inputs to finish the job.
With the coordinates of the head selected, the bot passes the information to an Arduino through serial communitcation, and the Arduino acts as a mouse to the computer, so as not to be detected and block by the anti-cheat. The bot continues detecting and click one heads until all the bots are killed and the round is complete.
For the bot to complete all of these actions at the same time, this program uses multithreading, with bot detection, screencapture, movement, and shooting each on their own threads.

Disclaimer: This bot was not created as a guide for people who want to cheat in VALORANT. This was created as a fun project and should not be used to ruin the game. I plan on implemnting a fail-safe that will stop the bot from functioning in online games.

Built With

(back to top)

Getting Started

Prerequisites

   py install pip

Installation

  1. Clone the repo
    git clone https://github.com/ericlove02/Valorant-Bot.git
  2. Install required packages
    pip install -r requirements.txt
  3. Run main.py
    py main.py

(back to top)

Usage

https://user-images.githubusercontent.com/53005525/138217033-50f1d75c-08e2-4c0b-ae6b-887c768ab35a.mp4

https://user-images.githubusercontent.com/53005525/138217040-2e148102-ddbc-401d-9f45-b225a198affa.mp4

Screen recording the output significantly dropped the frame rate.

Contact

Eric Love - LinkedIn - eric.love02@yahoo.com

Project Link: https://github.com/ericlove02/Valorant-Bot

(back to top)