Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- local function connect()
- for _,s in ipairs(rs.getSides()) do
- if peripheral.isPresent(s) and peripheral.getType(s) == "modem" then
- rednet.open(s)
- return true
- end
- end
- term.clear()
- print("ERROR")
- print("No modem found")
- print("Aborting")
- sleep(3)
- os.shutdown()
- return false
- end
- connect()
- i = 0
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print (i.." messages passed")
- senderId, message, distance = rednet.receive()
- rednet.send(21,""..message)
- i = i+1
- end
Advertisement
Add Comment
Please, Sign In to add comment