Advertisement
AceZephyr

FF7 Carry Armor testing script

Jun 5th, 2021
768
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.20 KB | None | 0 0
  1. -- Freeze the addresses F5D10 (2 bytes) and F5D54 (2 bytes) to 0x0000 to make the arms not do anything
  2.  
  3. function cloud_is_dead()
  4.     return memory.read_u16_le(0xF840C) == 0 or memory.read_u16_le(0xF8474) == 0 or memory.read_u16_le(0xF84DC) == 0
  5. end
  6.  
  7. function carry_atb_reset()
  8.     return memory.read_u16_le(0xF5CCC) < 0xf000
  9. end
  10.  
  11. doubles = 0
  12. fights = 0
  13.  
  14. r = 0
  15.  
  16. state = "input.State"
  17.  
  18. console.clear()
  19.  
  20. while true do
  21.     savestate.load(state)
  22.     emu.frameadvance()
  23.     --print("seed: " .. tostring(r))
  24.     memory.write_u32_le(0x51568, r)
  25.     fights = fights + 1
  26.     r = math.mod(r * 214013 + 2531011, 4294967296)
  27.     for i=1,250 do
  28.         emu.frameadvance()
  29.     end
  30.     memory.write_u16_le(0xF5CCC, 0xFFFE)
  31.     emu.frameadvance()
  32.     emu.frameadvance()
  33.     emu.frameadvance()
  34.     emu.frameadvance()
  35.    
  36.     while true do
  37.         if cloud_is_dead() then
  38.             doubles = doubles + 1
  39.             print("Double Lapis :(\n" .. tostring(doubles) .. "/" .. tostring(fights) .. " | " .. tostring(doubles / fights * 100) .. "%")
  40.             break
  41.         elseif carry_atb_reset() then
  42.             print("No Double Lapis\n" .. tostring(doubles) .. "/" .. tostring(fights) .. " | " .. tostring(doubles / fights * 100) .. "%")
  43.             break
  44.         end
  45.         emu.frameadvance()
  46.         emu.frameadvance()
  47.     end
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement