Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = "mitchel2010"
- y = "minecraft1992"
- local program = 0
- local i = 1
- local doorMenu = 0
- function lightC()
- if true then
- lightcontrol = 0
- term.clear()
- term.setCursorPos(1,4)
- print("Light Control Menu")
- print("...................")
- os.sleep(1)
- term.setCursorPos(1,7)
- print("hallLightOn")
- print("hallLightOff")
- print("backToMenu")
- write("select: ")
- lightcontrol = read()
- end
- if lightcontrol == "hallLightOn" then
- rs.setOutput("top", true)
- os.sleep(0.2)
- rs.setOutput("top", false)
- os.sleep(0.2)
- rs.setOutput("top", true)
- lightC()
- elseif lightcontrol == "hallLightOff" then
- rs.setOutput("top", false)
- lightC()
- elseif lightcontrol == "backToMenu" then
- mainMenu()
- end
- end
- function doorC()
- if true then
- term.clear()
- term.setCursorPos(1,1)
- print("openDoors")
- os.sleep(1)
- print("backToMenu")
- write = ("Please Select Program")
- doorMenu = read()
- end
- if doorMenu == "openDoors" then
- print("Opening Doors... standby")
- os.sleep(2)
- doorSystem()
- elseif doorMenu == "backToMenu" then
- print("Back To Menu")
- os.sleep(3)
- mainMenu()
- end
- end
- function mainMenu()
- program = 0
- if true then
- term.clear()
- term.setCursorPos(1,4)
- print("Main Menu")
- print(".........")
- os.sleep(2)
- term.setCursorPos(1,7)
- print("openDoors")
- os.sleep(1)
- print("lights")
- os.sleep(1)
- print("logout")
- os.sleep(1)
- write("Please Select Program: ")
- program = read()
- end
- if program == "openDoors" then
- print("please standby doors are opening...")
- os.sleep(3)
- rs.setOutput("back", true)
- os.sleep(10)
- print("doors are closing")
- os.sleep(3)
- rs.setOutput("back", false)
- mainMenu()
- elseif program == "lights" then
- -- print("lightControl Works!")
- lightC()
- elseif program == "logout" then
- password()
- else
- print("invalid program")
- mainMenu()
- end
- end
- 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
- end
- password()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement