Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local nativeTerm = term.native or term
- local function invoke(sMethod, ...)
- nativeTerm[sMethod](...)
- for k,sSide in pairs(redstone.getSides()) do
- if peripheral.isPresent(sSide) and peripheral.getType(sSide) == "monitor" then
- peripheral.call(sSide, sMethod, ...)
- end
- end
- end
- local tArgs = { ... }
- if #tArgs > 1 then
- print( "Usage: dual_monitors [-d|--disable]" )
- return
- end
- if tArgs[1] == "-d" or tArgs[1] == "--disable" then
- os.unloadAPI("/rom/apis/term")
- os.loadAPI("/rom/apis/term")
- term.clear()
- term.setCursorPos(1, 1)
- print(os.version())
- else
- term.write = function(text) invoke("write", text) end
- term.scroll = function(n) invoke("scroll", n) end
- term.setCursorPos = function(x, y) invoke("setCursorPos", x, y) end
- term.setCursorBlink = function(:o/>/> invoke("setCursorBlink", :o/>/> end
- term.clear = function() invoke("clear") end
- term.clearLine = function() invoke("clearLine") end
- term.clear()
- term.setCursorPos(1, 1)
- print(os.version())
- end
Advertisement
Add Comment
Please, Sign In to add comment