Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Wind Turbine experiment https://youtu.be/bSgGJ6wukOs
- public Program() {Runtime.UpdateFrequency = UpdateFrequency.Update100;}
- public void Main() {
- var m = (IMyTextPanel)GridTerminalSystem.GetBlockWithName("_mon") ?? Me.GetSurface(0);
- m.FontColor = Color.Gray; m.BackgroundColor = new Color(0,0,7);
- m.FontSize = 26.4f/(10); m.Font = "Monospace";
- m.ContentType = ContentType.TEXT_AND_IMAGE; m.TextPadding = 0;
- var list = new List<IMyPowerProducer>();
- GridTerminalSystem.GetBlocksOfType(list,a => a.CustomName.Contains("Wind"));
- var s=""; var p=0f;
- for(int i=0;i<list.Count;i++) {
- p = p + list[i].MaxOutput*1000;
- s = s + $"{list[i].MaxOutput*1000}\n";
- }
- m.WriteText($"{list.Count}*{p/list.Count}\n{s}",false);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement