function GetNextItem(pct) if pct == 0 then return "Morphing Ball" end if pct == 1 then return "Missile (blue Brinstar bottom)" end if pct == 2 then return "Bomb" end if pct == 3 then return "Energy Tank (tunnel to Brinstar)" end if pct == 4 then return "Missile (green Brinstar below super missile)" end if pct == 5 then return "Missile (green Brinstar behind reserve tank)" end if pct == 6 then return "Missile (green Brinstar behind missile)" end if pct == 7 then return "Reserve Tank (green Brinstar)" end if pct == 8 then return "Super Missile (green Brinstar)" end if pct == 9 then return "Charge Beam" end if pct == 10 then return "Spazer" end if pct == 11 then return "Varia Suit" end if pct == 12 then return "Energy Tank (Kraid)" end if pct == 13 then return "Hi-Jump Boots" end if pct == 14 then return "Missile (Hi-Jump Boots)" end if pct == 15 then return "Energy Tank (Hi-Jump Boots)" end if pct == 16 then return "Missile (lava room)" end if pct == 17 then return "Missile (Speed Booster)" end if pct == 18 then return "Speed Booster" end if pct == 19 then return "Missile (Wave Beam)" end if pct == 20 then return "Wave Beam" end if pct == 21 then return "Energy Tank (Crocomire)" end if pct == 22 then return "Power Bomb (Crocomire)" end if pct == 23 then return "Missile (Grapple Beam)" end if pct == 24 then return "Grapple Beam" end if pct == 25 then return "Missile (below Crocomire)" end if pct == 26 then return "Missile (above Crocomire)" end if pct == 27 then return "Ice Beam" end if pct == 28 then return "Missile (red Brinstar spike room)" end if pct == 29 then return "Power Bomb (red Brinstar spike room)" end if pct == 30 then return "Power Bomb (red Brinstar sidehopper room)" end if pct == 31 then return "Missile (Crateria moat)" end if pct == 32 then return "Missile (Wrecked Ship middle)" end if pct == 33 then return "Super Missile (Wrecked Ship right)" end if pct == 34 then return "Super Missile (Wrecked Ship left)" end if pct == 35 then return "Missile (Wrecked Ship top)" end if pct == 36 then return "Missile (outside Wrecked Ship top)" end if pct == 37 then return "Missile (outside Wrecked Ship middle)" end if pct == 38 then return "Missile (Gravity Suit)" end if pct == 39 then return "Reserve Tank (Wrecked Ship)" end if pct == 40 then return "Gravity Suit" end if pct == 41 then return "Energy Tank (Wrecked Ship)" end if pct == 42 then return "Missile (outside Wrecked Ship bottom)" end if pct == 43 then return "Power Bomb (Crateria surface)" end if pct == 44 then return "Energy Tank (Crateria gauntlet)" end if pct == 45 then return "Missile (Crateria gauntlet left)" end if pct == 46 then return "Missile (Crateria gauntlet right)" end if pct == 47 then return "Super Missile (green Brinstar bottom)" end if pct == 48 then return "Energy Tank (green Brinstar bottom)" end if pct == 49 then return "Power Bomb (green Brinstar bottom)" end if pct == 50 then return "Missile (pink Brinstar top)" end if pct == 51 then return "Power Bomb (pink Brinstar)" end if pct == 52 then return "Super Missile (pink Brinstar)" end if pct == 53 then return "Energy Tank (pink Brinstar top)" end if pct == 54 then return "Missile (pink Brinstar bottom)" end if pct == 55 then return "Energy Tank (pink Brinstar bottom)" end if pct == 56 then return "Missile (green Brinstar pipe)" end if pct == 57 then return "Missile (green Maridia Shinespark)" end if pct == 58 then return "Energy Tank (green Maridia)" end if pct == 59 then return "Missile (green Maridia turtle room)" end if pct == 60 then return "Super Missile (green Maridia)" end if pct == 61 then return "Missile (yellow Maridia false wall)" end if pct == 62 then return "Super Missile (yellow Maridia)" end if pct == 63 then return "Missile (yellow Maridia super missile)" end if pct == 64 then return "Missile (pink Maridia)" end if pct == 65 then return "Super Missile (pink Maridia)" end if pct == 66 then return "Missile (Draygon)" end if pct == 67 then return "Space Jump" end if pct == 68 then return "Energy tank (Botwoon)" end if pct == 69 then return "Missile (right Maridia sand pit room)" end if pct == 70 then return "Power Bomb (right Maridia sand pit room)" end if pct == 71 then return "Spring Ball" end if pct == 72 then return "Plasma Beam" end if pct == 73 then return "Reserve Tank (Maridia)" end if pct == 74 then return "Missile (left Maridia sand pit room)" end if pct == 75 then return "Missile (Kraid)" end if pct == 76 then return "Missile (below Ice Beam)" end if pct == 77 then return "Missile (Gold Torizo)" end if pct == 78 then return "Super Missile (Gold Torizo)" end if pct == 79 then return "Screw Attack" end if pct == 80 then return "Missile (Mickey Mouse room)" end if pct == 81 then return "Power Bomb (above Ridley)" end if pct == 82 then return "Energy Tank (Ridley)" end if pct == 83 then return "Energy Tank (lower Norfair fire flea room)" end if pct == 84 then return "Missile (lower Norfair above fire flea room)" end if pct == 85 then return "Power Bomb (lower Norfair above fire flea room)" end if pct == 86 then return "Missile (lower Norfair near Wave Beam)" end if pct == 87 then return "Missile (bubble Norfair green door)" end if pct == 88 then return "Reserve Tank (Norfair)" end if pct == 89 then return "Missile (Norfair reserve tank)" end if pct == 90 then return "Missile (bubble Norfair)" end if pct == 91 then return "X-Ray Scope" end if pct == 92 then return "Power Bomb (blue Brinstar)" end if pct == 93 then return "Missile (blue Brinstar behind missile)" end if pct == 94 then return "Missile (blue Brinstar top)" end if pct == 95 then return "Missile (blue Brinstar middle)" end if pct == 96 then return "Energy Tank (blue Brinstar)" end if pct == 97 then return "Missile (Crateria bottom)" end if pct == 98 then return "Super Missile (Crateria middle)" end if pct == 99 then return "Missile (Crateria middle)" end if pct == 100 then return "Beat the Game!" end end while true do textX = 0 textY = 190 curHour = memory.readword(0x7e09e0) curMin = memory.readword(0x7e09de) curSec = memory.readword(0x7e09dc) curMil = math.floor(memory.readword(0x7e09da) *100 / 60) gui.text(textX, textY + 20, "Time: " .. curHour .. ":" .. string.format("%02d",curMin) .. ":" .. string.format("%02d",curSec) .. "." .. string.format("%02d",curMil)) missiles = math.floor(memory.readbyte(0x7e09c8) / 5) superMissiles = math.floor(memory.readbyte(0x7e09cc) / 5) powerBombs = math.floor(memory.readbyte(0x7e09d0) / 5) energyTanks = math.floor((memory.readword(0x7e09c4) - 99) / 100) reserveTanks = math.floor(memory.readword(0x7e09d4) / 100) items = memory.readword(0x7e09a4) variaSuit = items % 2 springBall = math.floor((items % 4) / 2) morphBall = math.floor((items % 8) / 4) screwAttack = math.floor((items % 16) / 8) gravitySuit = math.floor((items % 64) / 32) hiJumpBoots = math.floor((items % 512) / 256) spaceJump = math.floor((items % 1024) / 512) bomb = math.floor((items % 8192) / 4096) speedBooster = math.floor((items % 16384) / 8192) grappleBeam = math.floor((items % 32768) / 16384) xRayScope = math.floor(items / 32768) weapons = memory.readword(0x7e09a8) waveBeam = weapons % 2 iceBeam = math.floor((weapons % 4) / 2) spazerBeam = math.floor((weapons % 8) / 4) plasmaBeam = math.floor((weapons % 16) / 8) chargeBeam = math.floor((weapons % 8192) / 4096) pct = missiles + superMissiles + powerBombs + energyTanks + reserveTanks + variaSuit + springBall + morphBall + screwAttack + gravitySuit + hiJumpBoots + spaceJump + bomb + speedBooster + grappleBeam + xRayScope + waveBeam + iceBeam + spazerBeam + plasmaBeam + chargeBeam gui.text(textX, textY + 10, "Pct: " .. pct .. "%") gui.text(textX, textY, "Next Item: " .. GetNextItem(pct)) snes9x.frameadvance() end