Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- print("Enter the turtle ID please:")
- turleID = tonumber(read())
- if type(turleID) == "number" then
- print("Thanks, now I will wait on a rednet signal from your turtle...")
- else
- print("Please enter a number")
- return
- end
- connect = function()
- for _,s in pairs(rs.getSides()) do
- if peripheral.isPresent(s) and peripheral.getType(s) == "modem" and peripheral.call( s, "isWireless" ) then
- rednet.open(s)
- return true
- end
- end
- print("No modem found")
- return
- end
- connect()
- while true do
- count = 0
- while true do
- if count == 6 then
- count = 0
- clear = true
- end
- local senderId, message, distance = rednet.receive()
- if clear == true then
- term.setCursorPos(1,1)
- term.clear()
- clear = false
- end
- if senderId == turleID then
- print(""..message)
- count = count+1
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment