2 posts
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/>
2679 posts
Location
You will never find me, muhahahahahaha
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.
3057 posts
Location
United States of America
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.
7083 posts
Location
Tasmania (AU)
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)?