Darknio

Timer mit Uhr

Mar 13th, 2015
641
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. local schalterSide = "right"
  2. local clockAusgang = "bottom"
  3. local LampenSide = "top"
  4.  
  5.  
  6.  
  7.  
  8. local timer = "an"
  9. function Clock()
  10. if rs.getInput("schalterSide") == true then
  11. timer = "an"
  12. rs.setOutput("clockAusgang",true)
  13. sleep(0.5)
  14. rs.setOutput("clockAusgang",false)
  15. else
  16. timer = "aus"
  17. end
  18.  
  19. sleep(1)
  20. end
  21.  
  22.  
  23.  
  24.  
  25. function Time()
  26. if timer == "an" then
  27. rs.setOutput("LampenSide",true)
  28. else
  29. rs.setOutput("LampenSide",false)
  30. end
  31. shell.run("clear")
  32. print(textutils.formatTime(os.time(), true))
  33. print("Timer ",timer)
  34. sleep(1)
  35. end
  36.  
  37.  
  38.                    
  39.     while true do
  40.     parallel.waitForAny(Time,Clock)
  41.     end
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment