Guest User

Untitled

a guest
Jun 14th, 2012
507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.55 KB | None | 0 0
  1. ---------------
  2. ----GLOBALS----
  3. ---------------
  4. local pbase = 0xBA8
  5. local px = 0xBAD
  6. local py = 0xBB0
  7. local cx = 0x7E00B4
  8. local cy = 0x7E00B6
  9.  
  10. ---------------
  11. ----TOGGLES----
  12. ---------------
  13. local cheats = false
  14. local draw_megaman = true
  15. local draw_enemies = true
  16. local draw_hpvalues = true
  17. local draw_projectiles = true
  18. local draw_instantbox = false
  19.  
  20. local function draw_instabox(base)
  21.    
  22.     local camx = memory.readword(cx)
  23.     local camy = memory.readword(cy)
  24.     local facing = memory.readbyte(base + 0x11)
  25.     local x = memory.readword(base + 5) - camx
  26.     local y = memory.readword(base + 8) - camy
  27.     local boxpointer = memory.readword(base +0x20) + 0x860000
  28.     local xoff = memory.readbytesigned(boxpointer + 0)
  29.     local yoff = memory.readbytesigned(boxpointer + 1)
  30.     local xrad = memory.readbyte(boxpointer + 2)
  31.     local yrad = memory.readbyte(boxpointer + 3)
  32.    
  33.     if facing > 0x45 then
  34.         xoff = xoff * -1
  35.     end
  36.    
  37.     gui.box(x + xoff +xrad,y + yoff + yrad, x + xoff - xrad, y + yoff - yrad,"#FF000005", "#FF0000FF")
  38. end
  39.  
  40. local function megaman()
  41.  
  42.     local camx = memory.readword(cx)
  43.     local camy = memory.readword(cy)
  44.     local x = memory.readword(px) - camx
  45.     local y = memory.readword(py) - camy
  46.     local facing = memory.readbyte(pbase + 0x11)
  47.     local boxpointer = memory.readword(pbase + 0x20) + 0x860000
  48.     local xoff = memory.readbytesigned(boxpointer + 0)
  49.     local yoff = memory.readbytesigned(boxpointer + 1)
  50.     local xrad = memory.readbyte(boxpointer + 2)
  51.     local yrad = memory.readbyte(boxpointer + 3)
  52.    
  53.     if facing > 0x45 then
  54.         xoff = xoff * -1
  55.     end
  56.    
  57.     gui.box(x + xoff +xrad,y + yoff + yrad, x + xoff - xrad, y + yoff - yrad,"#0000FF40","#0000FFFF")  
  58. end
  59.  
  60. local function enemies()
  61.  
  62.     local x
  63.     local xoff
  64.     local xrad
  65.     local y
  66.     local yoff
  67.     local yrad
  68.     local camx = memory.readword(cx)
  69.     local camy = memory.readword(cy)
  70.     local base
  71.     local boxpointer
  72.     local facing
  73.     local fill
  74.     local outl
  75.     local start = 0xE68
  76.     local oend = 31
  77.    
  78.     for i = 0, oend,1 do
  79.    
  80.         base = start + (i * 0x40)
  81.        
  82.         if i == 0 then
  83.             base = start
  84.         end
  85.        
  86.         if memory.readbyte(base) ~= 0 then
  87.            
  88.             if i > 14 and i < 21 then
  89.                 if draw_projectiles == true then
  90.                     fill = "#FFFFFF40"
  91.                     outl = "#FFFFFFFF"
  92.                 else
  93.                     fill = "#00000000"
  94.                     outl = "#00000000"
  95.                 end
  96.             else
  97.                 fill = "#FF000040"
  98.                 outl = "#FF0000FF"
  99.             end
  100.            
  101.             if i > 21 then
  102.                 fill = "#FFFF0040"
  103.                 outl = "#FFFF00FF"
  104.             end
  105.            
  106.             facing = memory.readbyte(base + 0x11)
  107.             x = memory.readword(base + 5) - camx
  108.             y = memory.readword(base + 8) - camy
  109.             boxpointer = memory.readword(base +0x20) + 0x860000
  110.             xoff = memory.readbytesigned(boxpointer + 0)
  111.             yoff = memory.readbytesigned(boxpointer + 1)
  112.             xrad = memory.readbyte(boxpointer + 2)
  113.             yrad = memory.readbyte(boxpointer + 3)
  114.            
  115.        
  116.         if facing > 0x45 then
  117.                 xoff = xoff * -1
  118.         end
  119.         if draw_instantbox == true then
  120.             memory.registerwrite(0x7E0000 + base + 0x20,2,function ()
  121.                 draw_instabox(memory.getregister("D"))
  122.             end)
  123.         end
  124.        
  125.         --gui.text(x,y,string.format("%X",base))  -- Debug
  126.         gui.box(x + xoff +xrad,y + yoff + yrad, x + xoff - xrad, y + yoff - yrad,fill, outl)   
  127.            
  128.             if draw_hpvalues == true and memory.readbyte(base+0x27) > 0 then
  129.                 if i < 15 or i > 20 then
  130.                     gui.text(x-5,y-5,"HP: " .. memory.readbyte(base+0x27))
  131.                 end
  132.             end
  133.         end
  134.     end
  135. end
  136.  
  137.  
  138. local function cheat()
  139.     memory.writebyte(pbase + 0x27,20)
  140. end
  141. gui.register(function()
  142.     if cheats == true then
  143.         cheat()
  144.     end
  145.     if draw_megaman == true then
  146.         megaman()
  147.     end
  148.     if draw_enemies == true then
  149.         enemies()
  150.     end
  151. end)
Advertisement
Add Comment
Please, Sign In to add comment