Hi Guys!
I am currently programming a router program for ComputerCraft and i have a wired modem and a wireless modem. How do i only receive messages with the wireless modem and send the received message across the wired modem network.
Thanks!
How to only send a rednet message on a certain modem
Started by houseofkraft, Sep 27 2016 11:26 PM
4 replies to this topic
#1
Posted 27 September 2016 - 11:26 PM
#2
Posted 27 September 2016 - 11:34 PM
When you call rednet.send() or rednet.receive(), all open modems are used. So it's simply a case of rednet.open()ing the wired modem and rednet.close()ing the wireless before sending, and vice versa before receiving.
#3
Posted 27 September 2016 - 11:48 PM
Well if i close off the wired modem and only keep the wireless modem on then how will i be able to upload data because only the download portion will be active if i do that
Is there a way i can make a custom rednet API or something to only use the selected modem side or something
Is there a way i can make a custom rednet API or something to only use the selected modem side or something
Edited by houseofkraft, 27 September 2016 - 11:49 PM.
#4
Posted 27 September 2016 - 11:52 PM
As mentioned, invert the modem states.
rednet.open("yourWirelessModem")
rednet.close("yourWiredModem")
local sender, message, protocal = rednet.receive()
rednet.open("yourWiredModem")
rednet.close("yourWirelessModem")
rednet.send(target, message)
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











