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

Adv. Computer to Monitor Network Connection

Started by Jman, 08 December 2013 - 10:46 AM
Jman #1
Posted 08 December 2013 - 11:46 AM
Okay so I am trying to connect my advanced computer to a set of monitors that I have connected via network cable, I think I have pretty much figured out how to get them connected. But however, I can not figure out how to get my computer to send the text on my countdown program to the three monitors simultaneously. When I try to send my program through the wire to the monitors, I just get a message stating there is no monitors in the back of my computer. I would paste the code I have but it is all jumbled up and makes no sense so I trashed it and decided to try and start fresh. Oh and the reason I am asking this is because I can't find a tutorial or vid or similar asked question that can help me figure it out on my own, if any exist they must be buried pretty deep. I'd appreciate the help thanks.
Kingdaro #2
Posted 08 December 2013 - 11:53 AM
This is actually relatively simple to do. First, you'll want to get the identifiers for all of the monitors you have connected through the modem:

--# assuming your modem is on the back
local monitorNames = peripheral.call('back', 'getNames')

Then you'll just loop through these identifiers, or "names", and do as you please using each one to grab their respective monitors.

for i=1, #monitorNames do
   local monitor = peripheral.wrap(monitorNames[i])

   --# example
   drawCountdownOn(monitor)
end
Edited on 08 December 2013 - 10:53 AM