Advertisement
adolf01

LUA CC open door

Jan 7th, 2014
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. local function clear(c)
  2. redstone.setOutput(c, true)
  3. end
  4. local function set(c)
  5. redstone.setOutput(c, false)
  6. end
  7. local function restart()
  8. os.reboot()
  9. end
  10.  
  11. local function main()
  12. heslo1 = "123"
  13. heslo2 = "5805"
  14. while pristup == 0 do
  15. write("Zadejte heslo: ")
  16. zadani = read()
  17. if (zadani == heslo1) then
  18. set("left")
  19. print("Dekuji, cesta je volna")
  20. sleep(5)
  21. clear("left")
  22. elseif (zadani == heslo2) then
  23. set("left")
  24. pristup = 1
  25. else print("Zadáno špatné heslo")
  26. end
  27. end
  28. end
  29.  
  30.  
  31. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement