Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Save()
- {
- }
- public void Main(string argument)
- {
- //turns the door on and makes sure it's closed
- GridTerminalSystem.GetBlockWithName("AL1-ADO").ApplyAction("OnOff_On");
- GridTerminalSystem.GetBlockWithName("AL1-ADO").ApplyAction("Open_Off");
- var myAirVent = GridTerminalSystem.GetBlockWithName("AL1-AV") as IMyAirVent;
- var myDoor = GridTerminalSystem.GetBlockWithName("AL1-ADO") as IMyDoor;
- var lcd = GridTerminalSystem.GetBlockWithName("Debug") as IMyTextPanel;
- //Retrieves oxygen level of the airlock and opens door if airlock is depressurized
- if (myAirVent.GetOxygenLevel() < 0.05f)
- {
- GridTerminalSystem.GetBlockWithName("AL1-ADO").ApplyAction("Open_On");
- lcd.WritePublicText ("Opening Airlock");
- if (myDoor.OpenRatio > 0.99f)
- {
- //Turns the power off when the door is opened
- GridTerminalSystem.GetBlockWithName("AL1-ADO").ApplyAction("OnOff_Off");
- //Turns Outer Airlock lights green to let people know that the airlock can be entered safely
- List<IMyTerminalBlock> lights = new List<IMyTerminalBlock>();
- GridTerminalSystem.GetBlocksOfType<IMyLightingBlock>
- (lights, (b) => b.CustomName.StartsWith("AL1-OLight"));
- foreach (var light in lights)
- {
- light.SetValueColor("Color", Color.Green);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement