From a774d1d5b672ee89b8e6cdf371a739b9b7c6b90a Mon Sep 17 00:00:00 2001 From: Snorre Selmer Date: Sun, 29 Aug 2021 14:54:51 +0200 Subject: [PATCH 1/3] Deleted WIP script, moved to branch --- automatic_canister_filler.ic10 | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 automatic_canister_filler.ic10 diff --git a/automatic_canister_filler.ic10 b/automatic_canister_filler.ic10 deleted file mode 100644 index c57d3e7..0000000 --- a/automatic_canister_filler.ic10 +++ /dev/null @@ -1,15 +0,0 @@ -# check for presence of canister -# check canister type in tank storage -# set target pressure accordingly -# run volume pump until target pressure in canister is reached -# stop volume pump - -alias canister_storage d0 -alias volume_pump d1 - -alias canister_present r0 -alias canister_hash r1 -alias canister_pressure r2 - -define canister 42280099 -define smart_canister -668314371 \ No newline at end of file From f7326bbcae21444adc94af92abbd8f1f0e372f9b Mon Sep 17 00:00:00 2001 From: Snorre Selmer Date: Sun, 29 Aug 2021 15:07:24 +0200 Subject: [PATCH 2/3] Set up aliases and defines --- automated_canister_filling.ic10 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 automated_canister_filling.ic10 diff --git a/automated_canister_filling.ic10 b/automated_canister_filling.ic10 new file mode 100644 index 0000000..4a04bc8 --- /dev/null +++ b/automated_canister_filling.ic10 @@ -0,0 +1,15 @@ +# check for presence of canister +# check canister type in tank storage +# set target pressure accordingly +# run volume pump until target pressure in canister is reached +# stop volume pump + +alias canister_storage d0 +alias volume_pump d1 + +alias canister_present r0 +alias canister_hash r1 +alias canister_pressure r2 + +define canister 42280099 +define smart_canister -668314371 \ No newline at end of file From e501867d2a440a1fbbc9fab585b888a398e42b55 Mon Sep 17 00:00:00 2001 From: Snorre Selmer Date: Sun, 29 Aug 2021 21:37:16 +0200 Subject: [PATCH 3/3] Finisted and tested --- automated_canister_filling.ic10 | 43 ++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/automated_canister_filling.ic10 b/automated_canister_filling.ic10 index 4a04bc8..2a6e496 100644 --- a/automated_canister_filling.ic10 +++ b/automated_canister_filling.ic10 @@ -1,8 +1,8 @@ -# check for presence of canister -# check canister type in tank storage -# set target pressure accordingly -# run volume pump until target pressure in canister is reached -# stop volume pump +# 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 !!! alias canister_storage d0 alias volume_pump d1 @@ -10,6 +10,37 @@ alias volume_pump d1 alias canister_present r0 alias canister_hash r1 alias canister_pressure r2 +alias canister_hasroom r3 +alias fill_pressure r4 +alias pump_active r5 define canister 42280099 -define smart_canister -668314371 \ No newline at end of file +define smart_canister -668314371 + +start: +# check if canister is present +ls canister_present canister_storage 0 Occupied +# identify canister +ls canister_hash canister_storage 0 OccupantHash +# set safe fill-pressure +beq canister_hash canister regular +beq canister_hash smart_canister smart + +regular: +move fill_pressure 8000000 # regular can safe max +j fill # start filling + +smart: +move fill_pressure 1400000 # smart can safe max +j fill # start filling + +fill: +# get canister pressure in Pa +ls canister_pressure canister_storage 0 Pressure +# is there room in the canister for more gas? +slt canister_hasroom canister_pressure fill_pressure +# is there a can in the slot that has room? +and pump_active canister_hasroom canister_present +# trigger volume pump +s volume_pump On pump_active +j start \ No newline at end of file