Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Freeze the addresses F5D10 (2 bytes) and F5D54 (2 bytes) to 0x0000 to make the arms not do anything
- function cloud_is_dead()
- return memory.read_u16_le(0xF840C) == 0 or memory.read_u16_le(0xF8474) == 0 or memory.read_u16_le(0xF84DC) == 0
- end
- function carry_atb_reset()
- return memory.read_u16_le(0xF5CCC) < 0xf000
- end
- doubles = 0
- fights = 0
- r = 0
- state = "input.State"
- console.clear()
- while true do
- savestate.load(state)
- emu.frameadvance()
- --print("seed: " .. tostring(r))
- memory.write_u32_le(0x51568, r)
- fights = fights + 1
- r = math.mod(r * 214013 + 2531011, 4294967296)
- for i=1,250 do
- emu.frameadvance()
- end
- memory.write_u16_le(0xF5CCC, 0xFFFE)
- emu.frameadvance()
- emu.frameadvance()
- emu.frameadvance()
- emu.frameadvance()
- while true do
- if cloud_is_dead() then
- doubles = doubles + 1
- print("Double Lapis :(\n" .. tostring(doubles) .. "/" .. tostring(fights) .. " | " .. tostring(doubles / fights * 100) .. "%")
- break
- elseif carry_atb_reset() then
- print("No Double Lapis\n" .. tostring(doubles) .. "/" .. tostring(fights) .. " | " .. tostring(doubles / fights * 100) .. "%")
- break
- end
- emu.frameadvance()
- emu.frameadvance()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement