Stolar228

lockdoor.lua

Apr 14th, 2018
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. local term = require("term")
  2. local component = require("component")
  3. local sides = require("sides")
  4. local rs=component.redstone
  5. local gpu = component.gpu
  6. local rs = component.redstone
  7. local pas
  8. local pasr
  9.   term.clear()
  10.   print("введите новый пароль")
  11.   pasr = io.read()
  12.   gpu.setResolution(15,4)
  13.   while true do
  14.   term.clear()
  15.   print("введите пароль")
  16.   pas = io.read()
  17.   if pas == pasr then
  18.     print("открыто")
  19.     rs.setOutput(1,15)
  20.     os.sleep(2)
  21.     rs.setOutput(1,0)
  22.   else
  23.     term.clear()
  24.     print("введите пароль")
  25.     print("error")
  26.     os.sleep(1)
  27.   end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment