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

Monitors?

Started by TGG, 03 July 2012 - 11:16 PM
TGG #1
Posted 04 July 2012 - 01:16 AM
Hello, I am very new to Computer Craft, and I want to know a few things. one thing.
I don't know how to program, I was planning to get to that tomorrow, but I want to know how to post a message on a monitor. Whenever I try, it just comes up with a bunch of code and mumbo-jumbo that I don't (and won't) understand (until tomorrow). Could someone help me? I know how to create programs and such, I just need the way to make text appear on monitors.
MysticT #2
Posted 04 July 2012 - 01:39 AM
Well, you need to make a program that does it, so…
Anyway, you can use the monitor program to run a program on a monitor:
> monitor <side> <program>
Otherwise, you need to create a program and redirect the terminal output to the monitor before printing the text on the screen.
tfoote #3
Posted 04 July 2012 - 01:39 AM
to use a monitor you must first have a program then use this.
> monitor [side] [program]

for example in the computer you must type this program to run that program on your computer…
so i created program x…
my monitor is on the top…
so i run program…
monitor top x


or check out the term api so that you can redirect the output to the monitor
TGG #4
Posted 04 July 2012 - 01:59 AM
Yes, all of this I know, making the program is the hard part for me. I know how to display it.
TGG #5
Posted 04 July 2012 - 02:12 AM
I need to know what the program (words?) are for the program to display text on the monitors. I'm not a programmer so don't judge me on my computer vocabulary. :P/>/>
MysticT #6
Posted 04 July 2012 - 02:38 AM

local monitorSide = "<side>" -- the side the monitor is on

if peripheral.isPresent(monitorSide) and peripheral.getType(monitorSide) == "monitor" then
  term.redirect(peripheral.wrap(monitorSide))
else
  print("Monitor not found")
  return
end

-- Your code here

term.restore()

I'm tired of copying the same code, there's like 10 posts about the same thing.
Please search on the forum before posting (this is for everyone, not just you).