Alyssa

Receive

Jul 30th, 2013
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. os.loadAPI("modem")
  2. for i = 1, 128 do
  3. modem.open("right", i)
  4. print("opened channel "..i.."")
  5. sleep(0.05)
  6. end
  7. while true do
  8. modem.receive()
  9. side = modem.getside()
  10. sender = modem.getfromchan()
  11. replychan = modem.getreplychan()
  12. msg = modem.getmsg()
  13. distance = modem.getdistance()
  14. if distance and msg and replychan and sender and side then
  15. print(sender..": "..msg.."["..distance.." Blocks away] sender wants us to reply on "..replychan.."")
  16. end
  17. end
Add Comment
Please, Sign In to add comment