Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = "mitchel2010"
- y = "minecraft1992"
- local program = {doorControl = 1,lightControl = 2,logout = 6}
- local i = 1
- local doorMenu = {openDoor = 1, BackToMenu = 2}
- function password()
- term.clear()
- term.setCursorPos(1,1)
- if x ~= 0 then
- write("Enter User Name: ")
- user = read()
- term.clear()
- write("Enter Password: ")
- pass = read()
- if user == x and pass == y then
- print("loging in... please standby")
- os.sleep(3)
- print("login Succesful")
- os.sleep(3)
- mainMenu()
- else
- print("loging in... please standby")
- os.sleep(3)
- print("login failed.. please try again")
- os.sleep(3)
- password()
- end
- end
- function mainMenu()
- term.clear()
- term.setCursorPos(1,1)
- if x == 0 then
- print("doorControl")
- os.sleep(1)
- print("lightControl")
- os.sleep(1)
- print("login")
- write("Please Select Program: ")
- program = read()
- end
- if program == 1 then
- print("doorControl Works!")
- --doorC()
- elseif program == 2 then
- print("lightControl Works!")
- --lightC()
- elseif program == 6 then
- password()
- else
- print("invalid program")
- mainMenu()
- end
- end
- end
- function doorC()
- term.clear()
- term.setCursorPos(1,1)
- print("openDoors")
- os.sleep(1)
- print("backToMenu")
- write = ("Please Select Program")
- doorMenu = read()
- while doorMenu > 10 do
- if doorMenu == 1 then
- print("Opening Doors... standby")
- os.sleep(2)
- doorSystem()
- elseif doorMenu == 2 then
- print("Back To Menu")
- os.sleep(3)
- mainMenu()
- end
- end
- end
- password()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement