Guest User

startup

a guest
Aug 21st, 2014
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. local side = "right"
  2. local password = "crepes"
  3. local sirenoff = "tgif"
  4. local opentime = 4
  5. local siren = "bottom"
  6. while true do
  7.  term.clear()
  8.  term.setCursorPos(1,1)
  9.  write("Password: ")
  10.  local input = read("*")
  11.  if input == password then
  12.   term.clear()
  13.   term.setCursorPos(1,1)
  14.   print("Password correct!")
  15.   rs.setOutput(side,true)
  16.   rs.setOutput(siren,false)
  17.   sleep(opentime)
  18.   rs.setOutput(side,false)
  19.  elseif input == sirenoff then
  20.   term.clear()
  21.   term.setCursorPos(1,1)
  22.   print("Turning off siren.")
  23.   rs.setOutput(siren,false)
  24.  else
  25.   print("Password incorrect!")
  26.   rs.setOutput(siren,true)
  27.   sleep(2)
  28.  end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment