Part 1: How do bots work?

How do bots work?

1. Introduction

This tutorial series will teach you how to create custom mobile game bots using C# and the SkyBots API + developer tools. Each part is designed to be bite-sized (pun-intended) and easy to follow.

At least some programming knowledge โ€“ preferably with C# โ€“ is required to follow along. There are many different tutorials out there if you are new to programming.

2. How do bots work?

In essence, only two types of bots exist:

  1. Android emulator based :+1:
  2. Reverse-engineering based :skull_and_crossbones:

Our bots retrieve screenshots from MEmu and decides what to do based on its contents. Afterwards they send a Tap(x, y) event to MEmu to perform an action. It follows naturally from this that bots only can perform actions that human players can.

The second option, reverse-engineering, is also a viable path. However, due to the potential legal ramifications, SkyBots does not engage nor encourage such activities. Additionally, going down that path would drastically reduce account safety (very high ban rates).


3. The logic flow of bots

Letโ€™s say we want our bot to attack a player and the flow of actions are:

  1. Find an opponent :mag_right:
  2. Configure troops :medal_military:
  3. Launch attack :crossed_swords:

If we were to look at the above actions from a bots point of view, they might translate to something like:

  1. Capture screenshot (bot needs to see what a human in its shoes would)
  2. Look for opponent in screenshot (e.g. a base) :mag_right:
    • If one is found go to 3
    • If not, perform a swipe to expand search and repeat 2
  3. Tap opponentโ€™s base :mag_right:
  4. Capture screenshot (game view changed because we tapped base)
  5. Configure troops :medal_military:
  6. Launch attack :crossed_swords:

While this example is slightly contrived, the flow fairly accurately portrays that of a real bot.

As a tiny exercise, you may pick an action from your favorite game and write/think out the logic flow required to perform your desired action.


4. Voila

This has been a very high-level flyover. If any of it intrigued you please check out part 2 where we download and configure the tools required for actually creating a bot.