Advertisement
Whiplash141

Rotor Angle Debugger

Aug 24th, 2017
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. string rotorNameTag = "Debug";
  2. string textPanelName = "Debug";
  3.  
  4. void Main()
  5. {
  6.     var textPanels = new List<IMyTextPanel>();
  7.     var rotors = new List<IMyMotorStator>();
  8.  
  9.     GridTerminalSystem.GetBlocksOfType(rotors, x => x.CustomName.Contains(rotorNameTag));
  10.     GridTerminalSystem.GetBlocksOfType(textPanels, x => x.CustomName.Contains(textPanelName));
  11.  
  12.     string output = "";
  13.     foreach (var block in rotors)
  14.     {
  15.         output += $"'{block.CustomName}' - Angle: {MathHelper.ToDegrees(block.Angle):N1}\n";
  16.     }
  17.  
  18.     foreach (var block in textPanels)
  19.     {
  20.         block.WritePublicText(output);
  21.         block.ShowPublicTextOnScreen();
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement