Code:

static IMyTerminalBlock gpsdisplay = null; const string SPACER = " "; void Main() { DisplayGps(); } void DisplayGps() { if (gpsdisplay == null ) { gpsdisplay = GridTerminalSystem.GetBlockWithName("GPS Display"); } else { if (ShipIsPiloted()) { gpsdisplay.RequestShowOnHUD(true); } else { gpsdisplay.RequestShowOnHUD(false); } Vector3D position = gpsdisplay.GetPosition(); int x = (int)Math.Truncate(position.GetDim(0)); int y = (int)Math.Truncate(position.GetDim(1)); int z = (int)Math.Truncate(position.GetDim(2)); string text = "Current position" + SPACER + "

" + "X = " + x.ToString() + SPACER + "

" + "Y = " + y.ToString() + SPACER + "

" + "Z = " + z.ToString() + SPACER; gpsdisplay.SetCustomName(text); } } bool ShipIsPiloted() { List<IMyTerminalBlock> controlStations = new List<IMyTerminalBlock>(); GridTerminalSystem.GetBlocksOfType<IMyCockpit>(controlStations); for (int i = 0; i < controlStations.Count; i++) { if ((controlStations[i] as IMyCockpit).IsUnderControl) { return true; } } return false; }