Skip to content

Instantly share code, notes, and snippets.

@Lusamine
Last active June 9, 2022 20:43
Show Gist options
  • Save Lusamine/0a967fad366029301f19e14703ffc486 to your computer and use it in GitHub Desktop.
Save Lusamine/0a967fad366029301f19e14703ffc486 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 = 1000;
var rng = new Xoroshiro128Plus(s0, s1);
for (int advances = 0; advances < maxAdvance; advances++)
{
GetStateLotoID(advances, rng);
rng.Next();
}
}
// You can define other methods, fields, classes and namespaces here
private void GetStateLotoID(int advance, Xoroshiro128Plus rng)
{
/* Hilarious, all it does is roll your 5 digits sequentially. Match the last 5 digits of any TID to win a Master Ball. */
var (s0, s1) = rng.GetState();
var output = $"{advance:000} | {s0:x16} | {s1:x16} | ";
var digit1 = rng.NextInt(10);
var digit2 = rng.NextInt(10);
var digit3 = rng.NextInt(10);
var digit4 = rng.NextInt(10);
var digit5 = rng.NextInt(10);
var TIDoutput = $"{digit1}{digit2}{digit3}{digit4}{digit5}";
output += TIDoutput;
var result = Convert.ToDecimal(TIDoutput );
// Add your filters here.
if (result != 69958)
return;
Console.WriteLine(output);
}
@Lusamine
Copy link
Author

Lusamine commented Jun 2, 2022

Setup is:

  1. Download/install LINQPad 7.
  2. Download dev build PKHeX.
  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 (last 5 digits of TID matches).
  6. Click run.

RNG state is locked in right as you click on Rotom PC.

This is simply meant to demonstrate the logic for others to implement in their own end-user tools. You can also use this if you want to give it a try first before those tools are updated. It is not meant to be a polished or complete tool in itself.

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