Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- splitter mk2
- by BigSHinyToys
- ]]--
- local tArgs = {...}
- local sSide = {}
- for i,v in pairs(rs.getSides()) do
- sSide[v] = true
- end
- local monSide
- local monBig = false
- local termX,termY = term.getSize()
- local customTerm = {}
- local moniter
- local oldMon = {}
- if #tArgs == 1 then
- if sSide[tArgs[1]] then
- monSide = string.lower(tArgs[1])
- if peripheral.isPresent(monSide) and peripheral.getType(monSide) == "monitor" then
- for size = 1.5,0.5,-0.5 do
- peripheral.call(monSide,"setTextScale",size)
- local monX,monY = peripheral.call(monSide,"getSize")
- if monX >= termX and monY >= termY then
- monBig = true
- break
- end
- end
- end
- elseif string.lower(tArgs[1]) == "restore" then
- term.restore()
- return
- end
- else
- print("USAGE: <side> or \"restore\" ")
- end
- local function wrap( _sFunction )
- return function( ... )
- peripheral.call(monSide,_sFunction,...)
- return oldMon[_sFunction](...)
- end
- end
- if monBig then
- moniter = peripheral.wrap(monSide)
- for k,v in pairs(term.native) do
- oldMon[k] = v
- end
- for k,v in pairs( term.native ) do
- if type( k ) == "string" and type( v ) == "function" then
- customTerm[k] = wrap(k)
- end
- end
- term.redirect(customTerm)
- term.clear()
- term.setCursorPos(1,1)
- print("Running on monitor")
- else
- print("Monitor to small")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement