# needs two volume pumps and a pipe analyzer # fill_pump points to the tank storage # evac_pump points back to the gas-feed # analyzer is on a pipe between punps and tank # !!! Remember to set volume pump to 10l !!! alias tank_stor d0 alias fill_pump d1 alias evac_pump d2 alias analyzer d3 alias tank_in r0 alias tank_hash r1 alias stor_press r2 alias gas_move r3 alias fill_press r4 define canister_hash 42280099 define smart_canister_hash -668314371 start: s evac_pump On 0 # stop evac_pump s fill_pump On 0 # stop fill_pump ls tank_in tank_stor 0 Occupied # check tank in beqz tank_in evac bgtz tank_in setpress evac: ls tank_in tank_stor 0 Occupied # check tank in bgtz tank_in start l stor_press analyzer Pressure # get pipe pressure beqz stor_press start # pressure =0, stop evac s evac_pump On 1 j evac setpress: ls tank_hash tank_stor 0 OccupantHash # ident tank # set safe fill-pressure beq tank_hash canister_hash regular beq tank_hash smart_canister_hash smart regular: move fill_press 8000000 # regular tank safe max j fill # start filling smart: move fill_press 18000000 # smart tank safe max j fill # start filling fill: ls tank_in tank_stor 0 Occupied # check tank in beqz tank_in start ls stor_press tank_stor 0 Pressure # get tank press slt gas_move stor_press fill_press # room for more? bltz gas_move start # tank is full, go to start s fill_pump On gas_move # trigger fill pump j fill