Added comments, minor cleanup

This commit is contained in:
Snorre Selmer 2023-03-30 16:40:34 +02:00
parent 9e5dccc05b
commit 1e1f1155c0
4 changed files with 13 additions and 5 deletions

View File

@ -1,3 +1,8 @@
# Controls Sorters to sort items based on hash.
# Reads item-hashes from stack to decide if it
# should be split off or passed on.
# Connect one Sorter to each screw on the IC.
alias counter r0 alias counter r0
move counter 0 move counter 0
@ -8,6 +13,7 @@ alias IsItem r4
define INPUTSLOT 0 define INPUTSLOT 0
# Replace hashes below with the ones you need.
push 1724793494 # Coal push 1724793494 # Coal
push -983091249 # Cobalt push -983091249 # Cobalt
push -707307845 # Copper push -707307845 # Copper
@ -20,12 +26,15 @@ push -190236170 # Lead
#push -1516581844 # Uranium #push -1516581844 # Uranium
start: start:
# Loops over screws to instruct attached Sorters,
# loops over all sorters every tick.
bdseal dr0 sort bdseal dr0 sort
add counter counter 1 add counter counter 1
bgt counter 5 reset bgt counter 5 reset
j start j start
sort: sort:
# Compares Sorter input-slot with hash in stack
move sp counter move sp counter
add sp sp 1 add sp sp 1
peek hash peek hash
@ -38,6 +47,7 @@ s dr0 Output IsItem
j ra j ra
reset: reset:
# Resets counter to 0 zero so we can loop over again
move counter 0 move counter 0
yield yield
j start j start

View File

@ -1,6 +1,4 @@
# automatic gas-canister filler. # 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 !!! # !!! Remember to set volume pump to no more !!!
# !!! than 10l! I have mine at 2l for safety !!! # !!! than 10l! I have mine at 2l for safety !!!

View File

@ -106,4 +106,4 @@ beqz FilterHash ra
#if you are still here then it is an error so end #if you are still here then it is an error so end
s filtration On 0 s filtration On 0
j start j start

View File

@ -89,4 +89,4 @@ bdseal TempDisplay display
sb Heater On HeatingActive sb Heater On HeatingActive
bgtz HeatingActive heating bgtz HeatingActive heating
j start j start