Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local table = { }
- lag = 0
- function popcount(x)
- local counter = 0
- while (x > 0) do
- local y = x % 2
- counter = counter + y
- x = (x - y ) / 2
- end
- return counter
- end
- while true do
- -- Speeds
- xspd = memory.readwordsigned(0x7E0BC2)
- yspd = memory.readwordsigned(0x7E0BC4)
- cartxspd = memory.readwordsigned(0x7E1002)
- cartyspd = memory.readwordsigned(0x7E1004)
- gui.text(13,199, "X Spd: " .. xspd)
- gui.text(13,209, "Y Spd: " .. yspd)
- -- Positions
- mmx = memory.readword(0x7E0BCA)
- mmy = memory.readword(0x7E0BCC)
- xsub = memory.readbyte(0x7E0BAC)
- ysub = memory.readbyte(0x7E0BAF)
- gui.text(180,199, "X Pos: " .. mmx)
- gui.text(180,209, "Y Pos: " .. mmy)
- gui.text(230,199, ": " .. xsub)
- gui.text(230,209, ": " .. ysub)
- -- HP
- gui.transparency(0.0)
- HP = memory.readbyte(0x7E0BCF)
- if HP > 0 then
- gui.text(9,98, " " .. HP, "#0xF8C000FF")
- end
- -- Weapon Energy
- gui.transparency(0.0)
- Weapon = memory.readbyte(0x7E0BDB)
- Ammo1 = memory.readbyte(0x7E1F88)
- Ammo2 = memory.readbyte(0x7E1F8A)
- Ammo3 = memory.readbyte(0x7E1F8C)
- Ammo4 = memory.readbyte(0x7E1F8E)
- Ammo5 = memory.readbyte(0x7E1F90)
- Ammo6 = memory.readbyte(0x7E1F92)
- Ammo7 = memory.readbyte(0x7E1F94)
- Ammo8 = memory.readbyte(0x7E1F96)
- Half1 = memory.readbyte(0x7E1F87)
- Half2 = memory.readbyte(0x7E1F89)
- Half4 = memory.readbyte(0x7E1F8D)
- Half5 = memory.readbyte(0x7E1F8F)
- Half6 = memory.readbyte(0x7E1F91)
- Half7 = memory.readbyte(0x7E1F93)
- Half8 = memory.readbyte(0x7E1F95)
- -- Homing Torpedo
- if Weapon == 2 then
- if Ammo1 < 190 then
- gui.text(24,98, " " .. 2*Ammo1-129+Half1/128, "#0x88B8A0FF")
- afix1 = 2*Ammo1-129+Half1/128
- else
- if afix1 == nil then
- afix1 = 2*Ammo1-129+Half1/128
- else
- gui.text(24,98, " " .. afix1, "#0x88B8A0FF")
- end
- end
- -- Chameleon Sting
- elseif Weapon == 4 then
- if Ammo2 < 190 then
- gui.text(24,98, " " .. 2*Ammo2-129+Half2/128, "#0xB0F000FF")
- afix2 = 2*Ammo2-129+Half2/128
- else
- if afix2 == nil then
- afix2 = 2*Ammo2-129+Half2/128
- else
- gui.text(24,98, " " .. afix2, "#0xB0F000FF")
- end
- end
- -- Rolling Shield
- elseif Weapon == 6 then
- if Ammo3 < 190 then
- gui.text(24,98, " " .. Ammo3-64, "#0xF880C0FF")
- afix3 = Ammo3-64
- else
- if afix3 == nil then
- afix3 = Ammo3-64
- else
- gui.text(24,98, " " .. afix3, "#0xF880C0FF")
- end
- end
- -- Fire Wave
- elseif Weapon == 8 then
- if Ammo4 < 190 then
- gui.text(24,98, " " .. 16*Ammo4-1039+Half4/16, "#0xF87870FF")
- afix4 = 16*Ammo4-1039+Half4/16
- else
- if afix4 == nil then
- afix4 = 16*Ammo4-1039+Half4/16
- else
- gui.text(24,98, " " .. afix4, "#0xF87870FF")
- end
- end
- -- Storm Tornado
- elseif Weapon == 10 then
- if Ammo5 < 190 then
- gui.text(24,98, " " .. Ammo5-64, "#0xC8A0E8FF")
- afix5 = Ammo5-64
- else
- if afix5 == nil then
- afix5 = Ammo5-64
- else
- gui.text(24,98, " " .. afix5, "#0xC8A0E8FF")
- end
- end
- -- Electric Spark
- elseif Weapon == 12 then
- if Ammo6 < 190 then
- gui.text(24,98, " " .. Ammo6-64, "#0xE0F858FF")
- afix6 = Ammo6-64
- else
- if afix6 == nil then
- afix6 = Ammo6-64
- else
- gui.text(24,98, " " .. afix6, "#0xE0F858FF")
- end
- end
- -- Boomerang Cutter
- elseif Weapon == 14 then
- if Ammo7 < 190 then
- gui.text(24,98, " " .. Ammo7-64, "#0xA0B0C8FF")
- afix7 = Ammo7-64
- else
- if afix7 == nil then
- afix7 = Ammo7-64
- else
- gui.text(24,98, " " .. afix7, "#0xA0B0C8FF")
- end
- end
- -- Shotgun Ice
- elseif Weapon == 16 then
- if Ammo8 < 190 then
- gui.text(24,98, " " .. Ammo8-64, "#0x88E0D8FF")
- afix8 = Ammo8-64
- else
- if afix8 == nil then
- afix8 = Ammo8-64
- else
- gui.text(24,98, " " .. afix8, "#0x88E0D8FF")
- end
- end
- end
- -- Hit Box
- cx = memory.readword(0x7E00B4)
- cy = memory.readword(0x7E00B6)
- gui.transparency(2.0)
- gui.drawbox(mmx-cx-7,mmy-cy-19,mmx-cx+7,mmy-cy+15)
- -- Enemy HP
- EID = memory.readbyte(0x7E0E72)
- ex1 = memory.readword(0x7E0E8A)
- ey1 = memory.readword(0x7E0E8C)
- ex2 = memory.readword(0x7E0ECA)
- ey2 = memory.readword(0x7E0ECC)
- ex3 = memory.readword(0x7E0F0A)
- ey3 = memory.readword(0x7E0F0C)
- ex4 = memory.readword(0x7E0F4A)
- ey4 = memory.readword(0x7E0F4C)
- ex5 = memory.readword(0x7E0F8A)
- ey5 = memory.readword(0x7E0F8C)
- ex6 = memory.readword(0x7E0FCA)
- ey6 = memory.readword(0x7E0FCC)
- ex7 = memory.readword(0x7E100A)
- ey7 = memory.readword(0x7E100C)
- ex8 = memory.readword(0x7E104A)
- ey8 = memory.readword(0x7E104C)
- ex9 = memory.readword(0x7E108A)
- ey9 = memory.readword(0x7E108C)
- ex10 = memory.readword(0x7E10CA)
- ey10 = memory.readword(0x7E10CC)
- ex11 = memory.readword(0x7E110A)
- ey11 = memory.readword(0x7E110C)
- ex12 = memory.readword(0x7E114A)
- ey12 = memory.readword(0x7E114C)
- HP1 = memory.readbyte(0x7E0E8F)
- HP2 = memory.readbyte(0x7E0ECF)
- HP3 = memory.readbyte(0x7E0F0F)
- HP4 = memory.readbyte(0x7E0F4F)
- HP5 = memory.readbyte(0x7E0F8F)
- HP6 = memory.readbyte(0x7E0FCF)
- HP7 = memory.readbyte(0x7E100F)
- HP8 = memory.readbyte(0x7E104F)
- HP9 = memory.readbyte(0x7E108F)
- HP10 = memory.readbyte(0x7E10CF)
- HP11 = memory.readbyte(0x7E110F)
- HP12 = memory.readbyte(0x7E114F)
- if HP1 > 0 then
- if HP1 < 128 then
- gui.drawbox(ex1-cx-6,ey1-cy+11,ex1-cx+8,ey1-cy+24)
- gui.transparency(0.5)
- gui.text(ex1-cx-2, ey1-cy+15, HP1)
- end
- end
- if HP2 > 0 then
- if HP2 < 128 then
- gui.transparency(2.0)
- gui.drawbox(ex2-cx-6,ey2-cy+11,ex2-cx+8,ey2-cy+24)
- gui.transparency(0.5)
- gui.text(ex2-cx-2, ey2-cy+15, HP2)
- end
- end
- if HP3 > 0 then
- if HP3 < 128 then
- gui.transparency(2.0)
- gui.drawbox(ex3-cx-6,ey3-cy+11,ex3-cx+8,ey3-cy+24)
- gui.transparency(0.5)
- gui.text(ex3-cx-2, ey3-cy+15, HP3)
- end
- end
- if HP4 > 0 then
- if HP4 < 128 then
- gui.transparency(2.0)
- gui.drawbox(ex4-cx-6,ey4-cy+11,ex4-cx+8,ey4-cy+24)
- gui.transparency(0.5)
- gui.text(ex4-cx-2, ey4-cy+15, HP4)
- end
- end
- if HP5 > 0 then
- if HP5 < 128 then
- gui.transparency(2.0)
- gui.drawbox(ex5-cx-6,ey5-cy+11,ex5-cx+8,ey5-cy+24)
- gui.transparency(0.5)
- gui.text(ex5-cx-2, ey5-cy+15, HP5)
- end
- end
- if HP6 > 0 then
- if HP6 < 128 then
- gui.transparency(2.0)
- gui.drawbox(ex6-cx-6,ey6-cy+11,ex6-cx+8,ey6-cy+24)
- gui.transparency(0.5)
- gui.text(ex6-cx-2, ey6-cy+15, HP6)
- end
- end
- if HP7 > 0 then
- if HP7 < 128 then
- gui.transparency(2.0)
- gui.drawbox(ex7-cx-6,ey7-cy+11,ex7-cx+8,ey7-cy+24)
- gui.transparency(0.5)
- gui.text(ex7-cx-2, ey7-cy+15, HP7)
- end
- end
- if HP8 > 0 then
- if HP8 < 128 then
- gui.transparency(2.0)
- gui.drawbox(ex8-cx-6,ey8-cy+11,ex8-cx+8,ey8-cy+24)
- gui.transparency(0.5)
- gui.text(ex8-cx-2, ey8-cy+15, HP8)
- end
- end
- if HP9 > 0 then
- if HP9 < 128 then
- gui.transparency(2.0)
- gui.drawbox(ex9-cx-6,ey9-cy+11,ex9-cx+8,ey9-cy+24)
- gui.transparency(0.5)
- gui.text(ex9-cx-2, ey9-cy+15, HP9)
- end
- end
- if HP10 > 0 then
- if HP10 < 128 then
- gui.transparency(2.0)
- gui.drawbox(ex10-cx-6,ey10-cy+11,ex10-cx+8,ey10-cy+24)
- gui.transparency(0.5)
- gui.text(ex10-cx-2, ey10-cy+15, HP10)
- end
- end
- if HP11 > 0 then
- if HP11 < 128 then
- gui.transparency(2.0)
- gui.drawbox(ex11-cx-6,ey11-cy+11,ex11-cx+8,ey11-cy+24)
- gui.transparency(0.5)
- gui.text(ex11-cx-2, ey11-cy+15, HP11)
- end
- end
- if HP12 > 0 then
- if HP12 < 128 then
- gui.transparency(2.0)
- gui.drawbox(ex12-cx-6,ey12-cy+11,ex12-cx+8,ey12-cy+24)
- gui.transparency(0.5)
- gui.text(ex12-cx-2, ey12-cy+15, HP12)
- end
- end
- -- Buster Charge
- gui.transparency(0.0)
- timer = memory.readbyte(0x7E0BFF)
- stype = memory.readbyte(0x7E0C03)
- table = joypad.get(1)
- if table.Y then
- if stype == 0 then
- gui.text(mmx-cx-18, mmy-cy+17, " " .. timer-151)
- elseif stype == 3 then
- gui.text(mmx-cx-18, mmy-cy+17, " " .. timer-80)
- elseif stype == 2 then
- gui.text(mmx-cx-18, mmy-cy+17, " " .. timer-2)
- elseif stype == 1 then
- end
- if timer <= 1 then
- gui.text(mmx-cx-2, mmy-cy+17, "0", "white", "#0x00E068FF")
- gui.text(mmx-cx+4, mmy-cy+17, "0", "white", "#0x00A0F8FF")
- gui.text(mmx-cx+10, mmy-cy+17, "0", "white", "#0xF850A8FF")
- elseif timer > 1 then
- if timer <= 149 then
- if timer > 79 then
- gui.text(mmx-cx-2, mmy-cy+17, "0", "white", "#0x00E068FF")
- else
- gui.text(mmx-cx-2, mmy-cy+17, "0", "white", "#0x00E068FF")
- gui.text(mmx-cx+4, mmy-cy+17, "0", "white", "#0x00A0F8FF")
- end
- end
- end
- end
- -- Lag Counter
- -- gui.text(13,188, "Lag: ")
- -- gui.text(33,188, lag, "red")
- a = math.abs(xspd+yspd)
- if a > 0 then
- if z == nil then
- z = cx
- y = cy
- else
- x1 = cx-z
- y1 = cy-y
- if x1 == 0 and y1 == 0 then
- lag = lag+1
- z = cx
- y = cy
- else
- z = cx
- y = cy
- end
- end
- end
- -- Upgrade Progress
- Hearts = memory.readbytesigned(0x7E1F9A)
- TankPod = memory.readbytesigned(0x7E1F99)
- Parts1 = popcount(memory.readbyte(0x7E1F99))*4
- Parts2 = Hearts*2 - 32
- if Ammo1 > 0 then
- W1 = 4
- else W1 = 0
- end
- if Ammo2 > 0 then
- W2 = 4
- else W2 = 0
- end
- if Ammo3 > 0 then
- W3 = 4
- else W3 = 0
- end
- if Ammo4 > 0 then
- W4 = 4
- else W4 = 0
- end
- if Ammo5 > 0 then
- W5 = 4
- else W5 = 0
- end
- if Ammo6 > 0 then
- W6 = 4
- else W6 = 0
- end
- if Ammo7 > 0 then
- W7 = 4
- else W7 = 0
- end
- if Ammo8 > 0 then
- W8 = 4
- else W8 = 0
- end
- Parts3 = W1+W2+W3+W4+W5+W6+W7+W8
- Hadoken = memory.readbyte(0x7E1F7E)
- if Hadoken == 133 then
- Parts4 = 4
- else Parts4 = 0
- end
- Parts = Parts1+Parts2+Parts3+Parts4
- gui.text(150,210, Parts, "green")
- if Parts == 100 then
- gui.text(80,210, "UPGRADE PROGRESS: %")
- else
- if Parts < 10 then
- gui.text(80,210, "UPGRADE PROGRESS: %")
- elseif Parts >= 10 then
- gui.text(80,210, "UPGRADE PROGRESS: %")
- end
- end
- gui.drawbox(79,206,161,200,"black")
- gui.drawline(80,201,Parts*.8+80,201,"#0xF54646FF")
- gui.drawline(80,202,Parts*.8+80,202,"#0xC10000FF")
- gui.drawline(80,203,Parts*.8+80,203,"#0x9D0000FF")
- gui.drawline(80,204,Parts*.8+80,204,"#0x6A0000FF")
- gui.drawline(80,205,Parts*.8+80,205,"#0x4F0000FF")
- gui.drawline(80,201,80,201,"#0xF54646FF")
- gui.drawline(80,202,80,202,"#0xF54646FF")
- gui.drawline(80,203,80,203,"#0xC10000FF")
- gui.drawline(80,204,80,204,"#0x9D0000FF")
- gui.drawline(80,205,80,205,"#0x6A0000FF")
- emu.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement