SkillAgentSearch skills...

BrawlStarsBotMaking

All the ressources you would need to create your very own external brawl stars bot.

Install / Use

/learn @AngelFireLA/BrawlStarsBotMaking
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

BrawlStarsBotMaking

All the ressources you would need to create your very own external brawl stars bot.

In this repository, you will be finding basic guides and other resources that would help you code your own Brawl Stars Bot.

Notes :

  • This is meant to help make an external Brawl Stars bot, which means this won’t help reverse engineering, accessing memory, injecting, or anything like that, in case you planned to do a dodgebot or an aimbot. (They are possible but much more difficult and it’s not the type of bot we’ll be focusing on). An external bots relies on getting data from an external point of view, like screenshots for example, and uses external means to interact with the game, like we will see later.
  • Knowing Python : The ressources here will primarily be intended for Python, and even though some of the things can be used with other languages, always assume we’re talking about Python.
  • Having a computer : An external Brawl Stars bot is maybe possible on mobile, but it’s very unlikely it would use python, and in general it’s more difficult because of the restrictions of Android phones (and I won’t even start talking about iOS devices).

This is, at the time of writing (28/05/2025), only my knowledge, so feel free to contact me on Discord (link at the end) or make a pull request.

Setting up the basics

Setting up the environment

Python

First, if not already done, you need to download and install Python.
Then, you will need an IDE, which is “an advanced text editor” that makes coding way easier.
The most popular ones are :

  • PyCharm (Python only)
  • Visual Studio Code Community (multi-languages)

I also recommend you learn about virtual environments, which are isolated Python instances with their own libraries, very useful to speed up starting time and keeping the different projects separated.

Once you have your project on your IDE and your environment, you’re ready to start making your bot.

Brawl Stars

To make a Brawl Stars bot, you will need somewhere to actually play Brawl Stars.
The easiest and most common way is using an Android Emulator such as for example:

The most important aspect is that the emulator supports being able to turn key presses on your keyboard into actions on the emulator, like pressing somewhere, moving a joystick, etc… As the other alternative will be much more difficult.

Once you have your emulator, just install Brawl Stars on it. You can use the Play Store, or any other app store, or even install Brawl Stars using its APK.

Setting up Input/Output for your bot

Input

First, you want to be able to get information about what’s happening in Brawl Stars so the bot can do whatever you want.
For that, we will be using screenshots.

Python has many screenshotting libraries, with all their own advantages and disadvantages (I will also give you snippets of code on how to do a full screen capture, if you want to capture a specific part of the screen you’ll have to research it based on the library you chose) :

  • PyAutoGUI : This library is useful not only for taking screenshots, but also to click or handle the keyboard. It’s one of the easiest to use, but it’s by far one of the slowest, so it’s only recommended if you’re not very familiar with Python or if speed isn’t the priority for you yet.

    import pyautogui  
    screenshot = pyautogui.screenshot()  
    
  • Mss : This library is a good compromise between speed, ease of use, and stability.

    import mss  
    with mss.mss() as sct:  
        img = sct.grab(sct.monitors[1])   
    

    This will take a full capture of your primary screen.

  • BetterCam: It’s one of the fastest screenshotting libraries. It’s a bit longer to set up, and the main issue is that it’s not the most stable, sometimes the screen capture failing and returns Nothing, but even by taking into account the retries needed, it’s really fast.
    For PylaAI for example, if we detect a capture failed, we just retry in a while loop until it works.
    Or you could use another library as backup, for example “if screen capture fails, try again with Mss”.
    To use it, you’ll first need to create a “camera” which is what you’ll be using to take screen captures whenever you need one.

    import bettercam  
    camera = bettercam.create()  
      
    camera.grab() # this is to take a screen capture  
    
  • PyWin32 : This library uses a more fundamental usage of the Windows API, which allows it to be really efficient when correctly used. You can use it to take screenshots, move the mouse, click, use the keyboard, and other things, but it’s more complicated to use, and at least for screenshots, isn’t the fastest.

To process your screenshots you will need image handling libraries. I recommend OpenCV as it’s faster than another popular alternative Pillow, and it’s installed by default if you install Bettercam) with it you can crop, resize, recolor, etc… your images easily.
To install it pip install opencv-pyton and import it with import cv2.

Output

Now that you have your images, it will be your job to extract information you want from them and then pick actions.
To control your emulator, the easiest way is to use Key-Mappings, which is making specific keyboard keys do specific actions in game. For example with PylaAI :
image

Those key-mappings make it so whenever the E key is pressed, it presses on the super button (there is no key on the attack button because when the super isn’t ready, the super button automatically acts as the attack button).
More than just a simple key->button, you can see on the left that most emulators also allow keys to be used for joysticks.

So, to make your bot actually do stuff, you just have to pick what key you want to do what, and make your code press that key when you want.
To do that, you once again have a few options :

  • PyAutoGUI : I already talked about it before, pyautogui is slow but can also be used to handle the keyboard :
    import pyautogui  
      
    pyautogui.press('a') # Presses the 'a' key  
      
    pyautogui.write('hello world') # type a string  
      
    pyautogui.keyDown('shift')  
    pyautogui.press('a') # hold keys  
    pyautogui.keyUp('shift')  
    
  • Keyboard : It’s much faster and allows you to do the same things as PyAutoGUI :
    import keyboard  
    keyboard.press_and_release('a')  
    keyboard.write('hello world')  
    keyboard.press('a')  
    keyboard.release('a')  
    

Some people also talked about using ADB to send inputs directly to the emulator, but I’m not knowledgeable enough to know if it’s possible without drawbacks, and if yes how, so unless someone expands on this section, we will stay with keyboard-only inputs.

Using the Screenshots

Knowing what part of the game you are in

You can now get screenshots of the emulator and you know you want to use that information to turn into keyboard/mouse presses, so the first thing is to actually know what you’re looking at, if you’re in the lobby, in a battle, waiting for a battle to start, etc…

Template Matching

The easiest way is to use Template Matching. It’s simple, you take an image of your choice, and you check if it’s inside a given image.
For example, to know if you’re in the Lobby, you could look for the brawler menu button icon inside the screenshot.
Someone wanted to make a bot that would tell them if they’re still in matchmaking, and you could use Template Matching to easily do that, by searching for the “Exit” button (when it’s still red, as when it isn’t anymore, it means we found a match).

For that, you can use the library OpenCV which I mentioned before, as it has a function specially for that.
Here’s a simple function that checks if an image (the template) is in the screenshot :

confidence_min = 0.8 # confidence is between 0-1 and the closer to 1, the more sure the predictions need to be to count, because sometimes there could be something that doesn’t match exactly so it’s not sure  
def is_template_in_screenshot(template, screenshot):  
    result = cv2.matchTemplate(template, screenshot, cv2.TM_CCOEFF_NORMED)  
    min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(result)  
    if max_val > confidence_min:  
        return True  
    else:  
        return False  

The template image would be an image you saved locally and loaded somewhere else in your script.

Tip : You would preferably crop the screenshot before so it only looks in the area you know the template is supposed to be, because it makes it faster and you’re less likely to find something else that would cause a false detection.

You can use OpenCV to crop an image too :

# you load opencv, your screenshot etc…  
# if we consider (x1, y1) the coordinates of the top left corner, and (x2, y2) the coordinates of the bottom right corner, of the area of the image you want to get  
x1, y1, x2, y2 = 0, 0, 100, 100  
cropped_image = screenshot[y1:y2, x1:x2] #returns the are between the corners (0, 0) and (100, 100)  

OCR

Another way to know where you are is to use OCR.
OCR is detecting text within an image.

It’s useful because you could use it to detect if the bot won or lost a match by detecting the texts “Victory” or “Defeat” or “Draw” or you can use it in the brawler menu to find the position of the icon of the brawler you’re looking for. (you might have to scroll, for that, using a keyboard, you can press the mouse, move it

View on GitHub
GitHub Stars11
CategoryDevelopment
Updated2d ago
Forks1

Languages

Python

Security Score

75/100

Audited on Mar 30, 2026

No findings