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

Auto Open Modem?

Started by 3ydney, 22 January 2013 - 05:21 PM
3ydney #1
Posted 22 January 2013 - 06:21 PM
How can I open every modem side using a table?
theoriginalbit #2
Posted 22 January 2013 - 06:23 PM
This uses the function getSides in the redstone (rs) API which returns a table of the sides… it then iterates through and using the peripheral API checks to see if the peripheral is a modem, if it is open the modem…

for _,v in pairs( rs.getSides() ) do
  if peripheral.getType( v ) == "modem" then
	rednet.open( v )
  end
end
3ydney #3
Posted 22 January 2013 - 06:25 PM
Thanks SO much… I was just about to try that!