Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function newMenu()
- term.setCursorPos(1,1)
- print("Please make your selection now")
- term.setCursorPos(1,9)
- write("Selection: ")
- end
- function selection()
- print("1. Selection1")
- print("2. Selection2")
- --you can add more selections if you want
- term.setCursorPos(11,9) -- Resets the cursor back to the end of the selection line. Can be changed to any cursor position.
- end
- -- Now, the actual code
- term.clear()
- newMenu()
- selection()
- local input = read() --can add (*) if using passwords
- if input == "1" then --can also be anything else to designate the selection
- -- Do stuff here
- elseif input == "2" then
- --Do other stuff here
- else
- print("INVALID SELECTION. PLEASE TRY AGAIN")
- sleep(1)
- os.reboot() --only necessary if using this as a startup code.
- end
Add Comment
Please, Sign In to add comment