^
Login
TD Scripts

1. Requirements


For this guide, it is necessary to install the following addons: Rematch, tdBattlePetScript, tdBattlePetScript Rematch. It is assumed that installation and setup are already done, and teams are set or easy to set by you.

2. How it works


Basically the addon selects the required ability following instructions written in the script. E.g.:

use(Dodge:312)
use(Nature's Ward:574) [!self.aura(Nature's Ward:820).exists]
use(Alpha Strike:504)

This set of lines result in the following actions:
round 1: it casts Dodge
round 2: it tries to cast Dodge, but since it is on CD, it goes to the next line and casts Nature's Ward
round 3: it tries to cast Dodge, but since it is on CD, it tries the next line. Since aura Nature's Ward is active, it goes to the next line and casts Alpha Strike, and so on.

To summarize: each line is read sequentially until it finds a command that can be executed. The challenge here is writing scripts able to cast the spells according to the desired strategy.

3. Script creation


3.1 The editor



The easiest way to write a script is when you are doing a pet battle with a team previously saved on Rematch.
After starting the fight, open Rematch, right click over the corresponding team and select 'Write script'.
It will open a new window, the 'Script editor'. During the battle, and while the script editor is active it is possible to write a script using the auto-complete feature.










With the script editor opened and during a fight, start typing the desired action and it will soon show an dropdown list.







After selecting an action (type Enter or click over the action) a new list with the abilities available to the active pet will be shown.






Again, select the desired ability and if needed add the conditions when this action will be executed. Start by typing a bracket '[' followed by the first letter of the condition. Options are a target (self, enemy) or weather.





Anyway, a new list will be shown, it there is any.









In case there are additional required parameters, as with auras, a new list will be shown. As before, select the appropriate option.

Once you are familiar with the commands, you might just type the command followed by a dot to activate the dropdownlist with the available options. Remember to close the condition with a bracket: ']'.


Writing and editing a script is not difficult itself since the addon makes it very easy with the dropdown lists. Good luck!


3.2 Actions


ability/use: casts an ability
change: changes active pets
catch: catches a pet, if possible
standby: pass a round
quit: quits the fight

3.3 Conditions


Conditions are written between brackets ([condition]):
if & endif

3.4 Target


self: checks a condition on your own pets
enemy: checks for a condition on your enemy's pet

3.5 Functions


dead (boolean)
hp (compare)
hp.full (boolean)
hpp (compare)
aura.exists (boolean)
aura.duration (compare)
weather (boolean)
active (boolean)
ability.usable (boolean)
ability.duration (compare)
ability.strong (boolean)
ability.weak (boolean)
ability.type (equality)
round (boolean)
played (boolean)
speed (compare)
speed.fast (boolean)
speed.slow (boolean)
level (compare)
level.max (boolean)
power (compare)
type (equality)
quality (compare)

4. Pratical examples


Although the script helps a lot with its auto-complete feature, it won't be enough to write good scripts. It is a good idea to choose a fight and play with the script editor until you feel more confident with the commands and becomes able to write more complex scripts. Below there will be some examples taken from pet battlers using specific strategies. It is assumed that the team is loaded, the abilities are the ones mentioned on the strategy guide, and that the recommended pet is being used, not an equivalent.

4.1 Walling Critters


The Wailing Critters dungeon offers a nice opportunity to start improving your skills. Until you win the last fight the dungeon is repeatable and you might leave the dungeon, heal, and restart. There is also some random pets in the back row, but only a few families and abilities. The first 3 fights require only one pet with a fixed set of abilities, turning it into a nice place to practice your skills. The script might work for most of the fight where the same pet+abilities are being used, making it a very useful script. The link for the strategy is here.
The strategy:
Prio 1: Keep Emerald Presence active
Prio 2: Use Emerald Dream when you drop below ~1000 health
Prio 3: Emerald Bite

use(Emerald Presence:597)
use(Emerald Dream:598)
use(Emerald Bite:525)

As it is written, the script will cast Emerald Presence every time it is available. This ability does not have a CD, so we have to add a condition that prevents it from casting if the aura is already present.
The only conditions available are the 'aura(Emerald Presence).exists' or 'aura(Emerald Presence).duration'. The condition that seems to fit the strategy better is the first one.
After writing it, we would have use(Emerald Presence:597) [self(#1Emerald Proto-Whelp).aura(Emerald Presence).exists], which could be read as "cast Emerald Presence if my Emerald Proto-Whelp has Emerald Presence active".
We want the opposite of that, so deny the condition by using a '!' before the target: use(Emerald Presence:597) [!self(#1Emerald Proto-Whelp).aura(Emerald Presence).exists], translating into "cast Emerald Presence if my Emerald Proto-Whelp does NOT have Emerald Presence active". Yay!

use(Emerald Presence:597) [!self(Emerald Proto-Whelp).aura(Emerald Presence).exists]

Next step: as of now, the script will cast Emerald Dream on CD, which might not be required, specially at the beginning of the fight. Let's add the condition that will cast the ability once your whelp is low on health.

use(Emerald Dream:598) [self(Emerald Proto-Whelp).hp<1000]

You might choose to heal your whelp if it is below an amount expressed in percents, and not a fixed amount:

use(Emerald Dream:598) [self(Emerald Proto-Whelp).hpp<50]

This last condition will cast Emerald Dream if your Whelp is below 50% health.
The final script:

use(Emerald Presence:597) [!self(Emerald Proto-Whelp).aura(Emerald Presence).exists]
use(Emerald Dream:598) [self(Emerald Proto-Whelp).hp<1000]
use(Emerald Bite:525)

If your proto-whelp dies you may change it to another equivalent pet with the same abilities, and the script will keep working. To change pets add the following line: change(#2) [self(#1).dead] (change to pet number 2 if my pet number 1 is dead)

Now, some remarks about the way the script is written.
  • If your team has two Emerald Proto-Whelp, the script might not work as expected if you change pets. To avoid problems, instead of naming it, give it the team position, or just use the 'self' target. This will also allow you to use a different pet with the same skills, like the Dream Whelpling or the Emerald Whelpling
  • Do not use a slot number for abilities. It might cause problems if you use an alternative pet whose abilites are on different slot positions, like the Zandalari pets where the abilites Hunting Party and Black Claw sometimes are on a different tier.
  • Use either the ability's code number or both name and code. Some players might use a localized version of the game, and for them the script will not work if you use only the name of the abilities
  • You might leave only the abilities code number, which will result in a shorter script, but it is not necessary

A suggestion for all scripts (change to the appropriate team slot):

change(#2) [self(#1).dead]
use(Emerald Presence:597) [!self.aura(Emerald Presence:823).exists]
use(Emerald Dream:598) [self.hp<1000]
use(Emerald Bite:525)


4.2 Small fragments


Scripts are written for a specific strategy, but there are many common actions that can be use in many scripts. Adjust them to your needs, checking for the right conditions, and apply them when suitable.
  • Pass on first round:

standby [round=1]
  • Change pet to leveling and back (change slot numbers where appropriate):


change(#2) [self(#1).dead & !self(#2).played]
change(#3) [self(#2).active]
  • Use a dodge ability to block an enemy's ability (in this case, Burrow)


use(Deflection:490) [enemy.aura(Underground:340).exists]
  • Change the use of abilities depending on active enemy pet

If the enemy's pets are the first or second, you pet will cast Breath. Once the third pet enters the fight, your pet will cast Bombing Run on CD and Decoy if your enemy uses Burrow

if [enemy(#3).active]
use(Decoy) [enemy.aura(Underground:340).exists]
use(Bombing Run)
endif
use(Breath)


5. Resources










10 Comments (EN)

Show first:


You must be logged in to vote on comments

1

You must be logged in to vote on comments

HarleyDoc

wrote on 10/10/2018

I am definitely an amateur pet battler at best, but I'm slowly immersing myself in the loads of information and strategies. I have a question though. What is the real purpose behind the TD scripts? Why not just push the buttons and do the battles manually? I'm only asking because I honestly don't get it.
You must be logged in to vote on comments

0

You must be logged in to vote on comments

Killdozer wrote on 10/15/2018

Some battles are fixed. The npc will always use it's moves in a certain order each time. The scripts use the moves of a predetermined rematch team to win. You basically just press one button that selects the moves in a predetermined order that will lead to a win.
You must be logged in to vote on comments

1

You must be logged in to vote on comments

Kranthos

wrote on 11/05/2018

If you do the pet battle world quests you'll probably use the same team and strategy each time you face a particular trainer - as Killdozer says, most trainer NPCs use scripted strategies that become predictable. Using the Rematch add-in lets you store the team, and the TD script add-in lets you store and automate the associated strategy, rather than having to remember them every time. You can use Rematch's note feature to record your strategy for a particular team if you prefer not to automate it with a TD script.
You must be logged in to vote on comments

1

You must be logged in to vote on comments

BevansDesign#1728

wrote on 09/12/2018

Is it possible to do something like "use(ability#1)" without defining a specific ability? It would be nice when using a leveling pet in slot 1, where you want to just have it do ANYTHING for the first turn. Currently I use "standby" to make it wait a turn, but it'd be nice to get it to use an ability instead for a little extra damage.
You must be logged in to vote on comments

1

You must be logged in to vote on comments

Eekwibble

wrote on 09/13/2018

The vast majority of my scripts have 'ability(#1)' as the last line. Without any other conditionals above it, this will make any active pet use its first ability by default.
You must be logged in to vote on comments

1

You must be logged in to vote on comments

BevansDesign#1728

wrote on 09/28/2018

Oh, that's easy. Thanks!
You must be logged in to vote on comments

0

You must be logged in to vote on comments

gannymede wrote on 09/09/2018

Hi, When I try to import a script into TDScripts, the Save button is disabled and I can't ever write or add a script. Has anyone else seen this? Thank you!
You must be logged in to vote on comments

0

You must be logged in to vote on comments

anon wrote on 09/08/2018

does anyone have script for catching wild rare pets as in

1. start of the fight check if ENEMY team pet 1 2 3 one of them is RARE it will start fight else it will forfeit the fight
2. if the current enemy pet you're fighting is poor/common/uncommon it will kill it and when it gets to rare pet it will damage it under >35?% or whatever the catch % is and try to capture it

pets to use
any pet with superbark / weakening blow
You must be logged in to vote on comments

1

You must be logged in to vote on comments

Kranthos

wrote on 11/03/2018

You could try something like this. I can't find a way to test whether a pet has already been caged, in case there are two or more rare pets in the enemy team, but this should still work. The "weakener" should be in slot 1, and I've included two suggestions for "killers" for the other slots in your team.


quit [ enemy(#1).quality!~Rare,4 & enemy(#2).quality!~Rare,4 & enemy(#3).quality!~Rare,4 ]

if [ enemy.quality~Rare,4 ]
catch
change(#1)
use(Superbark:1357)
use(Weakening Blow:826)
endif

test(This section is for, e.g., an Emerald Protowhelp#2,2,2) [ round<1 ]
use(Emerald Presence:597) [ !self.aura(Emerald Presence:823).exists ]
use(Emerald Dream:598) [ self.hpp<50 ]
use(Emerald Bite:525)

test(This section is for, e.g., a Darkmoon Tonk#1,1,2) [ round<1 ]
use(Ion Cannon:209) [ enemy.hp<=488 & enemy.type~Elemental,7 ]
use(Ion Cannon:209) [ enemy.hp<=732 & enemy.type!~Beast,8 ]
use(Ion Cannon:209) [ enemy.hp<=1098 ]
use(Shock and Awe:646)
use(Missile:777)

change(next)
standby
You must be logged in to vote on comments

1

You must be logged in to vote on comments

Kranthos

wrote on 11/03/2018

Oops, the Ion Cannon lines should have read:


use(Ion Cannon:209) [ enemy.hp<=1098 & enemy.type~Beast,8 ]
use(Ion Cannon:209) [ enemy.hp<=732 & enemy.type!~Elemental,7 ]
use(Ion Cannon:209) [ enemy.hp<=488 ]
You must be logged in to vote on comments

3

You must be logged in to vote on comments

Prudentius

wrote on 08/30/2018

Please, please, PLEASE! Do not use the full pet name in your TD Script! This makes it incompatible when using substitution pets even if they are a carbon copy for the moveset!
You must be logged in to vote on comments

1

You must be logged in to vote on comments

Sloober

wrote on 08/04/2018

How do i add a TD script to a pet strategy?
You must be logged in to vote on comments

1

You must be logged in to vote on comments

Aranesh

wrote on 08/05/2018

You can only add one "officially" if you are the creator of a strategy. But you are always very welcome to post one into the comments :-)
You must be logged in to vote on comments

1

You must be logged in to vote on comments

gsanta

wrote on 08/03/2018

I saw this page today for the first time only due to the recent comment. Is it linked somewhere on the main that I'm not seeing?
You must be logged in to vote on comments

1

You must be logged in to vote on comments

Aranesh

wrote on 08/03/2018

"Technically" it should still be hidden because it's still being reviewed. But at this point I guess I can just as well put it online ^^
You must be logged in to vote on comments

1

You must be logged in to vote on comments

Ivanella#1279

wrote on 08/03/2018

Wish this was higher in the Google search results. Only found it when I was trying to write a new strategy.
You must be logged in to vote on comments

1

You must be logged in to vote on comments

Wazzak

wrote on 05/11/2018

While botting is difficult to describe, I think I know a simple way to describe a bot: once running, no other action from you is required. It runs attended and executes a lot of actions for you. The scripting requires you to type a key (a single key, in most cases) for every single action you do. If you type the standard shortcut 'A' the script won't start the fight, battle against all enemies, changes pets, heals after leaving or anything similar. What it does is select a single action from a list that fits the required conditions and does a single action, like casting a standard ability. Next action requires another action from you, and so on. Macros are very similar to scripts, since you click on a single button but it might cast abilities according to a sequence, or change abilities according to certain conditions. Blizzard has not yet removed the ability to write a macro. ;)
You must be logged in to vote on comments

1

You must be logged in to vote on comments

Wazzak

wrote on 05/11/2018

Just a mistake: 'It runs unattended'. Sorry for the mistake.
You must be logged in to vote on comments

0

You must be logged in to vote on comments

nataliem#2255

wrote on 04/28/2018

Will using a TD Script put your account at risk of being banned for botting?
You must be logged in to vote on comments

1

You must be logged in to vote on comments

Prudentius

wrote on 08/02/2018

No, all actions are being performed by an ingame addon using the available API. If Blizzard does not desire this behavior they will take steps (as they have proven many times during Legion to break this functionality.