Advertisement
DerMarten

Door Door

Jul 27th, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. ------------------------------
  2. -- Programm für ein Trottel --
  3. ------------------------------
  4. pin = "1235"
  5. puk = "5321"
  6. opentime = 5
  7. rsSide = "bottom"
  8. local pullEvent = os.pullEvent
  9. --os.pullEvent = os.pullEventRaw
  10. ------------------------------
  11. run = true
  12. door = false
  13. ------------------------------
  14. while run do
  15.     shell.run("clear")
  16.     write("Passwort: ")
  17.     rs.setOutput(rsSide, true)
  18.     event,side,x,y = os.pullEvent()
  19.     if event == "terminate" then
  20.         if io.read() == puk then
  21.             write("Richtig! Mache jetzt nochmal STRG + T fuer 4 sec. Du hast 6 sec Zeit.")
  22.             sleep(6)
  23.         end
  24.     end
  25.     if io.read() == pin then
  26.         rs.setOutput(rsSide, false)
  27.         sleep(opentime)
  28.     end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement