Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2015
717
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.83 KB | None | 0 0
  1. import math
  2. import operator
  3. print ' _________________________________________'
  4. print '| FR/LG unown RNG tool |'
  5. print '| |'
  6. print '|inputs: Seed in hex, starting frame, |'
  7. print '| ending frame, y/n if you want |'
  8. print '|made by shiny only, and the letter of |'
  9. print '| Amab the unown you want |'
  10. print '|_________________________________________|'
  11.  
  12.  
  13. seed = raw_input('Seed = 0x')
  14. minframe = raw_input('Starting: ')
  15. maxframe = raw_input('Calc to: ')
  16. shinyonly = raw_input('Shiny only y/n? ')
  17. if shinyonly == 'y':
  18. TID = raw_input('TID: ')
  19. SID = raw_input('SID: ')
  20. letter = raw_input('Letter? ')
  21. seed = int(seed,16)
  22.  
  23. if letter == 'A':
  24. lesv = [0,1,2,3,4,5,6,7,8,9,10]
  25. room = 1
  26. if letter == 'B':
  27. lesv = [10,11]
  28. room = 6
  29. if letter == 'C':
  30. lesv = [0,1,2]
  31. room = 2
  32. if letter == 'D':
  33. lesv = [3,4,5]
  34. room = 2
  35. if letter == 'E':
  36. lesv = [10,11]
  37. room = 3
  38. if letter == 'F':
  39. lesv = [7,8,9]
  40. room = 5
  41. if letter == 'G':
  42. lesv = [4,5,6]
  43. room = 5
  44. if letter == 'H':
  45. lesv = [6,7,8]
  46. room = 2
  47. if letter == 'I':
  48. lesv = [8,9]
  49. room = 3
  50. if letter == 'J':
  51. lesv = [4,5]
  52. room = 4
  53. if letter == 'K':
  54. lesv = [10,11]
  55. room = 5
  56. if letter == 'L':
  57. lesv = [2,3]
  58. room = 4
  59. if letter == 'M':
  60. lesv = [8,9]
  61. room = 6
  62. if letter == 'N':
  63. lesv = [0,1,2,3]
  64. room = 3
  65. if letter == 'O':
  66. lesv = [11]
  67. room = 2
  68. if letter == 'P':
  69. lesv = [0,1]
  70. room = 4
  71. if letter == 'Q':
  72. lesv = [9,10,11]
  73. room = 4
  74. if letter == 'R':
  75. lesv = [6,7,8]
  76. room = 4
  77. if letter == 'S':
  78. lesv = [4,5,6,7]
  79. room = 3
  80. if letter == 'T':
  81. lesv = [2,3]
  82. room = 5
  83. if letter == 'U':
  84. lesv = [9,10]
  85. room = 2
  86. if letter == 'V':
  87. lesv = [0,1,2]
  88. room = 6
  89. if letter == 'W':
  90. lesv = [3,4,5]
  91. room = 6
  92. if letter == 'X':
  93. lesv = [6,7]
  94. room = 6
  95. if letter == 'Y':
  96. lesv = [0,1]
  97. room = 5
  98. if letter == 'Z':
  99. lesv = [0,1,2,3,4,5,6,7,8,9,10]
  100. room = 7
  101. if letter == '!':
  102. lesv = [11]
  103. room = 7
  104. if letter == '?':
  105. lesv = [11]
  106. room = 1
  107.  
  108. print 'Frame ESV Occ. PID Letter Spread'
  109.  
  110.  
  111. def rng(seed,j):
  112. k = 0
  113. while (k <= j):
  114. newseed = seed
  115. seed = (0x00004E6D*(seed%65536)+((0x000041C6*(seed%65536)+0x00004E6D*math.floor(seed/65536))%65536)*65536+0x00006073)%(4294967296) #formula
  116. k += 1
  117.  
  118. return seed
  119.  
  120.  
  121.  
  122. def Unowntest(PID):
  123.  
  124. PIDb = str(bin(PID))
  125. PIDb = PIDb[2:]
  126. while len(PIDb) < 32:
  127. PIDb = '0' + PIDb
  128. byt = str(PIDb[6:8]) + str(PIDb[14:16]) + str(PIDb[22:24]) + str(PIDb[30:32])
  129. bytint = int(byt,2)%28
  130.  
  131. charlist = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','!','?']
  132. lt = charlist[bytint]
  133.  
  134.  
  135. return lt
  136.  
  137. def roomtest(room):
  138. room = int(room)
  139. if room == 1:
  140. Ulist = ['A', '?']
  141. if room == 2:
  142. Ulist = ['C', 'D','H','U','O']
  143. if room == 3:
  144. Ulist = ['E', 'I','N','S']
  145. if room == 4:
  146. Ulist = ['J', 'L','P','Q','R']
  147. if room == 5:
  148. Ulist = ['F', 'G', 'K','T','Y']
  149. if room == 6:
  150. Ulist = ['B', 'M', 'V','W','X']
  151. if room == 7:
  152. Ulist = ['Z', '!']
  153. return Ulist
  154.  
  155.  
  156. def methodH1(seed,frame):
  157. eo = frame % 2
  158.  
  159. h = frame
  160. seed1 = int(rng(seed,0))
  161. snature = hex(int(rng(seed1,0)))[2:6]
  162. ESV = hex(int(seed))[2:6]
  163. ESV = int(ESV,16)%100
  164.  
  165. if ESV in range(0,20):
  166. ESV = 0
  167. if ESV in range(20,40):
  168. ESV = 1
  169. if ESV in range(40,50):
  170. ESV = 2
  171. if ESV in range(50,60):
  172. ESV = 3
  173. if ESV in range(60,70):
  174. ESV = 4
  175. if ESV in range(70,80):
  176. ESV = 5
  177. if ESV in range(80,85):
  178. ESV = 6
  179. if ESV in range(85,90):
  180. ESV = 7
  181. if ESV in range(90,94):
  182. ESV = 8
  183. if ESV in range(94,98):
  184. ESV = 9
  185. if ESV == 98:
  186. ESV = 10
  187. if ESV == 99:
  188. ESV = 11
  189. return ESV
  190.  
  191. #snature = int(snature,16)%25
  192. #seedint = int(rng(seed1,0))
  193. #PID = int(((seed1 >> 16)*0x10000 + (seedint>>16)))
  194. #PID = str(PID)
  195. #PID = PID[6:10] + PID[2:6]
  196.  
  197.  
  198. # while int(PID,16)%25 != snature:
  199. #h = h+1
  200. #seed1 = seedint
  201. #seedint = int(rng(seed1,0))
  202. #if h%2 == eo:
  203.  
  204. #PID = int(((seed1 >> 16)*0x10000 + (seedint>>16)))
  205. #PID = hex(PID)
  206. #PID = str(PID)
  207. #PID = PID[6:10] + PID[2:6]
  208.  
  209.  
  210. #if int(PID,16)%25 == snature:
  211. #return ESV
  212.  
  213.  
  214.  
  215.  
  216.  
  217. def shinytest(PIDs,TIDb,SIDb):
  218. PIDup = str(bin(int(PIDs[0:4],16)))
  219. PIDup = PIDup[2:]
  220. while len(PIDup) < 16:
  221. PIDup = '0' + PIDup
  222. PIDlow = str(bin(int(PIDs[4:8],16)))
  223. PIDlow = PIDlow[2:]
  224. while len(PIDlow) < 16:
  225. PIDlow = '0' + PIDlow
  226.  
  227. shin = "!!!"
  228. for k in range(0,12):
  229. sum = int(PIDup[k],2) + int(PIDlow[k],2) + int(TIDb[k],2) + int(SIDb[k],2)
  230. #print sum
  231. if shin != " ":
  232. if sum == 1 or sum == 3:
  233. shin = " "
  234.  
  235.  
  236. return shin
  237.  
  238.  
  239.  
  240. def checkfornextunown(seed,frame):
  241. eo = frame % 2
  242. h = frame
  243. seedint = int(rng(seed,0))
  244. PID = int(((seed >> 16)*0x10000 + (seedint>>16)))
  245. IV1 = hex(int(rng(seedint,0)))[2:6]
  246. IV2 = hex(int(rng(seedint,1)))[2:6]
  247. IV1b = bin(int(IV1,16))[2:]
  248. IV2b = bin(int(IV2,16))[2:]
  249. while len(IV1b) < 16:
  250. IV1b = '0' + IV1b
  251. while len(IV2b) < 16:
  252. IV2b = '0' + IV2b
  253.  
  254. HPiv = str(int(IV1b[11:16],2))
  255. Atkiv = str(int(IV1b[6:11],2))
  256. Defiv = str(int(IV1b[1:6],2))
  257. Speediv = str(int(IV2b[11:16],2))
  258. Spaiv = str(int(IV2b[6:11],2))
  259. Spdiv = str(int(IV2b[1:6],2))
  260. let = Unowntest(PID)
  261. while let != letter:
  262. h = h + 1
  263. seed1 = seedint
  264. seedint = int(rng(seed1,0))
  265. if h%2 == eo:
  266.  
  267. PID = int(((seed1 >> 16)*0x10000 + (seedint>>16)))
  268. let = Unowntest(PID)
  269. IV1 = hex(int(rng(seedint,0)))[2:6]
  270. IV2 = hex(int(rng(seedint,1)))[2:6]
  271. IV1b = bin(int(IV1,16))[2:]
  272. IV2b = bin(int(IV2,16))[2:]
  273. while len(IV1b) < 16:
  274. IV1b = '0' + IV1b
  275. while len(IV2b) < 16:
  276. IV2b = '0' + IV2b
  277.  
  278. HPiv = str(int(IV1b[11:16],2))
  279. Atkiv = str(int(IV1b[6:11],2))
  280. Defiv = str(int(IV1b[1:6],2))
  281. Speediv = str(int(IV2b[11:16],2))
  282. Spaiv = str(int(IV2b[6:11],2))
  283. Spdiv = str(int(IV2b[1:6],2))
  284. result = [PID, h, HPiv, Atkiv, Defiv, Speediv, Spaiv, Spdiv]
  285. return result
  286.  
  287. def printframe(newseed):
  288. PID = newseed[0]
  289. foundframe = newseed[1]
  290. HPiv = newseed[2]
  291. Atkiv = newseed[3]
  292. Defiv = newseed[4]
  293. Speediv = newseed[5]
  294. Spaiv = newseed[6]
  295. Spdiv = newseed[7]
  296. #PID = int(((seed >> 16)*0x10000 + (seedint>>16)))
  297.  
  298.  
  299.  
  300. let = Unowntest(PID)
  301. nature = int(PID%25)
  302. nature = natures[nature]
  303. PIDs = str(hex(int(PID)))
  304. PIDs = PIDs[2:]
  305.  
  306. if PIDs[len(PIDs)-1] == 'L':
  307. PIDs = PIDs[:-1]
  308.  
  309. while len(PIDs) < 8:
  310. PIDs = '0'+PIDs
  311. shin = shinytest(PIDs,TIDb,SIDb)
  312. if shinyonly == "y":
  313. if let in ulist and shin == "!!!":
  314. print str(frame) + ' ' + str(ESV) + ' ' + str(foundframe) +' ' + PIDs + ' ' + str(let) + ' ' + nature + ' ' + shin + ' ' + HPiv + '/' + Atkiv + '/' + Defiv + '/' + Spaiv + '/' + Spdiv + '/' + Speediv
  315. if shinyonly == "n":
  316. if let in ulist:
  317.  
  318. print str(frame) + ' '+ str(ESV) + ' ' + str(foundframe) + ' ' + PIDs + ' ' + str(let) + ' ' + nature + ' ' + shin + ' ' + HPiv + '/' + Atkiv + '/' + Defiv + '/' + Spaiv + '/' + Spdiv + '/' + Speediv
  319.  
  320.  
  321.  
  322.  
  323.  
  324. ulist = roomtest(room)
  325. TID = 0
  326. SID = 0
  327. TIDb = str(bin(int(TID)))
  328. SIDb = str(bin(int(SID)))
  329. TIDb = TIDb[2:]
  330. while len(TIDb) < 16:
  331. TIDb = '0' + TIDb
  332. SIDb = SIDb[2:]
  333. while len(SIDb) < 16:
  334. SIDb = '0' + SIDb
  335. natures = ['hardy ', 'lonely ', 'brave ', 'adamant', 'naughty', 'bold ', 'docile ', 'relaxed', 'impish ', 'lax ', 'timid ', 'hasty ', 'serious', 'jolly ', 'naive ', 'modest ', 'mild ', 'quiet ', 'bashful', 'rash ', 'calm ', 'gentle ', 'sassy ', 'careful', 'quirky ']
  336.  
  337.  
  338.  
  339. for j in range(0,int(minframe)):
  340. seedint = int(rng(seed,0))
  341. seed = seedint
  342.  
  343. for i in range(int(minframe),int(maxframe)):
  344. frame = i
  345. seedint = int(rng(seed,0))
  346. ESV = methodH1(seed,frame)
  347. if ESV in lesv:
  348. newseed = checkfornextunown(seed,frame)
  349. printframe(newseed)
  350. seed = seedint
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360. #Jam some birds in your code - Darkray
  361.  
  362. #Special thanks to darkray and slashmolder
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement