Guest User

Untitled

a guest
Jul 4th, 2012
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.67 KB | None | 0 0
  1. ---------------
  2. ----GLOBALS----
  3. ---------------
  4. local pbase = 0x9D8
  5. local px = pbase +0x5
  6. local py = pbase +0x8
  7. local cx = 0x7E1E5D
  8. local cy = 0x7E1E60
  9.  
  10. ---------------
  11. ----TOGGLES----
  12. ---------------
  13. local draw_megaman = true
  14. local draw_enemies = true
  15. local draw_hpvalues = true
  16. local draw_projectiles = true
  17.  
  18. local function megaman()
  19.  
  20.     local camx = memory.readword(cx)
  21.     local camy = memory.readword(cy)
  22.     local x = memory.readword(px) - camx
  23.     local y = memory.readword(py) - camy
  24.     local facing = memory.readbyte(pbase + 0x11)
  25.     local boxpointer = memory.readword(pbase + 0x20) + 0x860000
  26.     local xoff = memory.readbytesigned(boxpointer + 0)
  27.     local yoff = memory.readbytesigned(boxpointer + 1)
  28.     local xrad = memory.readbyte(boxpointer + 2)
  29.     local yrad = memory.readbyte(boxpointer + 3)
  30.    
  31.     if facing > 0x45 then
  32.         xoff = xoff * -1
  33.     end
  34.    
  35.     gui.box(x + xoff +xrad,y + yoff + yrad, x + xoff - xrad, y + yoff - yrad,"#0000FF40","#0000FFFF")  
  36. end
  37.  
  38. local function enemies()
  39.  
  40.     local x
  41.     local xoff
  42.     local xrad
  43.     local y
  44.     local yoff
  45.     local yrad
  46.     local camx = memory.readword(cx)
  47.     local camy = memory.readword(cy)
  48.     local base
  49.     local boxpointer
  50.     local facing
  51.     local fill
  52.     local outl
  53.     local start = 0xD18
  54.     local oend = 31
  55.    
  56.     for i = 0, oend,1 do
  57.    
  58.         base = start + (i * 0x40)
  59.        
  60.         if i == 0 then
  61.             base = start
  62.         end
  63.        
  64.         if memory.readbyte(base) ~= 0 and memory.readbyte(base + 0x27) ~= 128 then
  65.            
  66.             if i > 14 and i < 25 then
  67.                 if draw_projectiles == true then
  68.                     fill = "#FFFFFF40"
  69.                     outl = "#FFFFFFFF"
  70.                 else
  71.                     fill = "#00000000"
  72.                     outl = "#00000000"
  73.                 end
  74.             else
  75.                 fill = "#FF000040"
  76.                 outl = "#FF0000FF"
  77.             end
  78.            
  79.             if i > 24 then
  80.                 fill = "#FFFF0040"
  81.                 outl = "#FFFF00FF"
  82.             end
  83.            
  84.             facing = memory.readbyte(base + 0x11)
  85.             x = memory.readword(base + 5) - camx
  86.             y = memory.readword(base + 8) - camy
  87.             boxpointer = memory.readword(base +0x20) + 0x860000
  88.             xoff = memory.readbytesigned(boxpointer + 0)
  89.             yoff = memory.readbytesigned(boxpointer + 1)
  90.             xrad = memory.readbyte(boxpointer + 2)
  91.             yrad = memory.readbyte(boxpointer + 3)
  92.            
  93.         if facing > 0x45 then
  94.                 xoff = xoff * -1
  95.         end
  96.        
  97.        
  98.         --gui.text(x,y,string.format("%X",base))  -- Debug
  99.         gui.box(x + xoff +xrad,y + yoff + yrad, x + xoff - xrad, y + yoff - yrad,fill, outl)   
  100.            
  101.             if draw_hpvalues == true and memory.readbyte(base+0x27) > 0 and memory.readbyte(base+0x27) ~= 128 then
  102.                 if i < 15 or i > 20 then
  103.                     gui.text(x-5,y-5,"HP: " .. memory.readbyte(base+0x27))
  104.                 end
  105.             end
  106.         end
  107.     end
  108. end
  109.  
  110. gui.register(function()
  111.     if draw_megaman == true then
  112.         megaman()
  113.     end
  114.     if draw_enemies == true then
  115.         enemies()
  116.     end
  117. end)
Advertisement
Add Comment
Please, Sign In to add comment