Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Computercraft Door System by DerMarten
- ------ Variablen -------------------------
- local doorSide = "right"
- local password = "1235"
- local input = ""
- local accept = false
- local run = true
- ------------------------------------------
- ------ Functionen ------------------------
- function readInput()
- shell.run("clear")
- write("Passwort: ")
- input = io.read()
- end
- function checkPassword()
- if input == password then
- accept = true
- else
- accept = false
- end
- end
- function doDoor()
- rs.setOutput(doorSide,accept)
- end
- ------------------------------------------
- ----------- Main -------------------------
- function main()
- while run do
- readInput()
- checkPassword()
- doDoor()
- end
- end
- main()-- Programm Starten
Advertisement
Add Comment
Please, Sign In to add comment