Guest User

Untitled

a guest
Nov 7th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.35 KB | None | 0 0
  1. function sleep(t)
  2.   local exitTime = computer.uptime() + (t or 0)
  3.   local events = {}
  4.   repeat
  5.     local d = {computer.pullSignal(exitTime - computer.uptime())}
  6.     if d[1] ~= nil then
  7.       events[#events+1] = d
  8.     end
  9.   until computer.uptime() >= exitTime
  10.   for i = 1, #events do
  11.     computer.pushSignal(table.unpack(events[i]))
  12.   end
  13. end
Advertisement
Add Comment
Please, Sign In to add comment