This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
LDDestroier's profile picture

TPS (Turtle Positioning System) -- Emulate a four-computer GPS cluster with one turtle

Started by LDDestroier, 12 December 2016 - 02:09 PM
LDDestroier #1
Posted 12 December 2016 - 03:09 PM
TPS (Turtle Positioning System) is a program that allows one or two turtles to replicate a full, four-computer GPS server. It does this by moving in a set pattern and accepting GPS requests at each step.
Since turtles are slow, one turtle might time out a standard "gps locate" command. Also, for the same reason, results will be skewed if you move while getting GPS coordinates from TPS.
You can work around those problems by adding a second turtle to ease the load, but this obviously makes it less resource efficient, which is the point of TPS.

Turtles only move when they get GPS requests, and can automatically go to refuel in a chest if they run low. It will only refuel with coal/charcoal/coal blocks, though.

Upon startup, it will give you a few seconds to press a button to input the turtle's XYZ coordinates and direction, as well as a chest's XYZ.


pastebin get PsTiQ5eu startup
std PB PsTiQ5eu startup
std ld tps startup

Use at your leisure if you don't have a lot of ender pearls for four modems, but do have a mountain of coal lying around! Or like seeing turtles dance.
Edited on 08 June 2017 - 02:20 PM
Lupus590 #2
Posted 12 December 2016 - 06:33 PM
Would be nice if it would return to the ground to get more fuel

Otherwise, this is nearly useless, would +1 again
Edited on 12 December 2016 - 05:34 PM
LDDestroier #3
Posted 15 December 2016 - 10:31 PM
Would be nice if it would return to the ground to get more fuel

Ohhh…?

UPDATE!!

+Turtles will go to a chest upon having low enough fuel (but it makes sure it has enough to make it to the chest)
*Improved the startup menu.
LDDestroier #4
Posted 08 June 2017 - 04:52 PM
Updated OP, prettied up the interface, localized the functions and variables, reduced the os.queueEvent's.