Advertisement
Zohondekids

Turtle Locator (LocPing) - Turtle Side

Mar 16th, 2025 (edited)
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | Source Code | 0 0
  1. -- Pinging Program
  2. -- Edit startup code to be 'shell.run("locPing")' to make it more reliable and useful
  3. -- Requires a GPS constellation built in the world to be somewhat reliable
  4. protocol = "turtleLocator"
  5.  
  6. rednet.open("left")
  7.  
  8. -- EDIT THIS TO MATCH YOUR RECEIVER MACHINE'S ID
  9. computerId = 5
  10.  
  11.  
  12. local x, y, z = gps.locate()
  13. strLoc = "X:" .. x .. " Y:" .. y
  14. .. " Z:" .. z .. " ID:" .. os.getComputerID()
  15. if os.getComputerLabel() ~= nil then
  16. strLoc = strLoc .. " Name:" .. os.getComputerLabel()
  17. end
  18. rednet.send(computerId, strLoc, protocol)
  19. print(strLoc)
  20. os.sleep(10)
  21. shell.run("locPing")
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement