Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/local/bin/python2.7
- #Xd seed checker for specified Gender and nature locks. Supports 1, 2 and 2 with 1 set cases of shadowmons
- import math #import math library
- import operator #import operators
- doagain = 1
- if doagain == "y":
- seed = int(raw_input('newseed: ', 16))
- else:
- nsmons = int(raw_input('number of nonshadows: '), 10) #number of non shadow mons
- naturelocks = []
- for p in range (0,nsmons):
- n = int(raw_input('naturelock' + ' ' + str(p+1) + ' '), 10)
- naturelocks.append(n)
- genderlocks = []
- for z in range (0, nsmons):
- g = int(raw_input('genderlock array: ' + ' ' + str(z+1) + ' '), 10) #user inputted array of genderlocks. 0 for female, 1 for male
- genderlocks.append(g)
- gthresh = []
- for y in range (0, nsmons):
- gt = int(raw_input('genderthresholds: ' + ' ' + str(y+1) + ' '), 10) #gender thresholds
- gthresh.append(gt)
- #128 for 50:50 etc, 256 + 0 for genderless,
- case = int(raw_input('case: '), 10) #which case? 1: 1 shadowmon, 2: 2 shadowmons, one set 3: 2 shadowmons, first one not set 4: check both 12 and 14 (set nonset)
- #rngr
- #reverse rng, runs the PRNG state backwards for j iterations
- def rngr(seed,j):
- k = 0
- while (k < j):
- seedr = (0x00003155*(seed%65536)+((0x0000B9B3*(seed%65536)+0x00003155*math.floor(seed/65536))%65536)*65536+0xA170F641)%(4294967296) #formula
- seed = seedr
- k += 1
- return seedr
- #rng
- #forward rng, runs PRNG state forwards for j iterations
- def rng(seed,j):
- k = 0
- while (k <= j):
- newseed = seed
- seed = (0x000043FD*(seed%65536)+((0x00000003*(seed%65536)+0x000043FD*math.floor(seed/65536))%65536)*65536+0x00269EC3)%(4294967296) #formula
- k += 1
- return seed
- #Nature lock PID
- #Finds the nature lock based on user inputted case (1 shadow mon, 2 shadowmons,
- # 2 shadowmons, 1 set, check both)
- def findpid(seed,case):
- seedint = seed
- if case == 1:
- casen = 3
- if case == 2:
- casen = 8
- if case == 3:
- casen = 10
- if case == 4:
- casen = 8
- if case == 5:
- casen = 10
- pseed = int(rngr(seed,casen)) #run backwards appropriate amount per case
- seedint = int(rng(pseed,0)) #get the prng state one infront of pseed
- print "pseed: " + str(hex(pseed))
- lockpid = int(((pseed >> 16)*0x10000 + (seedint>>16))) #calc PID formula
- naturelock = int(lockpid%25) #get pid nature
- return lockpid
- #nature array 0 - 24
- def nature(naturelock):
- 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']
- return natures[naturelock]
- def main():
- for i in range(0,1):
- seed = int(raw_input('newseed: '), 16)
- inputseed = seed
- #main loop, finds the nature lock based on case and then does a logic loop to decide whether that matches what you want, if not it will output what is wrong.
- seedr = seed
- lockpid = int(findpid(seed, case))
- naturelock = int(lockpid%25)
- #obtain nature, genderval, ability of PIDlock
- print "PID and nature lock: " + str(hex(lockpid)) + " " + nature(int(lockpid%25)) + " " + str(int(lockpid%2)) + " " + str(int(lockpid%256))
- print "hex seed: " + str(hex(seedr))
- print " "
- check(naturelock, lockpid, seed, case, inputseed)
- #check all of the conditions for a match, gender/nature
- def check(naturelock, lockpid, seed, case, inputseed):
- if naturelock == naturelocks[0]:
- if genderlocks[0] == 1:
- if int(lockpid%256) >= gthresh[0]:
- listgen(naturelocks, genderlocks, gthresh, nsmons, inputseed, case)
- else:
- print "gender does not match"
- else:
- if int(lockpid%256) < gthresh[0]:
- listgen(naturelocks, genderlocks, gthresh, nsmons, inputseed, case)
- else:
- print "gender does not match"
- if case ==4:
- case = 5
- lockpid = int(findpid(seed,case))
- naturelock = int(lockpid%25)
- seed = seed
- check(naturelock, lockpid, seed, case, inputseed)
- doagain = raw_input("input another base seed? y/n ")
- print doagain
- if doagain == "y":
- main()
- if doagain == "n":
- quit()
- else:
- print "naturelock doesnt match"
- if case == 4:
- case = 5
- lockpid = int(findpid(seed,case))
- naturelock = int(lockpid%25)
- seed = seed
- check(naturelock, lockpid, seed, case, inputseed)
- doagain = raw_input("input another base seed? y/n ")
- print doagain
- if doagain == "y":
- main()
- if doagain == "n":
- quit()
- #main list maker, will output a list of all frame matches based on your target (base seed) on frame 401, it will out put as many lists as non shadow mons + the corresponding nature/gender
- def listgen(naturelocks, genderlocks, gthresh, nsmons, inputseed, case):
- print "-----------------"
- print " "
- seed = inputseed
- d = 0
- matchlist = []
- currentpid = 0
- currentnature = 0
- pseed = int(rngr(seed,400))
- pseed0 = pseed
- for s in range(0,nsmons):
- pseed = pseed0
- matchlist = []
- pidlist = []
- for r in range(1,600):
- seedint = int(rng(pseed,0))
- currentpid = int((int((pseed >> 16)*0x10000) + int((seedint>>16))))
- currentnature = int(currentpid%25)
- pseed = seedint
- if currentnature == naturelocks[s]:
- if genderlocks[s] == 1:
- if int(currentpid%256) >= gthresh[s]:
- matchlist.append(r-4)
- a = int(currentpid)
- b = '%x' % a
- pidlist.append(b)
- else:
- if int(currentpid%256) < gthresh[s]:
- matchlist.append(r-4)
- a = int(currentpid)
- b = '%x' % a
- pidlist.append(b)
- if genderlocks[s] == 0:
- gender = "female"
- if genderlocks[s] == 1:
- gender = "male"
- if gthresh[s] == 256:
- gender = "genderless"
- print str(nature(naturelocks[s])) + " " + gender
- for y in range (1,len(matchlist)):
- print str(matchlist[y]) + " " + str(pidlist[y])
- print " "
- if case == 1:
- print "target on frame 401, primary nature lock on 394"
- if case == 2:
- print "target on frame 401, primary nature lock on 389"
- if case == 3:
- print "target on frame 401, primary nature lock on 387"
- if case == 4:
- print "target on frame 401, primary naturelock 387, (14)"
- if case == 5:
- print "target on frame 401, primary naturelock on 389, (12)"
- print " "
- print "-------------------"
- print " "
- doagain = raw_input("input another base seed? y/n ")
- print doagain
- if doagain == "y":
- main()
- if doagain == "n":
- quit()
- return doagain
- # Execute Script:
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment