Jump to content




I need help making a wired modem send signals to multiple mon


  • You cannot reply to this topic
6 replies to this topic

#1 AnDwHaT5

  • Members
  • 244 posts

Posted 22 March 2013 - 11:35 AM

Its in the name i want to add more then one monitor to my program. I tryed
hi = { 1, 2, 3, 4 }
local mon = peripheral.wrap("monitor_" ..hi)

but it didnt work. I could use some help btw what i am doing is a huge powerpoint presentation and i need mon.write all over so i need it on more then one mon.

#2 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 22 March 2013 - 11:50 AM

Try this (untested):
local tWrap = { peripheral.wrap('right'),  peripheral.wrap('left'), --etc.. 
}

for i = 1, #tWrap do
  mon = tWrap[i]
  mon.write('hi')
end


#3 AnDwHaT5

  • Members
  • 244 posts

Posted 22 March 2013 - 11:51 AM

yes but i have 4 monitors which are 1,2,3, and 4 in there wired modem how will that help?

#4 AnDwHaT5

  • Members
  • 244 posts

Posted 22 March 2013 - 11:54 AM

ahh let me be more specific in one cable

#5 AnDwHaT5

  • Members
  • 244 posts

Posted 22 March 2013 - 12:02 PM

I figured it out i used and and added more them one together i will make a tutorial.

#6 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 22 March 2013 - 12:03 PM

View PostAnDwHaT5, on 22 March 2013 - 12:02 PM, said:

I figured it out i used and and added more them one together i will make a tutorial.
Or you can show the current code, im wondering now ^^

#7 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 22 March 2013 - 12:21 PM

To get and write to multiple monitors through a modem, it's usually best to use modem.getNamesRemote.

local modem = peripheral.wrap('back') -- wrap whichever modem on your computer is connecting your monitors
local names = modem.getNamesRemote()

for i=1, #names do
  local mon = peripheral.wrap(names[i])

  -- your drawing operations
end

And I'll go ahead and point to the NetGroup API I have linked in my signature, that'll probably help you out a bit if you don't feel like looping through the peripherals yourself.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users