Advertisement
Maksandra

Untitled

Apr 4th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. local function status(msg)
  2. if gpu and screen then
  3. gpu.set(1, y, msg)
  4. if y == h then
  5. gpu.copy(1, 2, w, h - 1, 0, -1)
  6. gpu.fill(1, h, w, 1, " ")
  7. else
  8. y = y + 1
  9. end
  10. end
  11. -- boot can be slow in some environments, protect from timeouts
  12. if uptime() - last_sleep > 1 then
  13. local signal = table.pack(pull(0))
  14. -- there might not be any signal
  15. if signal.n > 0 then
  16. -- push the signal back in queue for the system to use it
  17. computer.pushSignal(table.unpack(signal, 1, signal.n))
  18. end
  19. last_sleep = uptime()
  20. end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement