Jump to content

New Mystery of the Emblem RNG lua script! (beta version, please find errors)


Recommended Posts

Almost. I have the pRNG, need to get the valuations like I did with SD. It's a little bit trickier this time because the modulus appears to be a function of the framecount, but hopefully it won't be too bad.

EDIT: Also the initial seed is harder

UPDATE: Never mind, only the level up works weirdly, the valuation works nearly identically to last time. lua script should be available soon.

Edited by ruadath
Link to comment
Share on other sites

Sorry about that although it is really close. Shouldn't be more than a couple of days to finish this. The main thing is already finished, its just the auxiliary stuff that needs to be done.

Edited by ruadath
Link to comment
Share on other sites


function nextrng(r1,r4)

return AND(XOR(r4,SHIFT(r4,19),r1,SHIFT(r1,-11),SHIFT(r1,8),SHIFT(r1,-3)%16777216),0xFFFFFFFF)

end

function rngsim(n)

local rngbase=0x021BC09C

local result = { memory.readdword(rngbase), memory.readdword(rngbase+4), memory.readdword(rngbase+8), memory.readdword(rngbase+12) }

for i = 5, n do

result = nextrng(result[i-4],result[i-1])

end

return result

end

while true do

local nsim = 47

rngs = rngsim(503)

for i = 1, nsim do

gui.text(236, 8*(i-1)-190, string.format("%3d", (rngs%2147483648)%100))

end

gui.text(210,-190,"RNG1:")

gui.text(210,-182,"RNG2:")

gui.text(210,-174,"RNG3:")

gui.text(210,-166,"RNG4:")

gui.text(186,-158,"Next RNs:")

emu.frameadvance()

end

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...