Merge branch 'main' of https://github.com/SnorreSelmer/stationeers_ic10
This commit is contained in:
commit
38130d2000
18
auto_arc_furnace.ic10
Normal file
18
auto_arc_furnace.ic10
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
alias furnace d0
|
||||||
|
|
||||||
|
alias import_occupied r0
|
||||||
|
alias active r1
|
||||||
|
alias run_furnace r2
|
||||||
|
|
||||||
|
start:
|
||||||
|
yield
|
||||||
|
ls import_occupied furnace 0 Occupied
|
||||||
|
l active furnace Activate
|
||||||
|
xor run_furnace import_occupied active
|
||||||
|
bgtz run_furnace run
|
||||||
|
j start
|
||||||
|
|
||||||
|
run:
|
||||||
|
bgtz active start # already running = go to start
|
||||||
|
s furnace Activate 1
|
||||||
|
j start
|
33
auto_class_sorter.ic10
Normal file
33
auto_class_sorter.ic10
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# Runs up to six sorters that filter throughput by ItemClass
|
||||||
|
# When looking at the outputs, left = ITEMCLASS, right = everything else
|
||||||
|
|
||||||
|
alias occupied r0
|
||||||
|
alias input_class r1
|
||||||
|
alias is_class r2
|
||||||
|
alias sorter_counter r3
|
||||||
|
|
||||||
|
move sorter_counter 0
|
||||||
|
|
||||||
|
define ITEMCLASS 19 # 10=ores, 19=ingots, 33=wrekage
|
||||||
|
define INPUTSLOT 0 # sorter input-slot
|
||||||
|
|
||||||
|
start:
|
||||||
|
jal sort
|
||||||
|
add sorter_counter sorter_counter 1
|
||||||
|
bgt sorter_counter 5 reset
|
||||||
|
j start
|
||||||
|
|
||||||
|
sort:
|
||||||
|
bdns dr3 ra
|
||||||
|
s dr3 Mode 2 # set sorter to IC mode
|
||||||
|
ls occupied dr3 INPUTSLOT Occupied # check if anything to sort
|
||||||
|
beqz occupied ra
|
||||||
|
ls input_class dr3 INPUTSLOT Class
|
||||||
|
seq is_class input_class ITEMCLASS # change seq to sne to swap output ports
|
||||||
|
s dr3 Output is_class
|
||||||
|
j ra
|
||||||
|
|
||||||
|
reset:
|
||||||
|
yield
|
||||||
|
move sorter_counter 0
|
||||||
|
j start
|
@ -16,8 +16,8 @@ alias gas_to_move r3
|
|||||||
alias fill_pressure r4
|
alias fill_pressure r4
|
||||||
alias pump_active r5
|
alias pump_active r5
|
||||||
|
|
||||||
define canister 42280099
|
define CANISTER 42280099
|
||||||
define smart_canister -668314371
|
define SMART_CANISTER -668314371
|
||||||
|
|
||||||
start:
|
start:
|
||||||
yield
|
yield
|
||||||
@ -26,8 +26,8 @@ ls canister_present canister_storage 0 Occupied
|
|||||||
# identify canister
|
# identify canister
|
||||||
ls canister_hash canister_storage 0 OccupantHash
|
ls canister_hash canister_storage 0 OccupantHash
|
||||||
# set safe fill-pressure
|
# set safe fill-pressure
|
||||||
beq canister_hash canister regular
|
beq canister_hash CANISTER regular
|
||||||
beq canister_hash smart_canister smart
|
beq canister_hash SMART_CANISTER smart
|
||||||
|
|
||||||
regular:
|
regular:
|
||||||
move fill_pressure 8000000 # regular can safe max
|
move fill_pressure 8000000 # regular can safe max
|
||||||
|
@ -11,7 +11,7 @@ alias temp_go r2
|
|||||||
alias press_go r3
|
alias press_go r3
|
||||||
alias pump_go r4
|
alias pump_go r4
|
||||||
|
|
||||||
define temp_thresh 313 # 39.85C
|
define TEMP_THRESH 313 # 39.85C
|
||||||
|
|
||||||
# Sets volume pump max capacity
|
# Sets volume pump max capacity
|
||||||
l pipe_press pump Maximum
|
l pipe_press pump Maximum
|
||||||
@ -23,7 +23,7 @@ yield
|
|||||||
l pipe_temp sensor Temperature
|
l pipe_temp sensor Temperature
|
||||||
l pipe_press sensor Pressure
|
l pipe_press sensor Pressure
|
||||||
# Checks if temp is below threshold
|
# Checks if temp is below threshold
|
||||||
slt temp_go pipe_temp temp_thresh
|
slt temp_go pipe_temp TEMP_THRESH
|
||||||
sgtz press_go pipe_press
|
sgtz press_go pipe_press
|
||||||
# If cooling-tower has pressure, and temp is safe..
|
# If cooling-tower has pressure, and temp is safe..
|
||||||
and pump_go temp_go press_go
|
and pump_go temp_go press_go
|
||||||
|
@ -18,53 +18,57 @@ alias filter1 r1
|
|||||||
alias filter2 r2
|
alias filter2 r2
|
||||||
alias tank_press r3
|
alias tank_press r3
|
||||||
alias button r4
|
alias button r4
|
||||||
alias temp_run r5
|
alias filter_run r5
|
||||||
alias press_run r6
|
alias filter_test r6
|
||||||
alias filter_run r7
|
alias purge_run r7
|
||||||
alias purge_run r8
|
alias has_gas r8
|
||||||
|
|
||||||
define max_press 58000 # 58MPa
|
define MAX_PRESS 58000 # 58MPa
|
||||||
define max_temp 313 # 40C
|
define MAX_TEMP 313 # 40C
|
||||||
|
|
||||||
|
l r9 purge_pump Maximum
|
||||||
|
s purge_pump Setting r9
|
||||||
|
|
||||||
l filter1 purge_pump Maximum # borrow filter1
|
|
||||||
s purge_pump Setting filter1 # set max throughput
|
|
||||||
s filter_display Color 4 # red
|
s filter_display Color 4 # red
|
||||||
|
|
||||||
start:
|
start:
|
||||||
yield
|
yield
|
||||||
s purge_pump On 0 # ensure pump is off
|
s purge_pump On 0
|
||||||
ls filter1 filter_unit 0 Quantity # check r-filter
|
ls filter1 filter_unit 0 Quantity
|
||||||
ls filter2 filter_unit 1 Quantity # check l-filter
|
ls filter2 filter_unit 1 Quantity
|
||||||
beqz filter1 swap_filter_1 # right filter spent
|
beqz filter1 swap_filter_1
|
||||||
beqz filter2 swap_filter_2 # left filter spent
|
beqz filter2 swap_filter_2
|
||||||
s filter_display On 0 # turn off filter display
|
s filter_display On 0
|
||||||
l purge_run purge_button Setting # check purge
|
l purge_run purge_button Setting
|
||||||
bgtz purge_run purge # run purge if triggered
|
bgtz purge_run purge
|
||||||
j filter # or start filtering
|
j filter
|
||||||
|
|
||||||
swap_filter_1: # if right filter needs swapping
|
swap_filter_1: # if right filter needs swapping
|
||||||
s filter_display Setting 1
|
s filter_display Setting 1
|
||||||
s filter_display On 1
|
s filter_display On 1
|
||||||
j filter # then start filtering
|
j filter # then continue filtering
|
||||||
|
|
||||||
swap_filter_2: # if left filter needs swapping
|
swap_filter_2: # if left filter needs swapping
|
||||||
s filter_display Setting 2
|
s filter_display Setting 2
|
||||||
s filter_display On 1
|
s filter_display On 1
|
||||||
j filter # then start filtering
|
j filter # then continue filtering
|
||||||
|
|
||||||
filter:
|
filter:
|
||||||
l mud_temp mud_sensor Temperature # get input temp
|
l mud_temp mud_sensor Temperature
|
||||||
l tank_press tank Pressure # get output pressure
|
l tank_press tank Pressure
|
||||||
slt temp_run mud_temp max_temp # is temp safe
|
l has_gas mud_sensor RatioCarbonDioxide
|
||||||
slt press_run tank_press max_press # is press safe
|
sgtz has_gas has_gas
|
||||||
and filter_run temp_run press_run # temp and press?
|
slt filter_run mud_temp MAX_TEMP
|
||||||
s filter_unit On filter_run # run filter
|
slt filter_test tank_press MAX_PRESS
|
||||||
j start # loop
|
and filter_run filter_run filter_test
|
||||||
|
and filter_run filter_run has_gas
|
||||||
|
s filter_unit On filter_run
|
||||||
|
j start
|
||||||
|
|
||||||
purge: # purge button pressed
|
purge:
|
||||||
yield
|
yield
|
||||||
s filter_unit On 0 # stop filtering
|
s filter_unit On 0
|
||||||
l tank_press tank Pressure # check pressure
|
l tank_press tank Pressure
|
||||||
s purge_pump On 1 # run evac-pump
|
s purge_pump On 1
|
||||||
bgtz tank_press purge # keep sucking until tank dry
|
bgtz tank_press purge
|
||||||
j start # begin filtering
|
j start
|
@ -20,9 +20,9 @@ alias mixer_run r6
|
|||||||
alias purge_activate r7
|
alias purge_activate r7
|
||||||
|
|
||||||
# Stops mixing if either input-gas is below 500kPa
|
# Stops mixing if either input-gas is below 500kPa
|
||||||
define press_in_min 500
|
define PRESS_IN_MIN 500
|
||||||
# Stops mixing if output-tank is "full"
|
# Stops mixing if output-tank is "full"
|
||||||
define press_out_max 58000
|
define PRESS_OUT_MAX 58000
|
||||||
|
|
||||||
# Sets purge pump to max output
|
# Sets purge pump to max output
|
||||||
l tank_a_press pump Maximum
|
l tank_a_press pump Maximum
|
||||||
@ -41,9 +41,9 @@ l tank_b_press tank_b Pressure
|
|||||||
l tank_out_press tank_out Pressure
|
l tank_out_press tank_out Pressure
|
||||||
|
|
||||||
# Checks if pressures are within tolerances
|
# Checks if pressures are within tolerances
|
||||||
sgt tank_a_ok tank_a_press press_in_min
|
sgt tank_a_ok tank_a_press PRESS_IN_MIN
|
||||||
sgt tank_b_ok tank_b_press press_in_min
|
sgt tank_b_ok tank_b_press PRESS_IN_MIN
|
||||||
slt tank_out_ok tank_out_press press_out_max
|
slt tank_out_ok tank_out_press PRESS_OUT_MAX
|
||||||
|
|
||||||
and mixer_run tank_a_ok tank_b_ok
|
and mixer_run tank_a_ok tank_b_ok
|
||||||
and mixer_run tank_out_ok mixer_run
|
and mixer_run tank_out_ok mixer_run
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
alias gas_sensor d0
|
alias gas_sensor d0
|
||||||
alias thermostat d1 # Logic Switch, Dial variant (Max=30)
|
# d1= Logic Switch, Dial variant (Max=30)
|
||||||
alias temp_variance d2 # Logic Memory, must be more than 0 (2 is a good value)
|
alias thermostat d1
|
||||||
|
# d2 = Logic Memory, must be more than 0
|
||||||
|
alias temp_variance d2
|
||||||
|
# d3 = Console, LED Display variant, optional
|
||||||
|
alias temp_disp d3
|
||||||
|
|
||||||
alias curr_temp r0
|
alias curr_temp r0
|
||||||
alias target_temp r1
|
alias target_temp r1
|
||||||
alias variance r2
|
alias variance r2
|
||||||
@ -9,10 +14,13 @@ alias max_temp r4
|
|||||||
alias cooling_active r5
|
alias cooling_active r5
|
||||||
alias heating_active r6
|
alias heating_active r6
|
||||||
|
|
||||||
define wall_heaters 24258244 # Wall Heaters
|
define WALL_HEATERS 24258244
|
||||||
define wall_coolers -739292323 # Wall Coolers (Gas)
|
define WALL_COOLERS -739292323
|
||||||
define liquid_wall_coolers -1369060582 # Wall Coolers (Liquid)
|
define LIQUID_WALL_COOLERS -1369060582
|
||||||
define temp_convert 273
|
define TEMP_CONVERT 273.15
|
||||||
|
|
||||||
|
move cooling_active 0
|
||||||
|
move heating_active 0
|
||||||
|
|
||||||
start:
|
start:
|
||||||
yield
|
yield
|
||||||
@ -23,54 +31,64 @@ sub min_temp min_temp variance
|
|||||||
l max_temp thermostat Setting
|
l max_temp thermostat Setting
|
||||||
add max_temp max_temp variance
|
add max_temp max_temp variance
|
||||||
|
|
||||||
# initiate target temperature
|
|
||||||
l target_temp thermostat Setting
|
l target_temp thermostat Setting
|
||||||
|
|
||||||
# read ambient temp from sensor and convert to C
|
# get current temperature
|
||||||
l curr_temp gas_sensor Temperature
|
jal temp_read
|
||||||
sub curr_temp curr_temp temp_convert
|
|
||||||
|
# update display
|
||||||
|
brdns temp_disp 2
|
||||||
|
jal display
|
||||||
|
|
||||||
# compare current temp to max/min temp and
|
# compare current temp to max/min temp and
|
||||||
# initiate cooling or heating if needed
|
# initiate cooling or heating if needed
|
||||||
bgt curr_temp max_temp cooling
|
bgt curr_temp max_temp cooling
|
||||||
blt curr_temp min_temp heating
|
blt curr_temp min_temp heating
|
||||||
|
|
||||||
# Go to start again
|
sb WALL_COOLERS On cooling_active
|
||||||
|
sb LIQUID_WALL_COOLERS On cooling_active
|
||||||
|
sb WALL_HEATERS On heating_active
|
||||||
|
|
||||||
j start
|
j start
|
||||||
|
|
||||||
|
temp_read:
|
||||||
|
l curr_temp gas_sensor Temperature
|
||||||
|
sub curr_temp curr_temp TEMP_CONVERT
|
||||||
|
j ra
|
||||||
|
|
||||||
|
display:
|
||||||
|
s temp_disp Setting curr_temp
|
||||||
|
j ra
|
||||||
|
|
||||||
cooling:
|
cooling:
|
||||||
yield
|
yield
|
||||||
# read ambient temp from sensor and convert to C
|
jal temp_read
|
||||||
l curr_temp gas_sensor Temperature
|
|
||||||
sub curr_temp curr_temp temp_convert
|
|
||||||
|
|
||||||
# test if coolers need to be on or not
|
# test if coolers need to be on or not
|
||||||
sgt cooling_active curr_temp target_temp
|
sgt cooling_active curr_temp target_temp
|
||||||
|
|
||||||
|
brdns temp_disp 2
|
||||||
|
jal display
|
||||||
|
|
||||||
# send state to coolers
|
# send state to coolers
|
||||||
sb wall_coolers On cooling_active
|
sb WALL_COOLERS On cooling_active
|
||||||
sb liquid_wall_coolers On cooling_active
|
sb LIQUID_WALL_COOLERS On cooling_active
|
||||||
|
|
||||||
# if curr_temp is higher than target, keep cooling
|
bgtz cooling_active cooling
|
||||||
bgt curr_temp target_temp cooling
|
|
||||||
|
|
||||||
# ...if not, go to start again
|
|
||||||
j start
|
j start
|
||||||
|
|
||||||
heating:
|
heating:
|
||||||
yield
|
yield
|
||||||
# read ambient temp from sensor and convert to C
|
jal temp_read
|
||||||
l curr_temp gas_sensor Temperature
|
|
||||||
sub curr_temp curr_temp temp_convert
|
|
||||||
|
|
||||||
# test if heaters need to be on or not
|
# test if heaters need to be on or not
|
||||||
slt heating_active curr_temp target_temp
|
slt heating_active curr_temp target_temp
|
||||||
|
|
||||||
|
brdns temp_disp 2
|
||||||
|
jal display
|
||||||
|
|
||||||
# send state to heaters
|
# send state to heaters
|
||||||
sb wall_heaters On heating_active
|
sb WALL_HEATERS On heating_active
|
||||||
|
|
||||||
# if curr_temp is lower than target, keep heating
|
bgtz heating_active heating
|
||||||
blt curr_temp target_temp heating
|
|
||||||
|
|
||||||
# ...if not, go to start again
|
|
||||||
j start
|
j start
|
23
printer_countdown.ic10
Normal file
23
printer_countdown.ic10
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
alias dial d0
|
||||||
|
alias order_display d1
|
||||||
|
alias remaining_display d2
|
||||||
|
alias printer d3
|
||||||
|
|
||||||
|
alias order_count r0
|
||||||
|
alias export_count r1
|
||||||
|
alias remaining_count r2
|
||||||
|
|
||||||
|
move remaining_count 0
|
||||||
|
|
||||||
|
start:
|
||||||
|
yield
|
||||||
|
l order_count dial Setting
|
||||||
|
s order_display Setting order_count
|
||||||
|
l export_count printer ExportCount
|
||||||
|
sub remaining_count order_count export_count
|
||||||
|
s remaining_display Setting remaining_count
|
||||||
|
bgtz remaining_count start
|
||||||
|
s printer ClearMemory 1
|
||||||
|
s dial Setting 0
|
||||||
|
s printer Activate 0
|
||||||
|
j start
|
Loading…
Reference in New Issue
Block a user