User File #638647875242576583

Upload All User Files

#638647875242576583 - [NES] Saint Seiya Ougon Densetsu - Lua Script for RTA Running

Saint Seiya - Ougon Densetsu (J) [!].lua
8 downloads
Uploaded 18 days ago by eien86 (see all 94)
This Lua script shows the pending fights, which one is the next fights, and which menu option is selected. This is meant to help RTA runners
fightNames = {
	"Marin",
	"Cassios 1",
	"Shiryu",
	"Hyoga",
	"Shun",
	"Black Phoenix 1",
	"Unknown",
	"Black Pegasus",
	"Black Cygnus",
	"Black Dragon",
	"Black Phoenix 2",
	"Ikki",
	"Docrates 1",
	"Docrates 2",
	"Auriga Capella",
	"Cerberus Dante",
	"Lizard Misty",
	"Centaurus Babel",
	"Crow Jamian",
	"Leo Aiolia",
	"Shaina",
	"Cassios 2",
	"Lizard Misty 2",
	"Centaurus Babel 2",
	"Whale Moses",
	"Docrates 3",
	"Hound Asterion",
	"Algol",
	"Taurus Aldebaran",
	"Gemini",
	"Cancer Deathmask",
	"Scorpio Milo",
	"Virgo Shaka",
	"Gemini 2",
	"Shadow",
}


-- This template lives at `.../Lua/.template.lua`.
while true do
	-- Code here will run once when the script is loaded, then after each emulated frame.
	emu.frameadvance();

	gui.drawString(0, 2, "Fights: ", nil, "black", 10)
    
    nextFightIdx = -1
	for idx=0,34,1
	do
	  val = memory.read_u8(0x06D1 + idx)
	  symbol = "."
	  if val > 1 then 
        symbol = "X"
      else
        if nextFightIdx == -1 then nextFightIdx = idx end
      end
	  gui.drawString(50 + idx * 5, 6, symbol, nil, "black", 7)
	end

    nextFightName = "None"
    if nextFightIdx >= 0 then
      nextFightName = fightNames[nextFightIdx + 1]
    end
    
    menuType = memory.read_u8(0x0026)

	if menuType ~= 26 then
	   gui.drawString(2, 212, "Next Fight: " .. nextFightName , nil, "black", 10)
	end
	
	menuItem = memory.read_u8(0x00C8)
	if menuType == 26 then
	   gui.drawString(2, 210, "Menu Option: " .. tostring(menuItem), nil, "black", 10)
	end

end