added a timeout to event.pull
This commit is contained in:
parent
08a94c879b
commit
f736810fc3
@ -61,8 +61,10 @@ do -- so local works
|
|||||||
return eq[tT[cT].ep - 1]
|
return eq[tT[cT].ep - 1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function event.pull(t) -- return or wait for the next event, optionally with the first param matching t
|
function event.pull(t,time) -- return or wait for the next event, optionally with the first param matching t
|
||||||
while true do
|
time = time or math.huge
|
||||||
|
time = time + computer.uptime()
|
||||||
|
while computer.uptime() < time do
|
||||||
local e = event.get()
|
local e = event.get()
|
||||||
if e then
|
if e then
|
||||||
if t then
|
if t then
|
||||||
|
Loading…
Reference in New Issue
Block a user