Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Note: You need MemDumpRNGsFULL.txt
- local posy=7
- local Array ={}
- local Array2 = {}
- local thing
- local tempthing
- local i
- globalRNGtoset = 0
- globalLockRNG = false
- function smvinfo()
- local hours = math.floor(movie.framecount()/216000)
- local minutes = math.floor((movie.framecount() - hours*216000)/3600)
- local seconds = math.floor((movie.framecount() - hours*216000 - minutes*3600)/60)
- local frames = movie.framecount() - hours*216000 - minutes*3600 - seconds*60
- if movie.playing () == true then
- gui.text(1,1,string.format("frames:%d/%d (%d:%d:%d.%d)\nlags:%d\nrerecords:%d",movie.framecount(), movie.length(),hours,minutes,seconds,frames,emu.lagcount(), movie.rerecordcount ()))
- elseif movie.recording() == true then
- gui.text(1,1,string.format("frames:%d (%d:%d:%d.%d)\nlags:%d\nrerecords:%d",movie.framecount(),hours,minutes,seconds,frames,emu.lagcount(), movie.rerecordcount ()))
- else
- gui.text(1,1,string.format("frames:%d (%d:%d:%d.%d,no movie)\nlags:%d",emu.framecount(),hours,minutes,seconds,frames,emu.lagcount()))
- end
- end
- function draw()
- -- enemy HPs
- local e1=memory.readword(0x7EFC11)
- local e2=memory.readword(0x7EFC91)
- local e3=memory.readword(0x7EFD11)
- local e4=memory.readword(0x7EFD91)
- local e5=memory.readword(0x7EFE11)
- local e6=memory.readword(0x7EFE91)
- --party HPs
- local p1=memory.readword(0x7EFA91)
- local p2=memory.readword(0x7EFB11)
- local p3=memory.readword(0x7EFB91)
- --position in field
- local x=memory.readword(0x702002)
- local y=memory.readword(0x702000)
- local z=memory.readword(0x702004)
- --other infomation
- local coin=memory.readword(0x7FF8AF)
- local fcoin=memory.readbyte(0x7FF8B3)
- local fp=memory.readbyte(0x7EFA0C)
- local mfp=memory.readbyte(0x7EFA0D)
- local ffp=memory.readbyte(0x7FF8B1) -- Field FP
- local fmfp=memory.readbyte(0x7FF8B2) --Fielf maxFP
- local jump=memory.readbyte(0x7EE010) -- Jump power
- local firec=memory.readbyte(0x702D6C) -- number of fbs you did
- local firet=memory.readbyte(0x702D6D)
- local damage=memory.readword(0x7E00C2)
- local field=memory.readbyte(0x7E000A)
- local field2=memory.readbyte(0x7E01D8)
- --charactar exps
- local mexp=memory.readword(0x7FF80A)
- local mexp2=memory.readword(0x7FF85A)
- local gexp=memory.readword(0x7FF846)
- local bexp=memory.readword(0x7FF832)
- local pexp=memory.readword(0x7FF81E)
- --charactar LVs and future exp in battle
- local mlv=memory.readbyte(0x7FF800)
- local mlv2=memory.readbyte(0x7FF850)
- local glv=memory.readbyte(0x7FF83C)
- local blv=memory.readbyte(0x7FF828)
- local plv=memory.readbyte(0x7FF814)
- local gaexp=memory.readword(0x7EFA02)
- --charactar accessory
- local mac=memory.readbyte(0x7FF80E)
- local mac2=memory.readbyte(0x7FF85E)
- local gac=memory.readbyte(0x7FF84A)
- local bac=memory.readbyte(0x7FF836)
- local pac=memory.readbyte(0x7FF822)
- if e2 == 21845 then
- e2 = 0
- end
- if e3 == 21845 then
- e3 = 0
- end
- if e4 == 21845 then
- e4 = 0
- end
- if e5 == 21845 then
- e5 = 0
- end
- if e6 == 21845 then
- e6 = 0
- end
- if p2 == 21845 then
- p2 = 0
- end
- if p3 == 21845 then
- p3 = 0
- end
- if firec > 100 or firet > 100 then
- firec,firet = 0,0
- end
- if damage > 9000 then
- damage=0
- end
- --who equips Exp. Booster
- if mac==80 and field == 6 or mac==80 and field ==2 and field2 == 2 then
- gui.text(172,9,"*")
- elseif pac==80 and field == 6 or pac==80 and field ==2 and field2 == 2 then
- gui.text(172,41,"*")
- elseif mac2==80 and field == 6 or mac2==80 and field ==2 and field2 == 2 then
- gui.text(172,17,"*")
- elseif gac==80 and field == 6 or gac==80 and field ==2 and field2 == 2 then
- gui.text(172,25,"*")
- elseif bac==80 and field == 6 or bac==80 and field ==2 and field2 == 2 then
- gui.text(172,33,"*")
- end
- if field == 2 then
- gui.text(1,1*posy*4,string.format("x:%d\ny:%d\nz:%d",x,y,z))
- gui.text(1,1*posy*8,string.format("coin:%d\nfrog:%d\nfp:%d/%d",coin,fcoin,ffp,fmfp))
- if field2 == 2 then
- gui.text(180,1,"---exp(lv)---")
- gui.text(180,9,string.format("Mario : %d(%d) \nMallow : %d(%d)\n Geno : %d(%d)\nBowser : %d(%d)\nPeach : %d(%d)",mexp,mlv,mexp2,mlv2,gexp,glv,bexp,blv,pexp,plv))
- end
- elseif field == 6 then
- gui.text(1,posy*4,"-enemy")
- gui.text(1,1+posy*5,string.format("e1:%d\ne2:%d\ne3:%d\ne4:%d\ne5:%d\ne6:%d",e1,e2,e3,e4,e5,e6))
- gui.text(1,posy*13,"-party")
- gui.text(1,1+posy*14,string.format("p1:%d\np2:%d\np3:%d",p1,p2,p3))
- gui.text(1,posy*18,"-misc")
- gui.text(1,1+posy*19,string.format("FP:%d/%d\njump:%d",fp,mfp,jump))
- gui.text(1,1+posy*22,string.format("FBcount:%d\nFBtimer:%d\ndmg:%d",firec,firet,damage))
- gui.text(180,1,"---exp(lv)---")
- gui.text(180,9,string.format("Mario : %d(%d) \nMallow : %d(%d)\n Geno : %d(%d)\nBowser : %d(%d)\nPeach : %d(%d)\nexpgain: %d",mexp,mlv,mexp2,mlv2,gexp,glv,bexp,blv,pexp,plv,gaexp))
- end
- end
- function initRNGs()
- i=0
- for line in io.lines("MemDumpRNGsFULL.txt") do
- Array[i]=line
- i=i+1
- end
- i=0
- while i < 65536 do
- temp = Array[i]
- Array2[temp + 0] = i
- i = i+1
- end
- end
- function RNGHook()
- if globalLockRNG == true then
- if memory.readword(0x00302E)~=globalRNGtoset then
- memory.writeword(0x00302E,globalRNGtoset)
- end
- end
- end
- function TestFreebies()
- local tempstate = {}
- local dumpfile = "FreebieDump.txt"
- io.output(dumpfile)
- value = 0
- tempstate[value] = savestate.create()
- savestate.save(tempstate[value])
- iterations = 0
- emu.speedmode("maximum")
- while iterations < 65536 do -----------------------------------------
- globalRNGtoset = iterations
- savestate.load(tempstate[value])
- --joypad.set(1,{["X"]=true})
- joypad.set(1,{["B"]=true})
- emu.frameadvance()
- for j = 1,32 do --was 680 for rock candy, 400 for punch originally
- emu.frameadvance()
- end --for
- --temp = memory.readbyte(0x7E0B7A) -- or possibly 7E0700
- --temp = memory.readbyte(0x704070) -- or possibly 7E0700
- temp = memory.readbyte(0x702586) -- or possibly 7E0700
- io.write(globalRNGtoset .. " " .. temp, "\n")
- iterations = iterations + 1
- end -- while
- io.output():close()
- emu.speedmode("normal")
- emu.pause()
- end --function
- initRNGs()
- memory.registerwrite(0x00302E, RNGHook) --Register function to occur on game's write to address
- ----------------------------
- --MODIFY THIS PART--
- ----------------------------
- --globalLockRNG = true
- --globalRNGtoset = 12
- --TestFreebies()
- --
- ---------------------------
- ---------------------------
- while true do
- smvinfo()
- draw()
- tempthing = memory.readword(0x00302E)
- gui.text(100,80, "RNG Increment Number: " .. Array2[tempthing])
- gui.text(100,90, "Actual RNG: " .. tempthing)
- tempthing = memory.readbyte(0x704070)
- tempthing = memory.readbyte(0x702586)
- gui.text(100,100, "Test: " .. tempthing)
- emu.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement