Advertisement
Guest User

DKC2 ID Lua Script

a guest
Dec 10th, 2012
805
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.50 KB | None | 0 0
  1. function DKC2()
  2.     local scount = 0
  3.     local cx = memory.readwordsigned(0x7E17BA)
  4.     local cy = memory.readwordsigned(0x7E17C0)
  5.     local x = memory.readword(0x7E0A2A)
  6.     local y = memory.readword(0x7E0A2C)
  7.     local spx = memory.readwordsigned(0x7E0A30)
  8.     local spy1 = memory.readwordsigned(0x7E0E06)
  9.     local spy2 = memory.readwordsigned(0x7E0E64)
  10.     local saru = memory.readbyte(0x7E08A4)
  11.     local hold = memory.readword(0x7E0D7A)
  12.     if hold == 0 then
  13.         disphold = 0
  14.     else
  15.         disphold = 1
  16.     end
  17.     for id = 0, 21 do
  18.             local stat = memory.readword(0x7E0E9E+id*94)
  19.             local sx = memory.readword(0x7E0EA4+id*94)
  20.             local sy = memory.readword(0x7E0EA8+id*94)
  21.             local sspx = memory.readwordsigned(0x7E0EBE+id*94)
  22.             local sspy = memory.readwordsigned(0x7E0EC2+id*94)
  23.             local num = memory.readword(0x7E0ED4+id*94)
  24.  
  25.             if id < 7 then
  26.                 if stat ~= 0 then
  27.                     gui.opacity(0.7)
  28.                 else
  29.                     gui.opacity(0.2)
  30.                 end
  31.                 gui.text(2, 80+id*8, string.format("%d(%x, %d, %d)", id, num, sx, sy)) 
  32.             end
  33.  
  34.             gui.opacity(0.7)
  35.             if stat ~= 0 then
  36.                 gui.text(sx-cx-4, sy-cy-(id%4)*8, string.format("%d (%x)", id, num))
  37.                 scount = scount + 1
  38.             end
  39.     end
  40.  
  41.  
  42.     if saru == 0 then
  43.         spy = spy1
  44.     else
  45.         spy = spy2
  46.     end
  47.     gui.text(2, 150+0*8, string.format("speed: %d, %d", spx, spy))
  48.     gui.text(2, 150+1*8, string.format("position: %d, %d", x, y))
  49.     if disphold == 1 then
  50.         gui.text(2, 50, string.format("Holding ID: %d", (hold-3742)/94))
  51.     end
  52.     gui.text(254-24, 2, string.format("SPR:%02d", scount))
  53. end
  54. gui.register(DKC2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement