This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
mandisen2's profile picture

Monitor edit

Started by mandisen2, 02 May 2012 - 01:38 PM
mandisen2 #1
Posted 02 May 2012 - 03:38 PM
So normally when i want to make a door with password i would just script it on a computer and voila! But now i want it all on the screen. How do i do so when the computer starts up it turns on the programs startup on the screen?
OmegaVest #2
Posted 02 May 2012 - 05:24 PM
term.redirect(monitor)

This will push all text outputs to the monitor, if you wrap the monitor with monitor = peripheral.wrap(side). term.restore() will bring it back.
mandisen2 #3
Posted 02 May 2012 - 07:10 PM
Im not the best at english XD but i tried the term.redirect(right) and computer lags up with a error. this is what i typed.

term.redirect(right)
print"Hello"
——————————— And non of them worked :S i probbabbly missunderstood something
term.redirect(monitor)
print"Hello"
MysticT #4
Posted 02 May 2012 - 07:23 PM
You have to wrap the monitor peripheral first:

local monitor = peripheral.wrap("side") -- replace with the side of the monitor
term.redirect(monitor) -- redirects the output to the monitor
-- Your code goes here
term.restore() -- restores the output to the computer screen
mandisen2 #5
Posted 02 May 2012 - 07:42 PM
okay it seems i got alot to learn about this XD what do you guys mean with local? otherwise i think i undeerstand everything and it works now guys! thanks!
OmegaVest #6
Posted 02 May 2012 - 08:12 PM
Local means it is only used in that program. Once the program ends, it is forgotten.
mandisen2 #7
Posted 02 May 2012 - 08:21 PM
ok thanks :)/>/>