Advertisement
drabont

Stationeers - AirLock ICS v0.3

Oct 4th, 2020
1,755
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #= AirLock ICS = v0.3 ================ by swagman =#
  2. #    __    _   ___   _     ___   __    _      1-2  #
  3. #   / /\  | | | |_) | |   / / \ / /`  | |_/   rev  #
  4. #  /_/--\ |_| |_| \ |_|__ \_\_/ \_\_, |_| \   pas  #
  5. #==================================================#
  6. # Vent0, Vent1, Pulse - optional devices           #
  7. # + airlock control (1-2 mode, revers, quick pass) #
  8. # + beacon pulsator (turn on by 1 tick per period) #
  9. #= 2020.10.05 04:36  https://youtu.be/ekjreSjr49c =#
  10.  
  11. define press0 0  #outer (Vent0) pressure set 0 kPa
  12. define press1 50 #inner (Vent1) pressure set 50 kPa
  13. define period 20 #beacon pulse period 20 ticks
  14.  
  15. alias Door0 d0
  16. alias Vent0 d1
  17. alias GSens d2
  18. alias Door1 d3
  19. alias Vent1 d4
  20. alias Pulse d5
  21.  
  22. alias state r15
  23. alias route r14
  24. alias press r13
  25. alias targp r12
  26. alias btrev r11
  27. alias btpas r10
  28. #r9 - r6 used for index
  29. alias count r5
  30.  
  31. move state st1
  32. loop:#--main loop
  33. yield
  34. select targp route press0 press1
  35. select r9 route 0 3 #Door0 Door1
  36. select r8 route 3 0 #Door1 Door0
  37. select r6 route 4 1 #Vent1 Vent0
  38. select r7 route 1 4 #Vent0 Vent1
  39. l press GSens Pressure
  40. l btpas dr9 Setting
  41. l btrev dr8 Setting
  42. s dr9 Setting 0
  43. s dr8 Setting 0
  44. s db Setting state #debug
  45. j state
  46.  
  47. st1: #--door opened
  48. l r0 Door0 Open #--init\
  49. l route Door1 Open
  50. xor r0 route r0
  51. s Door0 Mode r0
  52. s Door1 Mode r0
  53. brdns Vent0 2
  54. s Vent0 Lock r0
  55. brdns Vent1 2
  56. s Vent1 Lock r0
  57. s dr8 On 1
  58. beqz r0 end #--init/
  59. s dr9 On 1
  60. s dr8 On btpas
  61. beqz btpas end
  62. s dr8 Open 0
  63. move state st2
  64. j end
  65.  
  66. st2: #--vacuuming
  67. xor route route btrev
  68. select state btrev st3 st2
  69. sgtz r0 press
  70. bdns dr6 st3
  71. s dr6 On r0
  72. s dr6 Mode 1
  73. select state r0 state st3
  74. j end
  75.  
  76. st3: #--pressurize
  77. xor route route btrev
  78. select state btrev st2 st3
  79. slt r0 press targp
  80. select r0 btpas 0 r0
  81. brdns dr7 5
  82. s dr7 On r0
  83. s dr7 Mode 0
  84. s dr7 PressureExternal targp
  85. bgtz r0 end
  86. s dr9 Open 1
  87. s dr9 On 0
  88. xor route route 1
  89. move state st1
  90. end:#--airlock
  91.  
  92. brdns Pulse 5 #--beacon pulsator
  93. slez r0 count
  94. s Pulse On r0
  95. select count r0 period count
  96. sub count count 1
  97.  
  98. j loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement