_DudeWhat_

Monitor Test

Jul 28th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1. local monitors = {peripheral.find("monitor")}  -- "find" needs CC 1.6 or later
  2.  
  3. local multiTerm = {}
  4. for funcName,_ in pairs(monitors[1]) do
  5.         multiTerm[funcName] = function(...)
  6.                 for i=1,#monitors-1 do monitors[i][funcName](unpack(arg)) end
  7.                 return monitors[#monitors][funcName](unpack(arg))
  8.         end
  9. end
  10. term.redirect(multiTerm)
  11.  
  12. term.clear()
  13. term.setCursorPos(1,1)
  14. print("Hello world!")
Add Comment
Please, Sign In to add comment