Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap("top")
- local o = 0
- local code = "32456324"
- m.setTextScale(3)
- m.setTextColor(colors.yellow)
- while o == 0 do
- term.clear()
- term.setCursorPos(1,1)
- print("Bonjour on/off")
- local valEnof = read()
- if valEnof == "on" then
- local f = 0
- m.setBackgroundColor(colors.green)
- m.clear()
- sleep(2)
- m.setCursorPos(1,1)
- m.write("Ferme")
- while f == 0 do
- term.clear()
- term.setCursorPos(1,1)
- print("Bienvenue")
- print("Veuillez entrez le mot de passe pour que la porte s'ouvre.")
- local valEnmdp = read()
- if valEnmdp == code then
- rs.setOutput("back", true)
- m.clear()
- m.setCursorPos(1,1)
- m.write("Ouvert")
- sleep(3)
- rs.setOutput("back", false)
- m.clear()
- m.setCursorPos(1,1)
- m.write("Ferme")
- valEnmdp = 0
- elseif valEnmdp == "off" then
- f = f + 1
- else
- print("mauvais mot de passe")
- end
- end
- elseif valEnof == "off" then
- m.setBackgroundColor(colors.red)
- m.clear()
- term.clear()
- print("OFF")
- read()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement