What you learn today
- Sort and smelt ore
- Count ingots
- Monitor the chain
The arc furnace alone is not yet a smelter. Ore has to go in sorted, ingots have to go into storage in order, and when something jams somewhere, somebody should notice before the ore store overflows.
Sorting and smelting ore
The arc furnace accepts everything that fits into an ore slot. That includes ice and biomass. Biomass turns into charcoal in it. Ice on the other hand simply melts: its gas ends up in the air around the furnace, there are no ingots. Dirty ore from the deep miner even vanishes without a trace. That is why a sorter stands in front of the furnace and only lets real ores through. How that works you learn in week 35. For today: the chain begins with sorted ore.
Counting ingots
The ingots end up in a locker “Barren”, mixed: iron, copper, silicon. For the iron ingots the chip checks every slot for the prefab hash and counts only the matching ones:
lbns kind LOCKER HASH("Barren") i OccupantHash Average
lbns tmp LOCKER HASH("Barren") i Quantity Average
seq kind kind IRON_INGOT
select tmp kind tmp 0
add ingots ingots tmp
select instead of mul: if the locker were gone, tmp would be NaN, and NaN · 0 stays NaN. select then cleanly returns 0.
According to the game data an ingot stack holds 500 pieces, an ore stack 50.
Watching the chain
How do you notice that the chain stands still? Ore lies in the furnace's input slot (slot 0), but no stack is running (Activate 0). Briefly that is normal – between two stacks. If it stays like that, something is wrong: no power, furnace switched off, no chip that starts the stack. Idle does not help here: on the arc furnace it is always 1.
seqz act act
and tmp tmp act
add count count 1
mul count count tmp
The same counter trick as for the jam. This time it counts passes of the loop instead of ticks: the counting loop over 30 slots needs 210 instructions, so two ticks per pass. For a watch like this that does not matter.
If the furnace is missing, Activate is NaN. The light reports that straight away too – a chain without a furnace is certainly standing still.
Exercise
Task
Count only the iron ingots (ItemIronIngot, no other kinds) in all 30 slots of the locker “Barren” and show them on “Eisenbarren”. The light “Kette” is on when ore lies in slot 0 of the arc furnace “Lichtbogen” but the furnace has not been smelting a stack (Activate 0) for more than 20 passes in a row – or when the furnace is missing.
Hints
Hint 1
Per slot: read OccupantHash and Quantity, seq with IRON_INGOT, select tmp kind tmp 0.
Hint 2
Chain: slot 0 occupied and Activate 0 (seqz), then counter with add and mul. On the arc furnace Idle is always 1.
Hint 3
Missing furnace: snan on Activate and or it into the light.
Quiz
4 questions. You pass from 60 % – the server does the grading.
Complete the day
- Passed the simulator exercise
- Passed the quiz with at least 60 %
Without an account progress is saved in this browser only.
Report a mistake in this lesson
Please sign in to report. Sign in