Posted 20 March 2012 - 04:39 PM
A special version of the 'monitor' program. This version will write everything on the monitor IN CAPITAL LETTERS! Works with any program!
Running adventure on the monitor:
You might think: what is the point of this? Well, not very much. It was more to show that it is possible to redirect the terminal to other objects than 'actual' monitors. And maybe send it over redstone in the future!
Running adventure on the monitor:
You might think: what is the point of this? Well, not very much. It was more to show that it is possible to redirect the terminal to other objects than 'actual' monitors. And maybe send it over redstone in the future!
function printUsage()
print( "Usage: monitor <side> <program> <arguments>" )
return
end
local tArgs = { ... }
if #tArgs < 2 then
printUsage()
return
end
sSide = tArgs[1]
if peripheral.getType( sSide ) ~= "monitor" then
print( "No monitor on "..sSide.." side" )
return
end
local sProgram = tArgs[2]
local sPath = shell.resolveProgram( sProgram )
if sPath == nil then
print( "No such program: "..sProgram )
return
end
print( "SCREAMING "..sProgram.." ON "..sSide.." MONITOR!" )
local monitor = peripheral.wrap( sSide )
monitor.write = function(tekst) peripheral.call(sSide,"write",string.upper(tekst)) end
monitor.clear()
monitor.setCursorPos(1,1)
term.redirect( monitor )
shell.run( sProgram, select( 3, ... ) )
term.restore()