Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function thread1()
- term.clear()
- term.setCursorPos(1,1)
- write (" SteveCell ")
- local time = os.time()
- local formatTime = textutils.formatTime(time, false)
- write (formatTime)
- print ("")
- print ("")
- for i=1,13 do
- write ("-")
- end
- print("")
- print ("1. Clock")
- print ("2. Calender")
- print ("3. Memo")
- print ("4. Shutdown")
- for i=1,13 do
- write ("-")
- end
- print ("")
- print ("")
- write ("Choose an option: ")
- local choice = io.read()
- local choiceValid = false
- if (choice == "1") then
- -- do this
- elseif (choice == "2") then
- -- do that
- elseif (choice == "3") then
- -- do this
- elseif (choice == "4") then
- shell.run("shutdown")
- else
- print ("Choice Invalid")
- os.sleep(2)
- shell.run("mainMenu")
- end
- end
- function thread2()
- localmyTimer = os.startTimer(5)
- while true do
- local event,timerID = os.pullEvent("timer")
- if timerID == myTimer then break end
- end
- return
- end
- parallel.waitForAny(thread1, thread2)
- shell.run("mainMenu")
Advertisement
Add Comment
Please, Sign In to add comment