Advertisement
Muzze77

PW Kraftwerk

Apr 3rd, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. password = "Kraftwerk"
  2. side = "left"
  3.  
  4.  
  5. while true do
  6.    
  7.    
  8.     function password1()
  9.     shell.run("clear")
  10.     sleep(0.03)
  11.     print("Bitte Password eingeben: ")
  12.     term.setCursorPos(25, 1)
  13.     pw = read("*")
  14.     if pw == password then
  15.     rs.setOutput(side, true)
  16.     sleep(5)
  17.     rs.setOutput(side, false)
  18.     else
  19.     print("Falsche Eingabe")
  20.     sleep(0.1)
  21.     startup()
  22.     end
  23.     end
  24.    
  25.     function startup()
  26.             term.setTextColor(colors.red)
  27.         shell.run("clear")
  28.         sleep(0.01)
  29.         print("W-Taste zum fortfahren.")
  30.         local evt, key = os.pullEvent("char")
  31.         key = string.lower(key)
  32.         if key == "w" then
  33.         password1()
  34.         else
  35.         startup()
  36.         end
  37.     end
  38.     startup()
  39.     sleep(0.1)
  40.  
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement