Advertisement
Guest User

Stationeers Custom Airlock Script

a guest
Mar 1st, 2020
4,314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. define Int.Pressure 100
  2. define Ext.Pressure 0
  3.  
  4. alias Int.Door d0
  5. alias Ext.Door d1
  6. alias Int.Vent d2
  7. alias Ext.Vent d3
  8. alias Sensor d4
  9. alias LedLight d5
  10.  
  11. define Color.Red 4
  12. define Color.Yellow 5
  13. define Color.Green 2
  14. define Mode.Out 1
  15. define Mode.In 0
  16.  
  17. alias rT r0
  18. alias rT2 r1
  19. alias rTarPressure r2
  20.  
  21. Init:
  22. s Int.Vent On 0
  23. s Ext.Vent On 0
  24. s Ext.Door Mode 1 #Logic mode
  25. s Int.Door Mode 1 #Logic mode
  26. s LedLight Color Color.Green
  27. s LedLight On 1
  28. s Int.Door Open 0
  29. s Ext.Door Open 1
  30. yield
  31.  
  32. main:
  33. jal _monitorTrigger
  34. jal _cycleToInt
  35. jal _monitorTrigger
  36. jal _cycleToExt
  37. j main
  38.  
  39. _cycleToInt:
  40. push ra
  41. s Ext.Door Lock 1
  42. s Int.Door Lock 1
  43. s Ext.Door Open 0
  44. s Ext.Vent Mode Mode.Out
  45. s Ext.Vent On 1
  46. s LedLight Color Color.Red
  47. s LedLight On 1
  48. jal _dePressurize
  49. s Ext.Vent On 0
  50. s Int.Vent Mode Mode.In
  51. s Int.Vent PressureExternal Int.Pressure
  52. move rTarPressure Int.Pressure
  53. s Int.Vent On 1
  54. s LedLight Color Color.Yellow
  55. jal _pressurize
  56. s LedLight Color Color.Green
  57. s Int.Vent On 0
  58. s Int.Door Open 1
  59. s Ext.Door Lock 0
  60. s Int.Door Lock 0
  61. pop ra
  62. j ra
  63.  
  64. _cycleToExt:
  65. push ra
  66. s Int.Door Lock 1
  67. s Ext.Door Lock 1
  68. s Int.Door Open 0
  69. s Int.Vent Mode Mode.Out
  70. s Int.Vent On 1
  71. s LedLight Color Color.Red
  72. s LedLight On 1
  73. jal _dePressurize
  74. s Int.Vent On 0
  75. s Ext.Vent Mode Mode.In
  76. s Ext.Vent PressureExternal Ext.Pressure
  77. move rTarPressure Ext.Pressure
  78. s Ext.Vent On 1
  79. s LedLight Color Color.Yellow
  80. jal _pressurize
  81. s LedLight Color Color.Green
  82. s Ext.Vent On 0
  83. s Ext.Door Open 1
  84. s Int.Door Lock 0
  85. s Ext.Door Lock 0
  86. pop ra
  87. j ra
  88.  
  89. _dePressurize:
  90. l rT Sensor Pressure
  91. beqz rT dePressurize_end
  92. l rT LedLight On
  93. beqz rT dePressurize_end
  94. j _dePressurize
  95. dePressurize_end:
  96. s LedLight On 1
  97. j ra
  98.  
  99. _pressurize:
  100. l rT Sensor Pressure
  101. bge rT rTarPressure pressurize_end
  102. l rT LedLight On
  103. beqz rT pressurize_end
  104. j _pressurize
  105. pressurize_end:
  106. s LedLight On 1
  107. j ra
  108.  
  109. _monitorTrigger:
  110. l rT Int.Door Setting
  111. l rT2 Ext.Door Setting
  112. beq rT rT2 monitorTrigger_end
  113. l rT LedLight On
  114. beqz rT monitorTrigger_end
  115. yield
  116. j _monitorTrigger
  117. monitorTrigger_end:
  118. j ra
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement