Advertisement
CasualPokePlayer

catchmanip.lua

Apr 23rd, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. function get_catch_status()
  2. memory.usememorydomain("WRAM")
  3. return memory.read_u16_be(0x1969)
  4. end
  5.  
  6. function press_a()
  7. for i=1, 1 do
  8. joypad.set({A=true})
  9. emu.frameadvance()
  10. end
  11. end
  12.  
  13. local file = io.open("catches_"..emu.framecount()..".txt", "w")
  14. savestate.save("base.state")
  15. for frame=1,1000 do
  16. press_a()
  17. for i=1, 100 do
  18. emu.frameadvance()
  19. end
  20. file:write("frame="..(emu.framecount()-100).." catch="..get_catch_status().."\n")
  21. savestate.load("base.state")
  22. joypad.set({A=null})
  23. emu.frameadvance()
  24. savestate.save("base.state")
  25. end
  26. file:close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement