Posted 26 November 2012 - 12:33 PM
Does anyone know how you can make menus that goto other pages? Like 'Email' would goto a Email Client, etc..
local options = {'Email','Music','Web Browser','Exit'}
local programs = {'email','music','webbrowser'}
while true do
term.clear()
term.setCursorPos(1,1)
print 'Select an Option'
print ''
for i=1, #options do
print(i..'. '..options[i])
end
local _, char = os.pullEvent('char')
local num = tonumber(char)
if num then
if programs[num] then
shell.run(programs[num])
elseif options[num] == 'Exit' then
shell.run('clear')
break
end
end
end
Select an Option
1. Email
2. Music
3. Web Browser
4. Exit