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

Please help, I cant find anything on this

Started by Sup3rNinj4z, 08 June 2015 - 01:43 PM
Sup3rNinj4z #1
Posted 08 June 2015 - 03:43 PM
So I wanted to make a little server to send things to separate computers, like a normal router. But I want to define my own parameters instead of using the default ones that come with "modem_message". so instead of just event, senderChannel, replyChannel, bla bla bla I want event, senderChannel, replyChannel, channelToSendTo, channelToReplyTo. modem side and sender distance I dont really need. so any chance someone could explain how i could do this? Im new to all this so make it simple please :)/>

Greatly appreciated :D/>
Creator #2
Posted 08 June 2015 - 04:24 PM
Weel, you have to get all the events and keep only those which you want. Example:

event, side, distance, sender, reply, msg = os.pullEvent("modem_message")
whatIneed = {event,whatever}

Or just use the variables that you need. There is no way to define the return values.
KingofGamesYami #3
Posted 08 June 2015 - 04:52 PM
You could use a packet system (like rednet does). Rednet uses modem_message events, but sends a serialized table. On the receiving computer, a function called rednet.run() is constantly running in the background and uses os.queueEvent to produse a rednet_message event.
Bomb Bloke #4
Posted 09 June 2015 - 01:15 AM
Er, what would be the difference between senderChannel and channelToSendTo (and shouldn't they be sentToChannel and channelSentTo?), or replyChannel and channelToReplyTo?

And assuming there IS a difference, why can't you just include that extra information in the message (bearing in mind that you can transmit tables, which can easily have all sorts of data put into them)?