Closed SyfSchydea closed 1 year ago
I think the best way to find eligible ones is by just looking through this list of all temporary battles, and filtering for relevant ones.
We can fetch the full list with Object.values(TemporaryBattleList)
.
We would then want to filter for relevant ones which meet the following criteria:
!b.optionalArgs.isTrainerBattle
- Trainer battles don't let you catch the pokemon, so finding a shiny isn't relevantb.isVisible()
- These are the ones we can actually access legitimatelyb.pokemons.some(p => p.name == "Latias")
- Find the ones which actually contain the pokemon we want to find.parent
matches parent.town()
, or at least that its .parent.region
and .parent.subregion
match player.region
and player.subregion
respectively. It will jump you to the correct town upon starting the battle, but it doesn't seem to check that you're in the correct region before starting the fight.Thinking we put this in the auto-login.js
script. It's not strictly relevant to that script, but it already has a few misc grinding commands, so I think it kinda fits.
As a side note, I realised that the Lati@s fights aren't actually non-trainer battles, and just give a non-shiny lati@s after winning the fight.
Waiting for a better opportunity to test the above commit before I close this issue.
Tested properly now
Temporary battles are battles which appear as icons on the region map. These include the likes of rival battles, but also includes some special pokemon battles like Snorlax and Suicune. These have standard shiny odds, and can be retried pretty much instantly when you don't get a shiny. Only a little code like this is enough to grind for a shiny in one of these:
But it would be good to tidy this up into something a smidge more user friendly for ACSRQ and the like.