Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- isWirelessTurtle = peripheral.isPresent("right")
- if (isWirelessTurtle == true) then
- turtleId = os.getComputerLabel()
- rednet.open("right")
- end
- function writeMessage(message)
- print(message)
- -- If this turtle has a modem, then write the message to red net
- if (isWirelessTurtle == true) then
- if (turtleId == nil) then
- rednet.broadcast(message)
- else
- -- Broadcast the message (prefixed with the turtle's id)
- rednet.broadcast("[".. turtleId.."] "..message)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment