Custom Airlock IC10
From Unofficial Stationeers Wiki
Contents
This script controls all functions of an airlock that consists of the following:
Assembly
Set up a standard airlock for atmosphere on both sides. Configure the pressures in the first two lines of the script. Before exporting the script or resetting the IC, make sure the airlock is cycled to the outside (inner door closed, outer open). The LED serves as trigger for both cycling the airlock and skipping each phase, hence should be placed inside the airlock. The airlock should be a single frame to avoid leftover atmosphere after depressurization. For larger airlocks place the sensor on the far side from the vents. The script supports Blast Doors, but since they lack a door handle you will need a button on each side (outside) of the airlock. Connect a Logic Writer to each button and use it to toggle the LED.
IC10 pin layout:
| D0 | Interior Door |
| D1 | Exterior Door |
| D2 | Interior Vent |
| D3 | Exterior Vent |
| D4 | Gas Sensor |
| D5 | LED Light |
Usage
The airlock can be cycled by interacting with either door, or turning the LED off. During cycling the doors are locked, and the LED can be used to skip both depressurize (red) and pressurize (yellow) phases.
| Source code: |
|---|
<br> define Int.Pressure 100<br> define Ext.Pressure 0<br> <br> alias Int.Door d0<br> alias Ext.Door d1<br> alias Int.Vent d2<br> alias Ext.Vent d3<br> alias Sensor d4<br> alias LedLight d5<br> <br> define Color.Red 4<br> define Color.Yellow 5<br> define Color.Green 2<br> define Mode.Out 1<br> define Mode.In 0<br> <br> alias rT r0<br> alias rT2 r1<br> alias rTarPressure r2<br> <br> Init:<br> s Int.Vent On 0<br> s Ext.Vent On 0<br> s Ext.Door Mode 1 #Logic mode<br> s Int.Door Mode 1 #Logic mode<br> s LedLight Color Color.Green<br> s LedLight On 1<br> s Int.Door Open 0<br> s Ext.Door Open 1<br> yield<br> <br> main:<br> jal _monitorTrigger<br> jal _cycleToInt<br> jal _monitorTrigger<br> jal _cycleToExt<br> j main<br> <br> _cycleToInt:<br> push ra<br> s Ext.Door Lock 1<br> s Int.Door Lock 1<br> s Ext.Door Open 0<br> s Ext.Vent Mode Mode.Out<br> s Ext.Vent On 1<br> s LedLight Color Color.Red<br> s LedLight On 1<br> jal _dePressurize<br> s Ext.Vent On 0<br> s Int.Vent Mode Mode.In<br> s Int.Vent PressureExternal Int.Pressure<br> move rTarPressure Int.Pressure<br> s Int.Vent On 1<br> s LedLight Color Color.Yellow<br> jal _pressurize<br> s LedLight Color Color.Green<br> s Int.Vent On 0<br> s Int.Door Open 1<br> s Ext.Door Lock 0<br> s Int.Door Lock 0<br> pop ra<br> j ra<br> <br> _cycleToExt:<br> push ra<br> s Int.Door Lock 1<br> s Ext.Door Lock 1<br> s Int.Door Open 0<br> s Int.Vent Mode Mode.Out<br> s Int.Vent On 1<br> s LedLight Color Color.Red<br> s LedLight On 1<br> jal _dePressurize<br> s Int.Vent On 0<br> s Ext.Vent Mode Mode.In<br> s Ext.Vent PressureExternal Ext.Pressure<br> move rTarPressure Ext.Pressure<br> s Ext.Vent On 1<br> s LedLight Color Color.Yellow<br> jal _pressurize<br> s LedLight Color Color.Green<br> s Ext.Vent On 0<br> s Ext.Door Open 1<br> s Int.Door Lock 0<br> s Ext.Door Lock 0<br> pop ra<br> j ra<br> <br> _dePressurize:<br> l rT Sensor Pressure<br> beqz rT dePressurize_end<br> l rT LedLight On<br> beqz rT dePressurize_end<br> j _dePressurize<br> dePressurize_end:<br> s LedLight On 1<br> yield<br> j ra<br> <br> _pressurize:<br> l rT Sensor Pressure<br> bge rT rTarPressure pressurize_end<br> l rT LedLight On<br> beqz rT pressurize_end<br> j _pressurize<br> pressurize_end:<br> s LedLight On 1<br> yield<br> j ra<br> <br> _monitorTrigger:<br> l rT Int.Door Setting<br> l rT2 Ext.Door Setting<br> beq rT rT2 monitorTrigger_end<br> l rT LedLight On<br> beqz rT monitorTrigger_end<br> yield<br> j _monitorTrigger<br> monitorTrigger_end:<br> yield<br> j ra<br> |
