Posted 02 March 2012 - 09:07 AM
Im very new to lua but have used other programming languages.
Theres a few things i seen people do but dont really know how to implement it into my system.
Im not sure how to add a little selector.
EX: instead of typing 00 to read the "Terminal Password" i have something like this.
>[00]Terminal Password
[01]Mining Reports
[02]New Base of Operations
[03]Energy Project
I tried reading tutorials but its still a little confusing. If someone could show me how to do it with this system it will help me lots in learning.
If you have any ideas on how to improve this further please tell. This is only ment to be a log thing. Kind of like fallout if anyone played it. Its not ment to be an os in any way even knowing it starts up wht the computer.
Thanks in advance :unsure:/>/>
EDIT: some reason it messed up my spaces so i put it on pastebin so the spaces work.
http://pastebin.com/zTc9Rsda
Theres a few things i seen people do but dont really know how to implement it into my system.
Im not sure how to add a little selector.
EX: instead of typing 00 to read the "Terminal Password" i have something like this.
>[00]Terminal Password
[01]Mining Reports
[02]New Base of Operations
[03]Energy Project
I tried reading tutorials but its still a little confusing. If someone could show me how to do it with this system it will help me lots in learning.
If you have any ideas on how to improve this further please tell. This is only ment to be a log thing. Kind of like fallout if anyone played it. Its not ment to be an os in any way even knowing it starts up wht the computer.
term.clear()
print "-------------------------------------------------"
print "| Polraudio's Personal Logs |"
print "-------------------------------------------------"
print"[00]Terminal Password"
print"[01]Mining Reports"
print"[02]New Base of Operations"
print"[03]Energy Project"
print "-------------------------------------------------"
write "Section: "
local status, pass = pcall(read)
if pass == "00" then
term.clear()
print "-------------------------------------------------"
print "| Terminal Password |"
print "-------------------------------------------------"
print "Information Deleted By User"
print ""
print ""
print ""
print ""
print ""
print ""
print ""
print ""
print ""
print ""
print ""
print ""
print " [Press enter to return to main menu]"
local pass = io.read()
if pass == "" then
term.clear()
os.reboot()
end
end
if pass == "01" then
term.clear()
print "-------------------------------------------------"
print "| Mining Reports |"
print "-------------------------------------------------"
print "Today I mined 32 iron in a deep mine under my"
print "house. I got attacked by a zombie on my way out"
print "of the mine. I had to drop all my iron so I could"
print "Run fast enough to outrun the zombie."
print ""
print ""
print ""
print ""
print ""
print ""
print ""
print ""
print ""
print " [Press enter to return to main menu]"
local pass = io.read()
if pass == "" then
term.clear()
os.reboot()
end
end
if pass == "02" then
term.clear()
print "-------------------------------------------------"
print "| New Base of Operations |"
print "-------------------------------------------------"
print "I have moved out of my home into a new base in"
print "the mountain up north. I will be studying new"
print "ways to produce energy to power my technology."
print ""
print ""
print ""
print ""
print ""
print ""
print ""
print ""
print ""
print ""
print " [Press enter to return to main menu]"
local pass = io.read()
if pass == "" then
term.clear()
os.reboot()
end
end
if pass == "03" then
term.clear()
print "-------------------------------------------------"
print "| Energy Project |"
print "-------------------------------------------------"
print "I have discovered a new type of energy that has"
print "the power output to power 10 cities all at once."
print ""
print "I ran into one problem once i discovered this new"
print "type of energy. I couldnt find a way to get it"
print "stable enough to be safe. I had to flee the area."
print "After i left the area my base exploded and made"
print "the mountain into...well....lets just say its not"
print "a mountain anymore....."
print ""
print ""
print ""
print ""
print " [Press enter to return to main menu]"
local pass = io.read()
if pass == "" then
term.clear()
os.reboot()
end
end
if pass == "shutdown" then
os.shutdown()
else
os.reboot()
end
Thanks in advance :unsure:/>/>
EDIT: some reason it messed up my spaces so i put it on pastebin so the spaces work.
http://pastebin.com/zTc9Rsda