Skip to content

Instantly share code, notes, and snippets.

@Lusamine
Last active December 30, 2021 15:59
Show Gist options
  • Save Lusamine/024fc864e359b15967d03e43d60ea4b3 to your computer and use it in GitHub Desktop.
Save Lusamine/024fc864e359b15967d03e43d60ea4b3 to your computer and use it in GitHub Desktop.
Quick guide to things you can do with the search filters on my search scripts

Every value that is rolled can be checked as a filter. The most important values for ec, pid, isShiny, shinyXor, ivs, ability, genderchar, and nature.

Here are some specific applications.

isShiny

Only show shiny matches.

// Skip any non-shiny match.
if (!isShiny)
    return;

shinyXor

Only show square/star shiny matches. shinyXor is 0 for square and 1-15 otherwise. Keep in mind that xor values greater than 15 exist but are not shiny.

// Skip any shiny matches that don't have xor of 0 (square)
if (isShiny && shinyXor != 0)
    return;
// Skip any that have xor of 0 (square). xor of 0 is automatically shiny.
if (shinyXor == 0)
    return;

ivs

Filters for IVs. They are in the order HP / ATK / DEF / SPA / SPD / SPE. This can look for exact values or ranges.

// Skips if the Pokémon doesn't have a spread of 31/0/31/31/31/31.
if (ivs[0] != 31 || ivs[1] != 0 || ivs[2] != 31 || ivs[3] != 31 || ivs[4] != 31 || ivs[5] != 31)
    return;
// Skips if the Pokémon doesn't have an HP IV greater than 20.
if (ivs[0] <= 20)
    return;
// Skips if the Pokémon doesn't have a spread of 31/0/31/31/31/31 or 31/31/31/0/31/31.
if (!(ivs[0] == 31 && ivs[1] == 31 && ivs[2] == 31 && ivs[3] == 0 && ivs[4] == 31 && ivs[5] == 31)
    && !(ivs[0] == 31 && ivs[1] == 0 && ivs[2] == 31 && ivs[3] == 31 && ivs[4] == 31 && ivs[5] == 31))
    return;

ability

Only in wild/stationary searcher. Searches for ability 1 or 2. Pokémon with ability H aren't rolled in this game.

// Skips if the Pokémon doesn't have ability 1.
if (ability != 1)
    return;

genderchar

Only in wild/stationary searcher. Searches for gender as -, F, or M.

// Skips if the Pokémon isn't male.
if (genderchar != "M")
    return;

nature

Filters a specific nature.

// Skips if the Pokémon isn't Adamant or Jolly.
if (nature != (int)Nature.Adamant && nature != (int)Nature.Jolly)
    return;

advance

Filters any advances that fall within range.

// Shows any advance less than 100.
if (advance < 100)
{
    Console.WriteLine(output);
    return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment