Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- CCPresenter by TheOriginalBIT
- Version 1.0
- First Created: 22 March 2013
- Last Updated: 22 March 2013
- Inspired by, and continuation of: http://www.computercraft.info/forums2/index.php?/topic/11003-remote-presentation/
- ]]
- --error without line numbers and stuff
- local function nonVerboseError(msg)
- printError(msg)
- error()
- end
- -- make a copy of term
- if not term.done then
- oldTerm = {}
- for k,v in pairs(term) do
- oldTerm[k] = v
- end
- term.done = true
- end
- local function findPeripheral( t )
- for _,s in pairs(rs.getSides()) do
- if peripheral.getType(s) == t then
- return s
- end
- end
- nonVerboseError('No '..t..' attached to the computer')
- end
- rednet.open( findPeripheral( 'modem' ) )
- local function writePacket(method, ...)
- oldTerm[method]( ... )
- local msg = method..':'..table.concat( {...}, ':' )
- rednet.broadcast(msg)
- end
- term.write = function( ... ) writePacket('write', ...) end
- term.setBackgroundColor = function( c ) writePacket('setBackgroundColor', c) end
- term.setTextColor = function( c ) writePacket('setTextColor', c) end
- term.setCursorPos = function(x, y) writePacket('setCursorPos', x, y) end
- term.setCursorBlink = function( b ) writePacket('setCursorBlink', b) end
- term.clear = function() writePacket("clear") end
- term.clearLine = function() writePacket("clearLine") end
- term.scroll = function(n) writePacket('scroll', n) end
- term.done = true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement