Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function recieved(message,freq)
- print(message)
- end
- function callbackDummy()
- while true do
- local event, side, frequency, replyFrequency, message, distance = os.pullEvent("modem_message")
- recievedMessage = coroutine.create(recieved)
- coroutine.resume(recievedMessage,message,frequency)
- end
- end
- function mainFunc()
- sInput = nil
- while true do
- sInput = read()
- if sInput ~= nil or sInput ~= "" then
- break -- Break out of the infinite loop
- -- Monitor code goes here
- end
- end
- end
- parallel.waitForAny(mainFunc,callbackDummy)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement