Advertisement
Silasko

turtle broadcast GPS

Dec 3rd, 2020 (edited)
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. function listen()
  2.     rednet.open("left")
  3.         while true do
  4.             local sender, message, protocol = rednet.receive()
  5.             if message == "ping" then
  6.                 broadcastGPS()
  7.             end
  8.         end
  9. end
  10.  
  11. function broadcastGPS()
  12.     rednet.open("left")
  13.     local a = vector.new(gps.locate())
  14.     --rednet.broadcast("gps: "..a.x.." "..a.y.." "..a.z)
  15.     rednet.broadcast(a)
  16. end
  17.  
  18. listen()
  19.  
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement