Jump to content




Wired Peripherals?

networking peripheral computer

4 replies to this topic

#1 mitterdoo

  • Members
  • 30 posts
  • LocationOregon, United States

Posted 17 March 2013 - 11:12 AM

As seen in the picture below, a monitor has text written on it without a computer besides it.
Posted Image

How is this pulled off? I can't use
mon=peripheral.wrap("right")
mon.write("Hello, world!")
because it calls nil. I can't use
modem.callRemote("right","write","Hello, world!")
because I don't know the parameters. Can we have some editors edit the wiki so we can actually know these?But for the moment, how do I pull this off?

#2 OmegaVest

  • Members
  • 436 posts

Posted 17 March 2013 - 12:20 PM

First, make sure you have "connected" the modem to the peripheral and computer. That took me a moment to figure out. Note the name it tells you, because that will become important very shortly.
Second, wrap your modem. This will reveal a list of functions, obviously.
Third, use modem.getMethodsRemote(peripheral_name).
Fourth, use callRemote(peripheral_name, function_name).

So, write would be used like this:
modem = peripheral.wrap("right")
modem.callRemote("monitor_0", "write", "Hello, World!")

Supposing the name is correct.


Also, I just noticed you can grab the names into a table using getNamesRemote. And I think there is a way to wrap them, but I'm not entirely sure how yet.


EDIT: YEP! Can wrap! Just use the remote name as the side!

#3 mitterdoo

  • Members
  • 30 posts
  • LocationOregon, United States

Posted 17 March 2013 - 12:45 PM

View PostOmegaVest, on 17 March 2013 - 12:20 PM, said:

First, make sure you have "connected" the modem to the peripheral and computer. That took me a moment to figure out. Note the name it tells you, because that will become important very shortly.
Second, wrap your modem. This will reveal a list of functions, obviously.
Third, use modem.getMethodsRemote(peripheral_name).
Fourth, use callRemote(peripheral_name, function_name).

So, write would be used like this:
modem = peripheral.wrap("right")
modem.callRemote("monitor_0", "write", "Hello, World!")

Supposing the name is correct.


Also, I just noticed you can grab the names into a table using getNamesRemote. And I think there is a way to wrap them, but I'm not entirely sure how yet.


EDIT: YEP! Can wrap! Just use the remote name as the side!
Thank you very much.

#4 OmegaVest

  • Members
  • 436 posts

Posted 17 March 2013 - 01:02 PM

Also, I didn't know this, so I had to look in the zip's directory, but apparently if you typ help <peripherals>, you can get their "full" apis. Make sure the peripheral is plural, ie help printers, or help modems.

#5 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 17 March 2013 - 02:03 PM

Why overcomplicate things? The peripheral API works with remote peripherals fine. peripheral.getNames() returns peripherals attached.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users