Advertisement
Dessyreqt

Super Metroid 100% Route Lua Script

Dec 14th, 2011
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.91 KB | None | 0 0
  1. function GetNextItem(pct)
  2.     if pct == 0 then return "Morphing Ball" end
  3.     if pct == 1 then return "Missile (blue Brinstar bottom)" end
  4.     if pct == 2 then return "Bomb" end
  5.     if pct == 3 then return "Energy Tank (tunnel to Brinstar)" end
  6.     if pct == 4 then return "Missile (green Brinstar below super missile)" end
  7.     if pct == 5 then return "Missile (green Brinstar behind reserve tank)" end
  8.     if pct == 6 then return "Missile (green Brinstar behind missile)" end
  9.     if pct == 7 then return "Reserve Tank (green Brinstar)" end
  10.     if pct == 8 then return "Super Missile (green Brinstar)" end
  11.     if pct == 9 then return "Charge Beam" end
  12.     if pct == 10 then return "Spazer" end
  13.     if pct == 11 then return "Varia Suit" end
  14.     if pct == 12 then return "Energy Tank (Kraid)" end
  15.     if pct == 13 then return "Hi-Jump Boots" end
  16.     if pct == 14 then return "Missile (Hi-Jump Boots)" end
  17.     if pct == 15 then return "Energy Tank (Hi-Jump Boots)" end
  18.     if pct == 16 then return "Missile (lava room)" end
  19.     if pct == 17 then return "Missile (Speed Booster)" end
  20.     if pct == 18 then return "Speed Booster" end
  21.     if pct == 19 then return "Missile (Wave Beam)" end
  22.     if pct == 20 then return "Wave Beam" end
  23.     if pct == 21 then return "Energy Tank (Crocomire)" end
  24.     if pct == 22 then return "Power Bomb (Crocomire)" end
  25.     if pct == 23 then return "Missile (Grapple Beam)" end
  26.     if pct == 24 then return "Grapple Beam" end
  27.     if pct == 25 then return "Missile (below Crocomire)" end
  28.     if pct == 26 then return "Missile (above Crocomire)" end
  29.     if pct == 27 then return "Ice Beam" end
  30.     if pct == 28 then return "Missile (red Brinstar spike room)" end
  31.     if pct == 29 then return "Power Bomb (red Brinstar spike room)" end
  32.     if pct == 30 then return "Power Bomb (red Brinstar sidehopper room)" end
  33.     if pct == 31 then return "Missile (Crateria moat)" end
  34.     if pct == 32 then return "Missile (Wrecked Ship middle)" end
  35.     if pct == 33 then return "Super Missile (Wrecked Ship right)" end
  36.     if pct == 34 then return "Super Missile (Wrecked Ship left)" end
  37.     if pct == 35 then return "Missile (Wrecked Ship top)" end
  38.     if pct == 36 then return "Missile (outside Wrecked Ship top)" end
  39.     if pct == 37 then return "Missile (outside Wrecked Ship middle)" end
  40.     if pct == 38 then return "Missile (Gravity Suit)" end
  41.     if pct == 39 then return "Reserve Tank (Wrecked Ship)" end
  42.     if pct == 40 then return "Gravity Suit" end
  43.     if pct == 41 then return "Energy Tank (Wrecked Ship)" end
  44.     if pct == 42 then return "Missile (outside Wrecked Ship bottom)" end
  45.     if pct == 43 then return "Power Bomb (Crateria surface)" end
  46.     if pct == 44 then return "Energy Tank (Crateria gauntlet)" end
  47.     if pct == 45 then return "Missile (Crateria gauntlet left)" end
  48.     if pct == 46 then return "Missile (Crateria gauntlet right)" end
  49.     if pct == 47 then return "Super Missile (green Brinstar bottom)" end
  50.     if pct == 48 then return "Energy Tank (green Brinstar bottom)" end
  51.     if pct == 49 then return "Power Bomb (green Brinstar bottom)" end
  52.     if pct == 50 then return "Missile (pink Brinstar top)" end
  53.     if pct == 51 then return "Power Bomb (pink Brinstar)" end
  54.     if pct == 52 then return "Super Missile (pink Brinstar)" end
  55.     if pct == 53 then return "Energy Tank (pink Brinstar top)" end
  56.     if pct == 54 then return "Missile (pink Brinstar bottom)" end
  57.     if pct == 55 then return "Energy Tank (pink Brinstar bottom)" end
  58.     if pct == 56 then return "Missile (green Brinstar pipe)" end
  59.     if pct == 57 then return "Missile (green Maridia Shinespark)" end
  60.     if pct == 58 then return "Energy Tank (green Maridia)" end
  61.     if pct == 59 then return "Missile (green Maridia turtle room)" end
  62.     if pct == 60 then return "Super Missile (green Maridia)" end
  63.     if pct == 61 then return "Missile (yellow Maridia false wall)" end
  64.     if pct == 62 then return "Super Missile (yellow Maridia)" end
  65.     if pct == 63 then return "Missile (yellow Maridia super missile)" end
  66.     if pct == 64 then return "Missile (pink Maridia)" end
  67.     if pct == 65 then return "Super Missile (pink Maridia)" end
  68.     if pct == 66 then return "Missile (Draygon)" end
  69.     if pct == 67 then return "Space Jump" end
  70.     if pct == 68 then return "Energy tank (Botwoon)" end
  71.     if pct == 69 then return "Missile (right Maridia sand pit room)" end
  72.     if pct == 70 then return "Power Bomb (right Maridia sand pit room)" end
  73.     if pct == 71 then return "Spring Ball" end
  74.     if pct == 72 then return "Plasma Beam" end
  75.     if pct == 73 then return "Reserve Tank (Maridia)" end
  76.     if pct == 74 then return "Missile (left Maridia sand pit room)" end
  77.     if pct == 75 then return "Missile (Kraid)" end
  78.     if pct == 76 then return "Missile (below Ice Beam)" end
  79.     if pct == 77 then return "Missile (Gold Torizo)" end
  80.     if pct == 78 then return "Super Missile (Gold Torizo)" end
  81.     if pct == 79 then return "Screw Attack" end
  82.     if pct == 80 then return "Missile (Mickey Mouse room)" end
  83.     if pct == 81 then return "Power Bomb (above Ridley)" end
  84.     if pct == 82 then return "Energy Tank (Ridley)" end
  85.     if pct == 83 then return "Energy Tank (lower Norfair fire flea room)" end
  86.     if pct == 84 then return "Missile (lower Norfair above fire flea room)" end
  87.     if pct == 85 then return "Power Bomb (lower Norfair above fire flea room)" end
  88.     if pct == 86 then return "Missile (lower Norfair near Wave Beam)" end
  89.     if pct == 87 then return "Missile (bubble Norfair green door)" end
  90.     if pct == 88 then return "Reserve Tank (Norfair)" end
  91.     if pct == 89 then return "Missile (Norfair reserve tank)" end
  92.     if pct == 90 then return "Missile (bubble Norfair)" end
  93.     if pct == 91 then return "X-Ray Scope" end
  94.     if pct == 92 then return "Power Bomb (blue Brinstar)" end
  95.     if pct == 93 then return "Missile (blue Brinstar behind missile)" end
  96.     if pct == 94 then return "Missile (blue Brinstar top)" end
  97.     if pct == 95 then return "Missile (blue Brinstar middle)" end
  98.     if pct == 96 then return "Energy Tank (blue Brinstar)" end
  99.     if pct == 97 then return "Missile (Crateria bottom)" end
  100.     if pct == 98 then return "Super Missile (Crateria middle)" end
  101.     if pct == 99 then return "Missile (Crateria middle)" end
  102.     if pct == 100 then return "Beat the Game!" end
  103. end
  104.  
  105. while true do
  106.     textX = 0
  107.     textY = 190
  108.  
  109.     curHour = memory.readword(0x7e09e0)
  110.     curMin = memory.readword(0x7e09de)
  111.     curSec = memory.readword(0x7e09dc)
  112.     curMil = math.floor(memory.readword(0x7e09da) *100 / 60)
  113.  
  114.     gui.text(textX, textY + 20, "Time: " .. curHour .. ":" .. string.format("%02d",curMin) .. ":" .. string.format("%02d",curSec) .. "." .. string.format("%02d",curMil))
  115.  
  116.     missiles = math.floor(memory.readbyte(0x7e09c8) / 5)
  117.     superMissiles = math.floor(memory.readbyte(0x7e09cc) / 5)
  118.     powerBombs = math.floor(memory.readbyte(0x7e09d0) / 5)
  119.     energyTanks = math.floor((memory.readword(0x7e09c4) - 99) / 100)
  120.     reserveTanks = math.floor(memory.readword(0x7e09d4) / 100)
  121.  
  122.     items = memory.readword(0x7e09a4)
  123.     variaSuit = items % 2
  124.     springBall = math.floor((items % 4) / 2)
  125.     morphBall = math.floor((items % 8) / 4)
  126.     screwAttack = math.floor((items % 16) / 8)
  127.     gravitySuit = math.floor((items % 64) / 32)
  128.     hiJumpBoots = math.floor((items % 512) / 256)
  129.     spaceJump = math.floor((items % 1024) / 512)
  130.     bomb = math.floor((items % 8192) / 4096)
  131.     speedBooster = math.floor((items % 16384) / 8192)
  132.     grappleBeam = math.floor((items % 32768) / 16384)
  133.     xRayScope = math.floor(items / 32768)
  134.  
  135.     weapons = memory.readword(0x7e09a8)
  136.     waveBeam = weapons % 2
  137.     iceBeam = math.floor((weapons % 4) / 2)
  138.     spazerBeam = math.floor((weapons % 8) / 4)
  139.     plasmaBeam = math.floor((weapons % 16) / 8)
  140.     chargeBeam = math.floor((weapons % 8192) / 4096)
  141.  
  142.     pct = missiles + superMissiles + powerBombs + energyTanks + reserveTanks + variaSuit + springBall + morphBall + screwAttack + gravitySuit + hiJumpBoots + spaceJump + bomb + speedBooster + grappleBeam + xRayScope + waveBeam + iceBeam + spazerBeam + plasmaBeam + chargeBeam
  143.     gui.text(textX, textY + 10, "Pct: " .. pct .. "%")
  144.  
  145.     gui.text(textX, textY, "Next Item: " .. GetNextItem(pct))
  146.    
  147.     snes9x.frameadvance()
  148. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement