Skip to content

Instantly share code, notes, and snippets.

@Lusamine
Created August 4, 2024 16:08
Show Gist options
  • Save Lusamine/90f7ab3cbdf6733002f7c7c13cba4034 to your computer and use it in GitHub Desktop.
Save Lusamine/90f7ab3cbdf6733002f7c7c13cba4034 to your computer and use it in GitHub Desktop.
void Main()
{
// Initial state
ulong s0 = 0x0123456789ABCDEF;
ulong s1 = 0x0123456789ABCDEF;
// Set this for how far you want to search.
int maxAdvance = 200;
Console.WriteLine("Adv | s0 | s1 | HL | Reg");
Console.WriteLine("----+------------------+------------------+-----+----");
var rng = new Xoroshiro128Plus(s0, s1);
for (int advances = 0; advances < maxAdvance; advances++)
{
GetStateWattTrader(advances, rng);
rng.Next();
}
}
// You can define other methods, fields, classes and namespaces here
private void GetStateWattTrader(int advance, Xoroshiro128Plus rng)
{
var (s0, s1) = rng.GetState();
var output = $"{advance:000} | {s0:x16} | {s1:x16} | ";
var highlight = rng.NextInt(1000);
var regular = rng.NextInt(9);
output += $"{highlight, 3} | {regular}";
// Add your filters here.
//if (highlight != 827)
// return;
Console.WriteLine(output);
}
@Lusamine
Copy link
Author

Lusamine commented Aug 4, 2024

Setup is:

  1. Download/install LINQPad (latest version is fine).
  2. Download dev build PKHeX from https://projectpokemon.org/home/files/file/2445-pkhex-development-build/
  3. Press F4 in LINQPad and add PKHeX.Core.dll to first tab, and PKHeX.Core to second tab,
  4. Change the language at the top to C# program, then copy/paste the script in verbatim.
  5. Edit your params (distance to search, whether you want to see all advances).
  6. Click run.

Recommended LINQPad settings so output is monospaced:

  1. Edit > Preferences > Results
  2. Click "Launch Editor" under Style Sheet for text (HTML) results.
  3. Paste this snippet and "Apply Changes".
    body
    {
    	margin: 0.3em 0.3em 0.4em 0.4em;
    	font-family: Consolas;
    }
    

Use this sheet to figure out what you need to roll under Min/Max to get your desired item:
https://docs.google.com/spreadsheets/u/0/d/1pNYtCJKRh_efX9LvzjCiA-0n2lGSFnVmSWwmPzgSOMw/htmlview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment