Advertisement
Guest User

Untitled

a guest
Jul 27th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. public void Save()
  2. {
  3.  
  4. }
  5.  
  6. public void Main(string argument)
  7. {
  8. //turns the door on and makes sure it's closed
  9. GridTerminalSystem.GetBlockWithName("AL1-ADO").ApplyAction("OnOff_On");
  10. GridTerminalSystem.GetBlockWithName("AL1-ADO").ApplyAction("Open_Off");
  11.  
  12. var myAirVent = GridTerminalSystem.GetBlockWithName("AL1-AV") as IMyAirVent;
  13. var myDoor = GridTerminalSystem.GetBlockWithName("AL1-ADO") as IMyDoor;
  14. var lcd = GridTerminalSystem.GetBlockWithName("Debug") as IMyTextPanel;
  15.  
  16. //Retrieves oxygen level of the airlock and opens door if airlock is depressurized
  17. if (myAirVent.GetOxygenLevel() < 0.05f)
  18. {
  19. GridTerminalSystem.GetBlockWithName("AL1-ADO").ApplyAction("Open_On");
  20. lcd.WritePublicText ("Opening Airlock");
  21.  
  22. if (myDoor.OpenRatio > 0.99f)
  23. {
  24. //Turns the power off when the door is opened
  25. GridTerminalSystem.GetBlockWithName("AL1-ADO").ApplyAction("OnOff_Off");
  26.  
  27. //Turns Outer Airlock lights green to let people know that the airlock can be entered safely
  28. List<IMyTerminalBlock> lights = new List<IMyTerminalBlock>();
  29. GridTerminalSystem.GetBlocksOfType<IMyLightingBlock>
  30. (lights, (b) => b.CustomName.StartsWith("AL1-OLight"));
  31.  
  32. foreach (var light in lights)
  33. {
  34. light.SetValueColor("Color", Color.Green);
  35. }
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement