Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------
- ----GLOBALS----
- ---------------
- local pbase = 0x9D8
- local px = pbase +0x5
- local py = pbase +0x8
- local cx = 0x7E1E5D
- local cy = 0x7E1E60
- ---------------
- ----TOGGLES----
- ---------------
- local draw_megaman = true
- local draw_enemies = true
- local draw_hpvalues = true
- local draw_projectiles = true
- local function megaman()
- local camx = memory.readword(cx)
- local camy = memory.readword(cy)
- local x = memory.readword(px) - camx
- local y = memory.readword(py) - camy
- local facing = memory.readbyte(pbase + 0x11)
- local boxpointer = memory.readword(pbase + 0x20) + 0x860000
- local xoff = memory.readbytesigned(boxpointer + 0)
- local yoff = memory.readbytesigned(boxpointer + 1)
- local xrad = memory.readbyte(boxpointer + 2)
- local yrad = memory.readbyte(boxpointer + 3)
- if facing > 0x45 then
- xoff = xoff * -1
- end
- gui.box(x + xoff +xrad,y + yoff + yrad, x + xoff - xrad, y + yoff - yrad,"#0000FF40","#0000FFFF")
- end
- local function enemies()
- local x
- local xoff
- local xrad
- local y
- local yoff
- local yrad
- local camx = memory.readword(cx)
- local camy = memory.readword(cy)
- local base
- local boxpointer
- local facing
- local fill
- local outl
- local start = 0xD18
- local oend = 31
- for i = 0, oend,1 do
- base = start + (i * 0x40)
- if i == 0 then
- base = start
- end
- if memory.readbyte(base) ~= 0 and memory.readbyte(base + 0x27) ~= 128 then
- if i > 14 and i < 25 then
- if draw_projectiles == true then
- fill = "#FFFFFF40"
- outl = "#FFFFFFFF"
- else
- fill = "#00000000"
- outl = "#00000000"
- end
- else
- fill = "#FF000040"
- outl = "#FF0000FF"
- end
- if i > 24 then
- fill = "#FFFF0040"
- outl = "#FFFF00FF"
- end
- facing = memory.readbyte(base + 0x11)
- x = memory.readword(base + 5) - camx
- y = memory.readword(base + 8) - camy
- boxpointer = memory.readword(base +0x20) + 0x860000
- xoff = memory.readbytesigned(boxpointer + 0)
- yoff = memory.readbytesigned(boxpointer + 1)
- xrad = memory.readbyte(boxpointer + 2)
- yrad = memory.readbyte(boxpointer + 3)
- if facing > 0x45 then
- xoff = xoff * -1
- end
- --gui.text(x,y,string.format("%X",base)) -- Debug
- gui.box(x + xoff +xrad,y + yoff + yrad, x + xoff - xrad, y + yoff - yrad,fill, outl)
- if draw_hpvalues == true and memory.readbyte(base+0x27) > 0 and memory.readbyte(base+0x27) ~= 128 then
- if i < 15 or i > 20 then
- gui.text(x-5,y-5,"HP: " .. memory.readbyte(base+0x27))
- end
- end
- end
- end
- end
- gui.register(function()
- if draw_megaman == true then
- megaman()
- end
- if draw_enemies == true then
- enemies()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment