tdBattlePetScript

tdBattlePetScript

389k Downloads

Condition to check if the wild pet exists in my pet collection to capture it

CabPiz opened this issue · 1 comments

commented

I was trying to write a script to capture new pets that I don't have in the pet collection. I noticed that an addon (I believe it is the "pet tracker") indicates when a wild pet from the enemy team does not yet exist in my collection. The addon:

  • Displays a message saying that the pet is an improvement for me (
    • if the pet does not exist in my collection
    • if the pet in my collection is of inferior quality compared to the wild pet
    • if the wild pet is a breed that I don't have yet)
  • Marks the pet with an exclamation

It turns out that the enemy pet I want to capture can be the first, the second or the third. There is no exact order in each battle. My script works to capture, but I need to edit it at each battle saying specifically which enemy pet I want to capture (sometimes the first, sometimes the second or sometimes the third pet)
There is a possibility to add a condition or checker that would allow the script to check if the wild pet I am facing exists in my collection?
If so, the script would proceed to capture. If not, the script would continue the battle, defeating the current pet and facing the team's next enemy.
In the example sent, I thought of suggesting a new keyword, something like "enemy.is.improve" (for my pet collection)
Could you implement this enhancement? I would like to take the opportunity to thank you for the addon. It is very useful and facilitator for pet battles.

The current script, which I need to specifically indicate the pet I want to capture, and the message from the other addon indicating what wild pet from the enemy team is an improvement for my collection.
Pet_Tracker_Improve_Message

How the script would look. I would not need to edit it and I would capture the wild pet only if it is an improvement to my collection, otherwise I would defeat them.
Suggestion_TD_Script_Improve_Check

The current script:
if [ enemy.is(Gorm Ferraiz:2919) ]
change(next) [ self.dead ]
ability(#3) [ !enemy.aura(Defesas Estilhaçadas:542).exists & enemy.hp.full & self.ability(#3).weak ]
ability(#2)
change(next) [ !ability(#2).usable & enemy.hp>=400 ]
catch [ enemy.hp<=400 ]
endif
ability(#3) [ !enemy.aura(Defesas Estilhaçadas:542).exists ]
ability(#2)
ability(#1)
change(next) [ self.dead ]

My capture team:
Capturar::21151R2:21131S9:21181VQ:

commented

I would also like to have a condition like enemy.collected so I can make something like

catch [!enemy.collected]

or even enemy.is_improvement or something like that