gmaf / BrawlStarsBot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BrawlStarsBot

Brawl stars bot for farming mastery through solo showdown. The bot will find bushes and hide, it also attacks enemies if they are within range. Macro is integrated into the code to automate when defeated, it will queue up for another match automatically.

⚠️ DISCLAIMER!! You can lose trophies while using the bot!! ⚠️ The bot's goal is to farm mastery.

Info

Inspired by OpenCV Object Detection in Games Python Tutorial playlist by "Learn Code By Gaming" and "How To Train YOLOv5 For Recognizing Game Objects In Real-Time" by "Jes Fink-Jensen".

The Bluestacks app player is used to emulate Brawl Stars onto the computer. Bluestacks default game control is modified. The bot works well with tanky brawlers and on maps with little obstacles (wall, bush, fence, etc) and a lot of bush. A recommended map to run the bot on is island invasion, using short/medium range and tanky brawlers such as Frank, Sam, Buster, Pearl, Nita, etc.

Bot features

  • Fully automated
    • When the player is defeated, it will exit the match
    • Requeue another match
    • Start the bot when loading in
  • Find the closest bush and hide in it
  • Attack the enemy when they are in the range
  • Activate gadget when the enemy is closer to the player

Demo of the bot: Watch the video

Requirement

  • Windows OS
  • Bluestacks 5 to run brawl star
  • Python>= 3.8.0 installed (I used version 3.11.6)

How to install and run the bot?

1. Clone Repo

  1. Clone the repository
git clone https://github.com/Jooi025/BrawlStarsBot.git
  1. Install the required library
cd BrawlStarsBot
pip install -r requirements.txt

2. Importing game control

How to import game control

3. Testing and changing values

Important - please disable Bluestacks' ads and close the left sidebar for the bot to work as intended

  1. Run "detection_test.py" to check if object detection is working

  2. Change the brawler_name in "constants.py" to your selected Brawler's name and run "constant.py".

  3. If the brawler's stats in not found manually change the speed, attack range and height scale factor located below brawler_name at "constant.py" to the brawler's speed and range and to find the height scale factor run "hsf_finder". Also modify sharpCorner (True if the map has many walls, otherwise False) and centerOrder ( True if brawler spawns in the middle of the map, otherwise False).

  4. Run "main.py"

  5. Select solo showdown and "start bot" (enter 1)

Update Repo

cd BrawlStarsBot
git pull

Improvement to be made

  • bot can attack power cube boxes and collect them
  • improve detection of enemy (less false detect)
  • change player detection
  • improve storm direction function
  • improve the screen detection of "defeated"
  • fix spam printing of "stop bot"
  • improve fps for lower performance computer

About

License:MIT License


Languages

Language:Python 100.0%