Guest User

Untitled

a guest
Mar 2nd, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. -- HUD script originally made by Pasky, MESHUGGAH just transformed them
  2.  
  3. local px, cx, py, pxs, pys
  4. local lpx = 0
  5. local lpy = 0
  6.  
  7. -- for objects
  8. local dir
  9.  
  10. function findbit(p)
  11. return 2 ^ (p - 1)
  12. end
  13.  
  14. function hasbit(x, p)
  15. return x % (p + p) >= p
  16. end
  17.  
  18. local function axis(x,y,color)
  19. --gui.box(x-16,y-16, x+16,y+16,"#FFFFFF10")
  20. gui.line(x,y-16,x,y+16,color)
  21. gui.line(x-16,y,x+16,y,color)
  22. end
  23.  
  24. local function objects()
  25. gui.text(1,220,string.format("Direction, Animation timer, State?, ??? / X pos, Y pos with sub"))
  26. for i=0, 15 do
  27. if (memory.readbyte(0x4e0+i) ~= 0) then
  28. axis(memory.readbyte(0x450+i),memory.readbyte(0x440+i),"#FFFFFF3F")
  29. dir = memory.readbyte(0x400+i)
  30. -- up down? 90 d0 d8...
  31. if hasbit(dir,findbit(7)) == true then dir = '>' else dir = '<' end
  32. gui.text(memory.readbyte(0x450+i)-16,memory.readbyte(0x440+i)-22,
  33. string.format("%s %d %3d %3d", dir, memory.readbyte(0x410+i), memory.readbyte(0x420+i), memory.readbyte(0x4b0+i)),"#FFFFFFb0", "#00000030")
  34. gui.text(memory.readbyte(0x450+i)-16,memory.readbyte(0x440+i)+22,
  35. string.format("%3d,%3d.%3d", memory.readwordunsigned(0x4F0+i,0x500+i), memory.readbyte(0x440+i), memory.readbyte(0x460+i)),"#FFFFFFb0", "#00000030")
  36. end
  37. end
  38. end
  39.  
  40. local function Stuff()
  41.  
  42. px = memory.readwordunsigned(0x4F0,0x500)
  43. py = memory.readbyte(0x440)
  44.  
  45. pxs = px - lpx
  46. pys = py - lpy
  47.  
  48. gui.text(100,200,string.format("X:%3d (%3d)\nY:%3d (%3d)", px, pxs, py, pys))
  49.  
  50. lpx = px
  51. lpy = py
  52.  
  53. objects()
  54. end
  55.  
  56. emu.registerafter(Stuff)
Advertisement
Add Comment
Please, Sign In to add comment