screenblank works with the new rc system now, rejoyce
This commit is contained in:
parent
9eec6bf193
commit
67de47ebd4
@ -1,21 +1,25 @@
|
|||||||
local lastkey = computer.uptime()
|
local lastkey = computer.uptime()
|
||||||
local state = true
|
local state = true
|
||||||
local delay = 60
|
local delay = 60
|
||||||
while true do
|
function start()
|
||||||
tEv = {coroutine.yield()}
|
return os.spawn(function()
|
||||||
if tEv[1] == "key_down" then
|
while true do
|
||||||
lastkey = computer.uptime()
|
tEv = {coroutine.yield()}
|
||||||
if not state then
|
if tEv[1] == "key_down" then
|
||||||
for addr in component.list("screen") do
|
lastkey = computer.uptime()
|
||||||
component.invoke(addr,"turnOn")
|
if not state then
|
||||||
|
for addr in component.list("screen") do
|
||||||
|
component.invoke(addr,"turnOn")
|
||||||
|
end
|
||||||
|
state = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if computer.uptime() > lastkey + delay and state then
|
||||||
|
for addr in component.list("screen") do
|
||||||
|
component.invoke(addr,"turnOff")
|
||||||
|
end
|
||||||
|
state = false
|
||||||
end
|
end
|
||||||
state = true
|
|
||||||
end
|
end
|
||||||
end
|
end,"screenblank")
|
||||||
if computer.uptime() > lastkey + delay and state then
|
|
||||||
for addr in component.list("screen") do
|
|
||||||
component.invoke(addr,"turnOff")
|
|
||||||
end
|
|
||||||
state = false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user