Operating system for OpenComputers
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

22 行
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