Guest User

Untitled

a guest
Oct 27th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. local redirect = {}
  2. local current = term.current()
  3. local monitor = peripheral.wrap("right")
  4. for k in pairs(current) do
  5. -- Get the function for both the current terminal and the monitor object
  6. local curFunc, monFunc = current[k], monitor[k]
  7. redirect[k] = function(...)
  8. -- Call both, but only return the value for the current one (so term.getSize/term.getCursorPos/term.getColor return for the main terminal)
  9. monFunc(...)
  10. return curFunc(...)
  11. end
  12. end
  13. term.redirect(redirect)
Add Comment
Please, Sign In to add comment