Advertisement
drabont

Space Engineers - Wind Turbine experiment

Mar 4th, 2020
610
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 KB | None | 0 0
  1. // Wind Turbine experiment https://youtu.be/bSgGJ6wukOs
  2. public Program() {Runtime.UpdateFrequency = UpdateFrequency.Update100;}
  3. public void Main() {
  4.     var m = (IMyTextPanel)GridTerminalSystem.GetBlockWithName("_mon") ?? Me.GetSurface(0);
  5.     m.FontColor = Color.Gray; m.BackgroundColor = new Color(0,0,7);
  6.     m.FontSize = 26.4f/(10); m.Font = "Monospace";
  7.     m.ContentType = ContentType.TEXT_AND_IMAGE; m.TextPadding = 0;
  8.  
  9.     var list = new List<IMyPowerProducer>();
  10.     GridTerminalSystem.GetBlocksOfType(list,a => a.CustomName.Contains("Wind"));
  11.  
  12.     var s=""; var p=0f;
  13.     for(int i=0;i<list.Count;i++) {
  14.         p = p + list[i].MaxOutput*1000;
  15.         s = s + $"{list[i].MaxOutput*1000}\n";
  16.     }
  17.    m.WriteText($"{list.Count}*{p/list.Count}\n{s}",false);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement