SkillAgentSearch skills...

AutoBTD6

The scripts contained in this repository allow you to automatically play any gamemode on any map in Bloons TD6

Install / Use

/learn @ANRAR4/AutoBTD6
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Introduction

The scripts contained in this repository allow you to automatically play any gamemode on any map in Bloons Tower Defence 6. <br> This can be used for automatically farming monkey money, player xp, tower xp, medals, achievements or collection event rewards. <br> Additionally the scripts allow you to record your own playthroughs to a textual description which can be automatically replayed afterwards.

The scripts have only been tested on Windows.

The config files (list of maps, monkey upgrade costs) are currently set up for Bloons TD6 v<span id="version">50.0</span>. <br> If Ninja Kiwi releases a new major version of Bloons TD6 and the repository is outdated you can easily update it yourself. <br> For more information refer to supporting new versions of Bloons TD6.

Please be aware Ninja Kiwi doesn't support modding or use of external scripts for automated farming and may flag or ban accounts as a result when using this or similar scripts (although this hasn't happend to any of my accounts yet).

Table of contents

  1. How the replay of a playthrough works<br>
  2. Usage / Modes of operation<br>
    1. Playing a specific playthrough<br>
    2. Playing a random map<br>
    3. Play a map with increased collection event rewards<br>
    4. Play playthroughs that grant missing achievements<br>
    5. Playing playthroughs that grant missing medals<br>
    6. Play the most efficient maps for player xp farming<br>
    7. Play the most efficient maps for monkey money farming<br>
    8. Validate playthroughs<br>
    9. Determine cost of each monkey, upgrade and hero<br>
    10. Gamemode parameter
    11. Category parameter
    12. Map parameter
    13. Hero parameter
    14. Optional arguments<br>
    15. Examples<br>
    16. Pausing / Stopping execution<br>
  3. Requirements / Installation<br>
    1. Installation<br>
    2. Ingame settings<br>
    3. Other prerequisites
  4. Supported maps<br>
  5. Recording playthroughs<br>
    1. Contributing playthroughs<br>
    2. Beast Handler<br>
  6. Additional scripts<br>
  7. Supported resolutions<br>
  8. Supporting new collection events<br>
  9. Supporting new versions of Bloons TD6<br>
    1. Adding new maps<br>
    2. Incorporating balance changes in regards to tower/upgrade cost<br>
    3. Adding new towers<br>
    4. Adding new heros<br>
    5. Major GUI changes<br>
  10. Known issues<br>

How the replay of a playthrough works

Playthroughs consist of actions like placing or upgrading a monkey, each associated with a specific cost. The replay of a playthrough works by periodically taking screenshots of BTD6 to determine what menu you are in or how much money you have available. If there is more money available than required for the next action in the playthrough it performs the corresponding action. This repeats until the game is won, lost or all actions have been performed.

Outside of a playthrough the script is able to navigate through BTD6 e. g. to select a hero or map and gamemode.

Usage / Modes of operation

The general command structure is py replay.py <mode> <mode arguments...> <flags>

file - Playing a specific playthrough

Usage: py replay.py file <filename> [gamemode] [continue <(int start|-)> [until (int end)]] <flags>

Replays the specified file. Navigates to ingame if continue is not set. <br> If filename contains / or \ filename is used as the path. otherwise the script lookes for filename in own_playthroughs, then in playthroughs <br> <br> gamemode can be specified to overwrite the gamemode in the files title. (e. g. py replay.py file dark_castle#chimps#2560x1440#noMK#noLL.btd6 medium -nomk to play dark castle on medium using the recorded playthrough for chimps) <br> if continue is set:

  • it is assumed you are already in the correct game
  • the script starts with instruction start (0 for first instruction)
  • if start = - all instructions are executed before the game is started
  • if until is specified the script ends before instruction end (e. g. start=0, end=1 -> only first instruction is executed)
  • continue is mostly useful for debugging playthroughs

flag -r only works if continue is not specified

random - Playing a random map

Usage: py replay.py random [category] [gamemode] <flags>

Plays a random game from all available playthroughs (which fullfill the category and gamemode requirement if specified) <br> Combined with the -r flag a playthrough is selected at random each iteration.

chase - Play a map with increased collection event rewards

Usage: py replay.py chase <event> [category] [gamemode] <flags>

Chases increased rewards for the specified event. Currently supported events are:

  • totem: Totem collection event
  • halloween: Halloween collection event
  • present: Christmas collection event
  • easter: Easter collection event
  • independence: Independence day collection event
  • birthday: BTD6 Birthday collection event

If category is not provided it finds the map with increased rewards in expert category and if a playthrough is available plays it. If not it searches the advanced category and so on. <br> If category is provided only said category is searched.

Category and gamemode can be specified to restrict the considered playthroughs. <br> If there are no suitable playthroughs available the script exits.

achievements - Play playthroughs that grant missing achievements

To be implemented

e. g. so spiiicey ninja kiwi - beat spice islands on alternate bloons rounds with only land towers

missing - Play playthroughs that grant missing medals

To be implemented

xp - Play the most efficient maps for player xp farming

Usage: py replay.py xp [int n=1]

Plays a random playthrough out of the n most efficient (in terms of xp/hour) playthroughs.

Efficiency is calculated using the average of win_times in playthrough_stats.json. This means new playthroughs need to be played at least once to get considered.

For some context: currently the most efficient of the included playthroughs is dark castle on chimps which will earn you about 800k XP/hour(given your game doesn't lag)

mm - Play the most efficient maps for monkey money farming

Usage: py replay.py mm [int n=1]

Plays a random playthrough out of the n most efficient (in terms of monkey money/hour) playthroughs.

Efficiency is calculated using the average of win_times in playthrough_stats.json. This means new playthroughs need to be played at least once to get considered.

For some context: currently the most efficient of the included playthroughs is bloody puddles on hard which will earn you about 760 Monkey money/hour (given your game doesn't lag) (836 Monkey Money/Hour if you have mo' monkey money unlocked).

validate - Validate playthroughs

Usage: py replay.py validate file <filename> or py replay.py validate all [category] [gamemode]

Validates a or multiple playthroughs in regards to monkey positions by setting them up in sandbox mode and checking if all actions have been performed correctly. Validation is restricted to your screens resolution, different resolutions must be validated seperately.

When run as py replay.py validate all all playthroughs will be validated. When appending the -nv flag only non validated playthroughs will be validated!

This mode requires monkey knowledge to be disabled!

If used with file parameter: Validates playthrough filename.

If used with all parameter: Validates all playthroughs which fullfill the category and gamemode requirement if specified.

-r flag has no effect for this mode.

costs - Determine cost of each monkey, upgrade and hero

Usage: py replay.py costs [+heros]

Determines the cost of each monkey and each upgrade of each monkey. Additionally determines the base cost of each hero if +hero is specified.

If +hero is set all heros will be tested.

This mode requires monkey knowledge to be disabled!<br> This mode requires all upgrades to be unlocked!

Can be used after an update to BTD6 to automatically update towers.json.

Creates a backup of the old towers.json file under towers_backup.json.

gamemode parameter

The gamemode parameter can be one of the following:

  • easy (for standard in easy difficulty)
  • primary_only
  • deflation
  • medium (for standard in medium difficulty)
  • military_only
  • reverse
  • apopalypse
  • hard (for standard in hard difficulty)
  • magic_monkeys_only
  • double_hp_moabs
  • half_cash
  • alternate_bloons_rounds
  • impoppable
  • chimps

`

View on GitHub
GitHub Stars51
CategoryDevelopment
Updated26d ago
Forks16

Languages

Python

Security Score

85/100

Audited on Mar 7, 2026

No findings