Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------
- ----GLOBALS----
- ---------------
- local pbase = 0xBA8
- local px = 0xBAD
- local py = 0xBB0
- local cx = 0x7E00B4
- local cy = 0x7E00B6
- ---------------
- ----TOGGLES----
- ---------------
- local cheats = false
- local draw_megaman = true
- local draw_enemies = true
- local draw_hpvalues = true
- local draw_projectiles = true
- local draw_instantbox = false
- local function draw_instabox(base)
- local camx = memory.readword(cx)
- local camy = memory.readword(cy)
- local facing = memory.readbyte(base + 0x11)
- local x = memory.readword(base + 5) - camx
- local y = memory.readword(base + 8) - camy
- local boxpointer = memory.readword(base +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,"#FF000005", "#FF0000FF")
- end
- 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 = 0xE68
- 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 then
- if i > 14 and i < 21 then
- if draw_projectiles == true then
- fill = "#FFFFFF40"
- outl = "#FFFFFFFF"
- else
- fill = "#00000000"
- outl = "#00000000"
- end
- else
- fill = "#FF000040"
- outl = "#FF0000FF"
- end
- if i > 21 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
- if draw_instantbox == true then
- memory.registerwrite(0x7E0000 + base + 0x20,2,function ()
- draw_instabox(memory.getregister("D"))
- end)
- 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 then
- if i < 15 or i > 20 then
- gui.text(x-5,y-5,"HP: " .. memory.readbyte(base+0x27))
- end
- end
- end
- end
- end
- local function cheat()
- memory.writebyte(pbase + 0x27,20)
- end
- gui.register(function()
- if cheats == true then
- cheat()
- end
- if draw_megaman == true then
- megaman()
- end
- if draw_enemies == true then
- enemies()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment