Last active
June 1, 2025 15:23
-
-
Save Lusamine/4b5bcf22acf931ffd824433ae688fa21 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Unfortunately this area is very noisy and everything is blinking while you try to pick up eggs. | |
| // You can set this to a certain value if you tend to see that many blinks from menu to egg generation... | |
| // Just adjust it up until what you hit is on Adv 0. | |
| const uint blinks = 0; | |
| // You probably have either Shiny Charm or Masuda Method, else you'd get PID rolls. | |
| bool shiny_charm_or_masuda_method = true; | |
| void Main() | |
| { | |
| // Initial state if you want to use 64-bit. | |
| // s0 should be s1, s0 from CS | |
| // s1 should be s3, s2 from CS | |
| ulong s0 = 0x0123456789ABCDEF; | |
| ulong s1 = 0x0123456789ABCDEF; | |
| // Initial state if you want to use 128-bit. | |
| /* | |
| string ram = "0123456789ABCDEF0123456789ABCDEF"; | |
| string str0 = ram.Substring(16); | |
| string str1 = ram.Substring(0, 16); | |
| ulong s0 = Convert.ToUInt64(str0, 16); | |
| ulong s1 = Convert.ToUInt64(str1, 16); | |
| */ | |
| // Set this for how far you want to search. | |
| int maxAdvance = 10000; | |
| Console.WriteLine("Adv | s0 | s1 | Height | Weight"); | |
| Console.WriteLine("-----+------------------+------------------+--------+---------"); | |
| var rng = new XorShift128(s0, s1); | |
| for (int advances = 0; advances < maxAdvance; advances++) | |
| { | |
| GetStateEggSize(advances, rng); | |
| rng.Next(); | |
| } | |
| Console.WriteLine("Search completed."); | |
| } | |
| private void GetStateEggSize(int advance, XorShift128 rng) | |
| { | |
| var (s0, s1) = rng.GetState64(); | |
| var output = $"{advance, 4} | {s0:x16} | {s1:x16} |"; | |
| // Blinks | |
| for (var i = 0; i < blinks; i++) | |
| rng.NextUInt(16); | |
| // PID roll only if you don't have either, but then why are you doing this? | |
| if (!shiny_charm_or_masuda_method) | |
| rng.NextUInt(); | |
| var height = (int)rng.NextUInt(0x81) + (int)rng.NextUInt(0x80); | |
| var weight = (int)rng.NextUInt(0x81) + (int)rng.NextUInt(0x80); | |
| output = output + $" {height, -6} | {weight, -6}"; | |
| // Add your filters here. | |
| //if (height != 255 && height != 0) | |
| // return; | |
| Console.WriteLine(output); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script is used to predict Egg sizes after picking them up in BDSP. You'll need to click "Yes" and wait on the menu for "You received the Egg from the Pokémon Nursery Man."
Setup is:
PKHeX.Coreto second tab,Recommended LINQPad settings so output is monospaced: