Displays the hp values of all active enemies on the screen
local function Enemies()
local start = 0x04449C
local oend = 89
local base
local active
local id
local hp
j = 0
for i = 0,oend,1 do
base = start + (i * 0x38)
active = memory.read_s16_le(base + 2)
hp = memory.read_s16_le(base + 6)
if active > 0 and hp > 0 then
id = memory.readbyte(base)
gui.text(0, 60 + j * 15, id .. ": " .. hp)
j = j + 1
end
end
end
while true do
memory.usememorydomain("Combined WRAM")
Enemies()
emu.frameadvance()
end