Initial commit
This commit is contained in:
parent
21c7e6c1c1
commit
17edfceec3
37
auto_class_sorter.ic10
Normal file
37
auto_class_sorter.ic10
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# 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
|
||||||
|
alias is_ready r4
|
||||||
|
|
||||||
|
move sorter_counter 0
|
||||||
|
|
||||||
|
define ITEMCLASS 19 # 10=ores, 19=ingots, 33=wrekage
|
||||||
|
define INPUTSLOT 0 # sorter input-slot
|
||||||
|
define OUTPUTCYCLE -1
|
||||||
|
|
||||||
|
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
|
||||||
|
l is_ready dr3 Output
|
||||||
|
bgt is_ready OUTPUTCYCLE start
|
||||||
|
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
|
Loading…
Reference in New Issue
Block a user