SyfSchydea / pokeclicker-automation

Automates various aspects of the game Pokéclicker
1 stars 0 forks source link

Add script/command to grind for shinies in temporary battles #7

Closed SyfSchydea closed 1 year ago

SyfSchydea commented 1 year ago

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:

let suiInterval;
function suiTick() {
  if(Battle.enemyPokemon()?.shiny) {
    clearInterval(suiInterval);
    return;
  }
  TemporaryBattleList["Suicune 6"].protectedOnclick();
}
suiInterval = setInterval(suiTick, 500);

But it would be good to tidy this up into something a smidge more user friendly for ACSRQ and the like.

SyfSchydea commented 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:

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.

SyfSchydea commented 1 year ago

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.

SyfSchydea commented 1 year ago

Tested properly now