stationeers_ic10/automated_canister_filling.ic10

59 lines
1.5 KiB
Plaintext
Raw Normal View History

2021-08-29 19:37:16 +00:00
# automatic gas-canister filler.
# only works with player-made cans, starter-cans
# have different hashes that won't work
# !!! Remember to set volume pump to no more !!!
# !!! than 10l! I have mine at 2l for safety !!!
2021-08-29 13:07:24 +00:00
alias CanisterStorage d0
alias FillPump d1
alias EvacPump d2
alias Analyzer d4
alias CanisterPresent r0
alias CanisterHash r1
alias StoragePressure r2
alias GasToMove r3
alias FillPressure r4
alias PumpActive r5
2021-08-29 13:07:24 +00:00
2021-11-15 13:32:10 +00:00
define CANISTER 42280099
define SMARTCANISTER -668314371
2021-08-29 19:37:16 +00:00
start:
2021-09-04 11:02:35 +00:00
yield
2021-08-29 19:37:16 +00:00
# check if canister is present
ls CanisterPresent CanisterStorage 0 Occupied
2021-08-29 19:37:16 +00:00
# identify canister
ls CanisterHash CanisterStorage 0 OccupantHash
2021-08-29 19:37:16 +00:00
# set safe fill-pressure
beq CanisterHash CANISTER regular
beq CanisterHash SMARTCANISTER smart
2021-08-29 19:37:16 +00:00
regular:
move FillPressure 8000000 # regular can safe max
2021-08-29 19:37:16 +00:00
j fill # start filling
smart:
move FillPressure 18000000 # smart can safe max
2021-08-29 19:37:16 +00:00
j fill # start filling
fill: # fills canister if present and <8Mpa
2021-08-29 19:37:16 +00:00
# get canister pressure in Pa
ls StoragePressure CanisterStorage 0 Pressure
2021-08-29 19:37:16 +00:00
# is there room in the canister for more gas?
slt GasToMove StoragePressure FillPressure
2021-08-29 19:37:16 +00:00
# is there a can in the slot that has room?
and PumpActive GasToMove CanisterPresent
# trigger fill pump
s FillPump On PumpActive
beqz CanisterPresent evac # break if no can
j start
evac: # evacuates pipe on can removed and >0Pa
l StoragePressure Analyzer Pressure
# is there gas in the pipe?
sgt GasToMove StoragePressure 0
# trigger evac pump
s EvacPump On GasToMove
bgtz GasToMove evac
2021-08-29 19:37:16 +00:00
j start