Skip to content

Instantly share code, notes, and snippets.

@siasur
Created April 16, 2019 19:57
Show Gist options
  • Save siasur/e799a3b895f92db51ee7d180f13ae7fe to your computer and use it in GitHub Desktop.
Save siasur/e799a3b895f92db51ee7d180f13ae7fe to your computer and use it in GitHub Desktop.
Grundgerüst für ein SE Script...
public void Main(string argument)
{
var groups = new List<IMyBlockGroup>();
GridTerminalSystem.GetBlockGroups(groups, selector => selector.Name.EndsWith("#Battery"));
foreach (var g in groups)
{
List<IMyReactor> reactors = new List<IMyReactor>();
g.GetBlocksOfType(reactors);
List<IMyBatteryBlock> batteries = new List<IMyBatteryBlock>();
g.GetBlocksOfType(batteries);
foreach (var reactor in reactors)
{
// Durchlaufen der Reaktoren
}
foreach (var battery in batteries)
{
// Durchlaufen der Batterien
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment