Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Door

DerMarten May 3rd, 2015 (edited) 224 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. -- Computercraft Door System by DerMarten
  2. ------ Variablen -------------------------
  3. local doorSide = "right"
  4. local password = "1235"
  5. local input = ""
  6. local accept = false
  7. local run = true
  8. ------------------------------------------
  9. ------ Functionen ------------------------
  10. function readInput()
  11.         shell.run("clear")
  12.         write("Passwort: ")
  13.         input = io.read()
  14. end
  15. function checkPassword()
  16.         if input == password then
  17.                 accept = true
  18.         else
  19.                 accept = false
  20.         end
  21. end
  22. function doDoor()
  23.         rs.setOutput(doorSide,accept)
  24. end
  25. ------------------------------------------
  26. ----------- Main -------------------------
  27. function main()
  28.         while run do
  29.                 readInput()
  30.                 checkPassword()
  31.                 doDoor()
  32.         end
  33. end
  34. main()-- Programm Starten
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top