function send( nRecipient, sMessage ) for n,sSide in ipairs( rs.getSides() ) do if rednet.isOpen( sSide ) then peripheral.call( sSide, "transmit", nRecipient, os.getComputerID(), sMessage ) return true end end error( "No open sides" ) end send(1, "foo") rednet.send(1, "bar")And for some reason, even though my send function code is directly copied from computercrafts source, the send function doesn't get through (I know peripheral.call got executed, yet nothing shows up on the other side) but rednet.send works just fine. Does anyone know why and how to fix it? (My current theory is that the send() function isn't generating a rednet_message event, and therefore rednet.receive() ignores it, but I'm not sure how to fix that)
Rednet.send working, but rednet sending not working...
Started by mrpoopy345, Mar 08 2015 04:11 PM
2 replies to this topic
#1
Posted 08 March 2015 - 04:11 PM
I'm not sure why this is happening, but I am trying to rewrite rednet,send, and this is my (debugging) code:
#2
Posted 08 March 2015 - 06:11 PM
Why do you need to rewrite the function when yours does basically the same thing?
Anyways, your problem is that rednet has its own protocol, so just sending a string won't trigger it.
The original function creates a table with several things, and that's what it looks for.
Anyways, your problem is that rednet has its own protocol, so just sending a string won't trigger it.
The original function creates a table with several things, and that's what it looks for.
Edited by HPWebcamAble, 08 March 2015 - 06:14 PM.
#3
Posted 08 March 2015 - 10:48 PM
Make sure you read the source for rednet.run(). It explains how your modem_message events are supposed to magically turn into rednet_message events.
... assuming you're on CC 1.6 or later.
HPWebcamAble, on 08 March 2015 - 06:11 PM, said:
The original function creates a table with several things, and that's what it looks for.
... assuming you're on CC 1.6 or later.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











