Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local redirect = {}
- local current = term.current()
- local monitor = peripheral.wrap("right")
- for k in pairs(current) do
- -- Get the function for both the current terminal and the monitor object
- local curFunc, monFunc = current[k], monitor[k]
- redirect[k] = function(...)
- -- Call both, but only return the value for the current one (so term.getSize/term.getCursorPos/term.getColor return for the main terminal)
- monFunc(...)
- return curFunc(...)
- end
- end
- term.redirect(redirect)
Add Comment
Please, Sign In to add comment