Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ShinyIDGenerator.ahk - asks for a PID and generates a text file of all possible TID/SID combinations that would make that Pokémon shiny
- ; © M.andrew 1 Jan 2012
- GUI, New
- GUI, Add, Text, R1 x5 y5, PID:
- GUI, Add, Edit, R1 x30 y5 vPID Number, 2259878931
- GUI, Add, Button, x45 y30 Default, OK
- Display:
- GUI, Show
- Return
- ButtonOK:
- GUI, Submit
- Progress, M R0-65535, Go grab a drink - this will take a while., Instead of calculating to its full potential, your CPU is drawing this progress bar, Generating...
- Loop, 65536 {
- TID := A_Index - 1
- Loop, 65536 {
- SID := A_Index -1
- If (ShinyFactor(TID, SID, PID) < 8)
- FileAppend, SHINY!!! %TID%/%SID%`n, %PID%.txt
- }
- TIDLoop += 1
- Progress, %TIDLoop%
- }
- MsgBox All done! The results can be found in %PID%.txt.
- ExitApp
- ShinyFactor(TID, SID, PID) {
- ; Determining a Pokémon's shininess uses three xor operators on the TID, SID, and PID and an inequality check. This function returns the result of the last xor operation.
- Xor_Trainer := TID ^ SID ; FIRST XOR
- ; Before performing the second calculation, we must split the PID into its most and least significant halves
- PIDFirstHalf := (PID & 0x00000000FFFF0000) >> 16
- PIDSecondHalf := PID & 0x000000000000FFFF
- Xor_Pokemon := PIDFirstHalf ^ PIDSecondHalf ; SECOND XOR
- Return Xor_Trainer ^ Xor_Pokemon ; THIRD XOR
- }
Advertisement
Add Comment
Please, Sign In to add comment