Advertisement
Guest User

Untitled

a guest
Sep 8th, 2011
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. --no movement frame counter
  2. LastDistance = 0
  3. CurrentDistance = 0
  4. nomovement = 0
  5.  
  6. while true do
  7.  
  8. --declarations
  9. xposoncam = memory.readbyte(0xc704)
  10. xsub = memory.readbyte(0xc703)
  11. ypos = memory.readbyte(0xc706)
  12. ysub = memory.readbyte(0xc705)
  13. xcam = memory.readbyte(0xff43)
  14. xcamsection = memory.readbyte(0xc684)
  15. hp = memory.readbyte(0xc717)
  16. bosshp = memory.readbyte(0xc0e9) --variable, needs to be updated >_>
  17.  
  18. killcount1 = memory.readbyte(0xd00a) -- bomb 3rd level, 3th
  19. killcount2 = memory.readbyte(0xd00b) -- hp, 20th
  20. killcount3 = memory.readbyte(0xd00c) -- <3, 50th
  21. killcount4 = memory.readbyte(0xd00d) -- 1up, 90th
  22. killcount5 = memory.readbyte(0xd00e) -- hp, lastlvl(?), 4th
  23. killcount6 = memory.readbyte(0xd00f) -- bomb, last level, 8th
  24.  
  25. havebomb = memory.readbyte(0xd013)
  26.  
  27. --display
  28. gui.opacity(0.88)
  29. gui.drawbox(0,16,260,21, "black")
  30. gui.drawbox(0,0,127,15, "black")
  31. gui.drawline(44,2,44,16, "#666666")
  32. gui.drawline(81,2,81,16, "#666666")
  33. gui.opacity(0.55)
  34. gui.drawbox(0,22,260,23, "black")
  35. gui.opacity(0.88)
  36.  
  37. gui.text(6,6, "X", "yellow")
  38. gui.text(6,12, "Y", "yellow")
  39. gui.text(18,6, xposoncam+xsub/256)
  40. gui.text(18,12, ypos+ysub/256)
  41.  
  42. gui.text(2,0, "Cam", "yellow")
  43. gui.text(18,0, xcam)
  44.  
  45. gui.text(54,0, "HP", "yellow")
  46. gui.text(50,6, "Boss", "yellow")
  47. gui.text(68,0, hp)
  48. gui.text(71,6, bosshp)
  49.  
  50. gui.text(85,-1, "Bottle", "#99FFFF")
  51. gui.text(85,5, "Heart", "#99FFFF")
  52. gui.text(85,11, "1up", "#99FFFF")
  53. gui.text(85,17, "Bomb", "#99FFFF")
  54. if killcount5 == 0 then gui.text(116,-1, 20-killcount2) else gui.text(116,-1, 4-killcount5) end
  55. gui.text(116,5, 50-killcount3)
  56. gui.text(116,11,90-killcount4)
  57. if killcount6 == 0 then gui.text(116,17,3-killcount1) else gui.text(116,17,8-killcount6) end
  58.  
  59. if havebomb == 1 then gui.text(51,14,"[Bomb]","orange") else end
  60.  
  61. --enemy x,y display
  62. for i = 0xC060, 0xC0FF, 32 do
  63. active = memory.readbytesigned(i+0)
  64. if active ~= -1 and active ~= 3 then
  65. local xenemy = memory.readbyte(i+2) -----subx unneeded +memory.readbyteunsigned(i+10)/256
  66. local yenemy = memory.readbyte(i+3) -----suby unneeded +memory.readbyteunsigned(i+11)/256
  67. gui.opacity(0.4)
  68. gui.drawbox(xenemy-xposoncam+46,yenemy-37,xenemy-xposoncam+66,yenemy-26,"#009933")
  69. gui.opacity(0.95)
  70. gui.text(xenemy-xposoncam+47,yenemy-38,"X " ..xenemy)
  71. gui.text(xenemy-xposoncam+47,yenemy-32,"Y " ..yenemy)
  72.  
  73. end
  74. end
  75.  
  76. -- no movement counter
  77. -- Pressing E will reset the nomovement count
  78. LastDistance = CurrentDistance
  79. CurrentDistance = xcam
  80. CurrentSpeed = CurrentDistance - LastDistance
  81. if CurrentSpeed < 1 then nomovement = nomovement + 1 end
  82. table=input.get(1)
  83. if table.E then nomovement = 0 end
  84. gui.text(13,19, nomovement, "red")
  85.  
  86.  
  87.  
  88. vba.frameadvance()
  89. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement