modem message (event)
From ComputerCraft Wiki
Revision as of 11:33, 4 October 2013 by Cranium (Talk | contribs) (Added NeedsWork tag, due to broken template)
| This page needs some serious TLC, stat! Please help us by cleaning it, fixing it up, or sparing it some love.
(Reason: The event template is broken, and will not display more than three events. Until this can be fixed, this page is incomplete.) |
| Fired when any modem message arrives through an open modem. | |
| Returned Object 1 | The side of the computer where the message was received. |
| Returned Object 2 | The frequency that the message has been received on. |
| Returned Object 3 | The frequency that the sender defined when sending the message. |
| Returned Object 4 | The message received in string format. If the message was previously a table, see textutils.unserialize. |
| Returned Object 5 | The distance (in blocks) between the two computers. |
| Prints details of the message received. | |
| Code |
while true do event, side, frequency, replyFrequency, message, distance = os.pullEvent("modem_message") print("Message received fromt the open modem on the "..side.." side of this computer.\nFrequency: "..frequency.."\nRequested reply frequency: "..replyFrequency.."\nDistance: "..distance.."\nMessage is as follows: "..message) end |
| Output | Will print out all details of the message received on the modem. |