Compare commits
No commits in common. "3609e1526e8a16151b480145f3ba2af963b5f4f9" and "10f930d20de0a8f99e66722027d03ef05cc89758" have entirely different histories.
3609e1526e
...
10f930d20d
1 changed files with 2 additions and 30 deletions
32
Program.cs
32
Program.cs
|
@ -177,7 +177,6 @@ namespace IngameScript
|
|||
_storageIni.Clear();
|
||||
_storageIni.Set("AutomaticConnectorActions", "Is_Docked", _isDocked);
|
||||
Storage = _storageIni.ToString();
|
||||
Echo($"Docking status set to {_isDocked} and saved to internal storage.");
|
||||
}
|
||||
|
||||
private void Dock()
|
||||
|
@ -391,8 +390,7 @@ namespace IngameScript
|
|||
Echo("Polling...");
|
||||
List<IMyShipConnector> connectors = new List<IMyShipConnector>();
|
||||
|
||||
// Get all connectors on the grid that are managed by the script
|
||||
Echo($"Retrieving connectors, filtering by \"{_connectorPrefix}\"...");
|
||||
// Get all connectors on the grid
|
||||
GridTerminalSystem.GetBlocksOfType(
|
||||
connectors,
|
||||
connector =>
|
||||
|
@ -404,39 +402,13 @@ namespace IngameScript
|
|||
{
|
||||
foreach (IMyShipConnector connector in connectors)
|
||||
{
|
||||
if (connector.IsConnected == true)
|
||||
if (connector.IsConnected == _isDocked)
|
||||
{
|
||||
Echo($"Connector '{connector.CustomName}' is connected. Exiting.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Echo(
|
||||
$"Connector '{connector.CustomName}' is not connected. Continuing."
|
||||
);
|
||||
}
|
||||
}
|
||||
Echo("No connectors are connected. Undocking...");
|
||||
Undock();
|
||||
}
|
||||
else if (_isDocked == false)
|
||||
{
|
||||
foreach (IMyShipConnector connector in connectors)
|
||||
{
|
||||
if (connector.IsConnected == true)
|
||||
{
|
||||
Echo($"Connector '{connector.CustomName}' is connected. Docking...");
|
||||
Dock();
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
Echo(
|
||||
$"Connector '{connector.CustomName}' is not connected. Continuing."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue