Advertisement
ValveCantCount

Untitled

Oct 28th, 2020 (edited)
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. function recieved(message,freq)
  2. print(message)
  3. end
  4.  
  5. function callbackDummy()
  6. while true do
  7. local event, side, frequency, replyFrequency, message, distance = os.pullEvent("modem_message")
  8. recievedMessage = coroutine.create(recieved)
  9. coroutine.resume(recievedMessage,message,frequency)
  10. end
  11. end
  12.  
  13. function mainFunc()
  14. sInput = nil
  15.  
  16. while true do
  17. sInput = read()
  18. if sInput ~= nil or sInput ~= "" then
  19. break -- Break out of the infinite loop
  20. -- Monitor code goes here
  21. end
  22. end
  23. end
  24.  
  25. parallel.waitForAny(mainFunc,callbackDummy)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement