Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local instruments = {
- "gedeckt",
- "diapason",
- "vox_humana",
- "trompette",
- "gamba",
- "posaune",
- "subbass",
- "piccolo",
- "nassard",
- "steam_whistle"
- }
- local function printMenu()
- term.clear()
- term.setCursorPos(1,1)
- print("=== Set Instrument ID ===\n")
- for i, name in ipairs(instruments) do
- print(i .. ") " .. name)
- end
- print("\nChoose an instrument by number:")
- end
- local function saveInstrument(selected)
- local f = fs.open("instrument.txt", "w")
- f.write(instruments[selected])
- f.close()
- end
- -- Main
- printMenu()
- local input = read()
- local choice = tonumber(input)
- if choice and instruments[choice] then
- saveInstrument(choice)
- print("\nInstrument set to: " .. instruments[choice])
- else
- print("\nInvalid selection.")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement