Battle Pet TDScript help

Discuss pet battles, strategy and theorycrafting.
Post Reply
Land33
Posts:2
Joined:October 13th, 2020
Pet Score:3979
Realm:Area 52-us
Contact:
Battle Pet TDScript help

Post by Land33 » February 25th, 2021, 1:32 pm

I am just getting started trying to learn how to write my own TDscript. I tried writing one for Chittermaw since I thought it was a fairly simple one to do but even though the script saved without issue, it did not run the way I wanted it to. It continued to use the first ability that I had listed over and over without switching to the next ability or pet.

I am using the following pets:

Mei Li Sparkler 1,2,2
Putrid Geist 1,1,1
Chrominius 2,2,2

This is what I wrote:

ability(Glowing Toxin:270)
ability(Cocoon Strike:506)
ability(Corpse Explosion:663)
change(Putrid Geist:3046)
ability(Glowing Toxin:270)
ability(Glowing Toxin:270)
ability(Cocoon Strike:506)
ability(Glowing Toxin:270)
change(Mei Li Sparkler:722)
ability(Surge of Power:593)
change(Chrominius:1152)

Can someone please help me by telling me what I did wrong? Thanks

User avatar
Gráinne
Posts:959
Joined:July 7th, 2015
Pet Score:13747
Realm:Magtheridon-eu
Contact:

Re: Battle Pet TDScript help

Post by Gráinne » February 26th, 2021, 12:21 pm

I do not use that ... addon, and I never will use it, so I can't help much directly.

I can see that you are making a basic misinterpretation of the way it works. It does not work like a programming language, do the first line, then do the next line, and so on.

EVERY ROUND, it starts at the top of the script again.
It reads the first line. If it can execute the first line, it does, and then stops.
If it can't execute the first line, vecause it is not available on the current pet, or is on cooldown, it reads the second line, and tries to execute it.
If it couldn't execute the second line, it tries the third line.
And so on till the end of the script.

Next round, it starts from the top again.

Another way of looking at it is that the script you write is a set of instructions to be applied every round.

If you start a script with
ability(Glowing Toxin:270)
as the first line, the script will ALWAYS execute Glowing Toxin:270 and stop, if Glowing Toxin:270 is available.

Because every round starts at the beginning of the script again.

DragonsAfterDark has produced a tutorial for writing scripts here:
https://www.youtube.com/watch?v=On7fbNC4WCg

Land33
Posts:2
Joined:October 13th, 2020
Pet Score:3979
Realm:Area 52-us
Contact:

Re: Battle Pet TDScript help

Post by Land33 » February 26th, 2021, 7:37 pm

Thank you for the info. I appreciate it. :)

Post Reply