Building a Clash Bot: The Hard Parts and the Dead Ends
This is not a piece about how the bot works. That one is already written: how ATLAS picks a base to attack covers what goes into the decision and what you control. If that is what you came for, start there.
This is the other half. What was actually difficult, which approaches got built and then thrown away, and the trade-offs that are still trade-offs. A Clash bot sounds like a weekend project when you start, because the game is slow and the loop looks simple. Train army, find base, drop troops, collect. The loop is simple. Everything around it is not.
The part I thought would be hard
Tapping. Hitting a button on a schedule is the first thing anyone writes and it works on the first try, which is exactly why so many people assume automating this game is solved.
Then the Attack button is one row lower than it was, because a season banner appeared above it. Then the village has been rearranged and the collectors are somewhere else. Then an update moves the whole bottom bar by a few pixels. A bot that knows where things were is wrong the first time the game changes anything, and the game changes something most weeks.
What replaced it was finding things by what they look like rather than where they sit. The button is whatever on screen is shaped like that button, wherever it happens to be this week. That change took longer than every other part of the bot and it is the reason the thing survives an update at all.
Telling a dead base from a trap
A dead base is somebody who stopped playing: full collectors, full drills, storages sitting there with nobody defending properly. A trap is a base built to look like that. Loot pushed out toward the edge, defences arranged so your troops walk into the middle of everything and die before they reach a storage.
From the screen, the two can look similar in the half second before you commit. What you can read is honest enough: how full the collectors look, whether storages are outside the walls or buried in the middle, where the defences sit relative to the loot, and what is reachable by the army you are actually carrying. What you cannot read is intent.
So this one does not get solved, it gets priced. The bot is deliberately a bit boring about it: loot it can walk to beats more loot it would have to fight through. That costs you the occasional good base. It also stops you feeding whole armies into a base built to eat them, and over a long session the boring version collects more.
Knowing when a raid is over
This sounds like the easiest question on the page and it is one of the hardest. A raid ends when your troops are dead, or when there is nothing left worth taking, or when the timer runs out, or when what you can still reach is not worth the seconds it would take.
Exit too early and you leave loot in storages you had already broken into. Exit too late and you are standing there watching three archers chew on a wall while the clock runs and the next raid does not start. The in-between case is the worst: a few troops alive, some loot left, no clear answer. Every rule written for it was wrong somewhere, and the version that shipped leans on how much the last stretch of a raid actually earns compared with starting a fresh one.
Everything the game puts on top
Clash is generous with popups. Season offers, event banners, clan invites, a new challenge, a gift, a notification that your builder finished. Each one lands over the thing the bot was about to tap.
The fix is not clever: expect it, recognise the shapes that mean "something is covering the village", close them, and carry on. The hard part was deciding what counts as safe to dismiss. A bot that confidently taps every button on every unknown screen will eventually spend your gems, and spending somebody's gems is not an error you get to apologise for. So the unknown screen gets the cautious treatment: close what is clearly a popup, back out of what is not, and stop rather than gamble.
Next base, or search a little longer
Every search costs gold, and each refusal pushes the price up. Keep skipping and you spend real loot on finding loot. Take the first base you see and you attack with an army that is wrong for it.
This is the knob that changes the feel of a session more than anything else, and it is yours, not ours. A high threshold means long searches and better bases. A low one means raiding constantly for less each time. The bot also tracks what it has already spent searching, because the right answer to "should I take this one" is different after twenty skips than it was after two. We ship defaults and then tell people to change them, because the answer depends on your trophy level and what you are actually short of.
Taps that do not tick like a clock
A loop that fires every 1.00 seconds is the easiest thing in the world to write and it does not look like anybody playing a game. People hesitate. They overshoot a drag and correct it. They take longer to react when the screen is busy and faster when they already know what they are about to tap.
So the timing is variable: reaction times drawn across a range, pauses in the places a person would pause, drags that are not perfectly straight lines. This is not a cloak and we do not sell it as one. Botting breaks Supercell's terms of service, an account can be banned, and no amount of jitter changes that. What it does mean is that the bot is not generating the single most obvious pattern available, and that your own limits on session length matter more than any of it.
When the emulator dies at 3am
Unattended means the thing has to survive what happens while nobody is watching. The emulator crashes. Windows decides to sleep. The game loses its connection and comes back on a loading screen. The game logged itself out.
Early versions handled all of this by stopping quietly, which is the worst possible behaviour, because you wake up to a session that ended at 11pm and a report that says nothing happened. What shipped instead recognises that the screen it is looking at is not the game it expected, works back to the village, and picks up the loop. When it cannot, it stops and says so in the report rather than leaving you to work out which hour it gave up in.
The dead ends
Three things got built far enough to judge, then cut.
Fixed tap scripts. The first version was a recorded sequence of taps at fixed coordinates. It worked beautifully on one village, on one emulator, at one resolution, on the day it was recorded. Change any of those and it taps empty grass. Macro scripts are still sold on this principle, and the comparison with macro scripts is really a comparison with that one decision.
A base scorer with too many opinions. A version that weighed a dozen things about a base before attacking it. It picked slightly better bases and spent so long deciding that the searching cost more than the improvement was worth. Cut back to the handful of signals that actually change the outcome.
Perfect army composition per base. The idea was to train an army to suit whatever base came up. Armies take time to train, bases are gone long before that, and the pairing never lines up. What shipped trains the next army during the current raid and picks bases that suit the army it has. Less clever, and it never stands idle.
What I would tell someone starting this
- Find things by what they look like, never by where they were. Anything else is a bot with an expiry date.
- Decide what an unknown screen means before you write the first tap. Cautious and stopped beats confident and spending gems.
- Treat stopping quietly as the worst bug in the project. An unattended tool that fails silently is worse than one that fails loudly, because you only find out hours later.
- Price the trade-offs instead of solving them. Dead base or trap, exit now or push on, skip or attack. None of those have right answers, and the ones that matter belong in settings the player controls.
See what came out of it
Farm, Trophy push, Builder Base and Clan Games in Clash of Clans, plus Trophy Road, Ranked and 2v2 in Clash Royale. Start with the free trial and watch what it skips.
Get Started