while true do
Stage = {
[5] = "STAGE 5",
[6] = "STAGE 5",
[7] = " FINAL ",
[16] = "STAGE 1",
[17] = "STAGE 2",
[18] = "STAGE 3",
[19] = "STAGE 4",
[20] = "STAGE 5",
[21] = "BOSS #1",
[22] = "BOSS #2",
[23] = "BOSS #3",
[24] = "BOSS #4",
[25] = "BOSS #5"
}
-- Don't display the following
Blacklist = {
[0] = "NO",
[1] = "NO",
[2] = "NO",
[3] = "NO",
[4] = "NO",
[5] = "NO",
[6] = "NO",
[13] = "NO",
[53] = "NO",
[55] = "NO",
[57] = "NO",
[60] = "NO",
[61] = "NO",
[76] = "NO",
[77] = "NO",
[89] = "NO",
[90] = "NO"
}
-- Determine whether or not in field
if Stage[memory.readbyte(0x00F2)] ~= nil then
-- General Info
gui.text(107,8, Stage[memory.readbyte(0x00F2)])
--gui.text(0, 0, "Health:"..memory.readbyte(0x00B0))
--gui.text(0, 8, "Ammo:"..memory.readbyte(0x00B1))
gui.text(25,8, math.abs(memory.readbyteunsigned(0x0406)-memory.readbyteunsigned(0x0506)))
gui.text(25,16, math.abs(memory.readbyteunsigned(0x0400)-memory.readbyteunsigned(0x0500)))
gui.text(25,24, math.abs(memory.readbyteunsigned(0x0420)-memory.readbyteunsigned(0x0500)))
gui.text(25,32, math.abs(memory.readbyteunsigned(0x0430)-memory.readbyteunsigned(0x0500)))
-- The player
p = 0x0500
px = memory.readbyteunsigned(p+6)
py = memory.readbyteunsigned(p+7)
--gui.text(px+4, py-7, p .."("..memory.readbyte(0x030037F0)..")")
--gui.text(0, 16, "Character: "..char[p] .." (" ..p ..")")
--gui.text(0, 16, p)
gui.text(px, py, "X:"..memory.readbyteunsigned(p).."."..memory.readbyteunsigned(p+1))
gui.text(px, py+7, "Y:"..memory.readbyteunsigned(p+2).."."..memory.readbyteunsigned(p+3))
--gui.text(memory.readdwordsigned(0x03003950),memory.readdwordsigned(0x03003954),"P")
--The enemies (mostly based on MUGG's Wario land 2 script :P)
for i = 0x0400, 0x04F0, 16 do
if memory.readbytesigned(i+15) ~= -1 and Blacklist[memory.readbyte(i+8)] ~= "NO" then
local x = memory.readbyteunsigned(i+6)
local y = memory.readbyteunsigned(i+7)
if ((memory.readbyteunsigned(p) >= memory.readbyteunsigned(i) and px >= x) or (memory.readbyteunsigned(p) <= memory.readbyteunsigned(i) and px <= x)) and ((memory.readbyteunsigned(p+2) >= memory.readbyteunsigned(i+2) and py >= y) or (memory.readbyteunsigned(p+2) <= memory.readbyteunsigned(i+2) and py <= y)) then
gui.text(x, y-7,memory.readbyte(i+15)) --HP
gui.text(x, y, memory.readbytesigned(i+8).."("..memory.readbytesigned(i+9)..","..memory.readbyte(i+10)..")") --ID(Action,Timer)
gui.text(x, y+7, "X:"..memory.readbyteunsigned(i).."."..memory.readbyteunsigned(i+1))
gui.text(x, y+14, "Y:"..memory.readbyteunsigned(i+2).."."..memory.readbyteunsigned(i+3))
end
end
end
end
emu.frameadvance()
end
Very "hacky" lua script that despite all the patches, still has some bugs regarding off screen enemies.
Also, 2 bugs: Pausing and dying after getting an item
http://www.youtube.com/watch?v=eLBax15zgQg