Skip to content

Instantly share code, notes, and snippets.

@Lusamine
Last active January 16, 2022 10:12
Show Gist options
  • Save Lusamine/9d0c64c3fa3aee1cd2d1bf53e9a42bb6 to your computer and use it in GitHub Desktop.
Save Lusamine/9d0c64c3fa3aee1cd2d1bf53e9a42bb6 to your computer and use it in GitHub Desktop.
// 93 is the chance of continuation for capture at 4 steps away.
private static int threshold = 93;
void Main()
{
// Initial state
// s0 should be s1, s0 from CS
// s1 should be s3, s2 from CS
ulong s0 = 0x0123456789ABCDEF;
ulong s1 = 0x0123456789ABCDEF;
// Set this for how far you want to search.
int maxAdvance = 200;
var rng = new XorShift128(s0, s1);
for (int advances = 0; advances < maxAdvance; advances++)
{
GetRadarContinue(advances, rng);
rng.Next();
}
}
// You can define other methods, fields, classes and namespaces here
private void GetRadarContinue(int advance, XorShift128 rng)
{
var (s0, s1) = rng.GetState64();
var output = $"{advance:000} | {s0:x16} | {s1:x16} |";
var next = rng.NextInt(0, 100);
output = output + $" {next:00} |";
if (next >= threshold)
output = output + " *";
if (advance < 22)
return;
Console.WriteLine(output);
}
@Lusamine
Copy link
Author

Lusamine commented Jan 14, 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 (thresholds, advances).
  6. Click run. Unsafe frames will have a * by them.

Chain continuation is calculated at the end of a battle when pressing A to close the exp gain screen.
You'll generally have a delay between 20-100 with menu mashing.
IVs are generated by walking into the grass patch aka Wild RNG.

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