Operating system for OpenComputers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
469B

  1. local lastkey = computer.uptime()
  2. local state = true
  3. local delay = 60
  4. while true do
  5. tEv = {coroutine.yield()}
  6. if tEv[1] == "key_down" then
  7. lastkey = computer.uptime()
  8. if not state then
  9. for addr in component.list("screen") do
  10. component.invoke(addr,"turnOn")
  11. end
  12. state = true
  13. end
  14. end
  15. if computer.uptime() > lastkey + delay and state then
  16. for addr in component.list("screen") do
  17. component.invoke(addr,"turnOff")
  18. end
  19. state = false
  20. end
  21. end