Advertisement
Redxone

[CC - Multiterm] Credits: BombBloke

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