Advertisement
drabont

Stationeers - AirLock ICS v0.2

Sep 11th, 2020 (edited)
3,513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #= AirLock ICS = v0.2 ================ 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.09.11 22:18  https://youtu.be/FDvsPXmCRVM =#
  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 count r13
  25. #also used r5 to r11
  26. move state st1
  27.  
  28. loop:#--main loop
  29. s Door0 Setting 0
  30. s Door1 Setting 0
  31. yield
  32. select r5 route press0 press1
  33. select r7 route 1 4 #Vent0 Vent1
  34. select r6 route 4 1 #Vent1 Vent0
  35. select r8 route 3 0 #Door1 Door0
  36. select r9 route 0 3 #Door0 Door1
  37. l r10 GSens Pressure
  38. l r11 dr9 Setting
  39. l r12 dr8 Setting
  40. s db Setting state #4debug
  41. j state
  42.  
  43. st1: #--door opened
  44. l r0 Door0 Open #--init\
  45. l route Door1 Open
  46. xor r0 route r0
  47. s Door0 Mode r0
  48. s Door1 Mode r0
  49. brnez r0 3
  50. s Door0 On 1
  51. s Door1 On 1 #--init/
  52. beqz r11 end
  53. s dr8 Open 0
  54. s dr8 On 1
  55. move state st2
  56. j end
  57.  
  58. st2: #--vacuuming
  59. xor route route r12
  60. select state r12 st3 st2
  61. sgtz r0 r10
  62. bdns dr6 st3
  63. s dr6 On r0
  64. s dr6 Mode 1
  65. select state r0 state st3
  66. j end
  67.  
  68. st3: #--pressurize
  69. xor route route r12
  70. select state r12 st2 st3
  71. slt r0 r10 r5
  72. select r0 r11 0 r0
  73. brdns dr7 5
  74. s dr7 On r0
  75. s dr7 Mode 0
  76. s dr7 PressureExternal r5
  77. bgtz r0 end
  78. s dr9 Open 1
  79. s dr9 On 0
  80. xor route route 1
  81. move state st1
  82. end:#--airlock
  83.  
  84. brdns Pulse 5 #--beacon pulsator
  85. slez r0 count
  86. s Pulse On r0
  87. select count r0 period count
  88. sub count count 1
  89.  
  90. j loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement