1
0
Fork 0
mirror of https://github.com/notwa/mm synced 2024-06-01 10:53:05 -07:00
mm/Lua/watch animations.lua

23 lines
658 B
Lua
Raw Normal View History

require "addrs.init"
require "serialize"
local anim_addr = addrs.link_actor.animation_id.addr
local fn = 'data/_anims_seen.lua'
local anims_seen = deserialize(fn) or {}
2015-05-01 11:48:49 -07:00
while mm do
local anim_id = mainmemory.read_u16_be(anim_addr)
local actor_loaded = mainmemory.read_u8(anim_addr - 2) == 4
local hexid = ('%04X'):format(anim_id)
local frame = emu.framecount()
if actor_loaded then
gui.text(2, 4, hexid, nil, 'white', "bottomleft")
if not anims_seen[anim_id] then
anims_seen[anim_id] = true
print(frame, hexid)
serialize(anims_seen, fn)
end
end
emu.frameadvance()
end