What you learn today
- Temperature and pressure in the furnace
- Read the contents
- Activate and Open
Ore in, gas in, spark – and then? Whoever just waits for the result at the furnace often gets slag instead of ingots. A chip sees what goes on inside the furnace and opens the mould only when it fits.
What the furnace reveals
The furnace (StructureFurnace) has an internal volume of 1,000 litres of its own. From it you read:
| LogicType | Meaning |
|---|---|
Temperature, Pressure, TotalMoles | state of the gas in the furnace |
Combustion | 1 while something burns in the furnace |
Reagents | total amount of molten material |
RecipeHash | prefab hash of the ingot that would come out now, otherwise 0 – in the right temperature and pressure window and with a fitting mixture |
Mode | only the display on the furnace: 1 when a recipe fits |
Slot 0 is the input, slot 1 the output. You can read both with Occupied, OccupantHash and Quantity.
Activate: the spark
Activate 1 ignites: the furnace gives off a small spark (5 J). Combustible gas in the furnace catches fire, and ice in the input melts. Without fuel nothing happens – the spark alone does not heat.
Open: the mould
Open means “open the mould” on the furnace. If it is open, the furnace outputs what it has melted:
- if the mixture fits (
RecipeHashnot 0), ingots come out, - if it does not, slag comes out, a reagent mix. You first have to separate it back into ores in the centrifuge.
The furnace recalculates RecipeHash every tick from the content, the temperature and the pressure. If nothing is molten, it is 0. That is why the chip only opens the mould when RecipeHash is not 0 and the furnace answers at all:
snez open recipe
and open open ok
sbn FURNACE HASH("Ofen") Open open
Many old scripts open the mould via Mode. That is only the display on the device: the game refreshes it only while the furnace is being drawn on a screen. On a dedicated server that never happens – Mode stays put and the mould never opens. Use RecipeHash.
Gas and pressure
The simple furnace equalises with its input and output pipe. So you control how much gas comes in and goes out with pumps and valves on those pipes – that is the topic the day after tomorrow. Tomorrow we look at which windows the alloys need.
If the pressure in the furnace is more than 60,795 kPa above or below its surroundings, the furnace can explode. It gets expensive long before that: the pressure rises with every combustion.
Units on the display
Temperature comes in Kelvin. The display in mode DisplayMode.Celsius does not convert, so you subtract 273.15 yourself:
sub temp temp CELSIUSOFFSET
sbn DISP HASH("Ofentemp") Mode DisplayMode.CelsiusExercise
Task
The furnace is named “Ofen”. Show the temperature in °C on “Ofentemp” (mode DisplayMode.Celsius) and the pressure on “Ofendruck”. Open the mould only when RecipeHash is not 0 – then the light “Bereit” is on as well. Mode is only the display on the furnace, the chip ignores it. The button “Zuenden” passes its Activate on to the furnace. If the furnace is missing: temperature −999, pressure −1, “Bereit” off.
Hints
Hint 1
Celsius: sub temp temp CELSIUSOFFSET, then select temp ok temp MISSING.
Hint 2
Mould: snez open recipe, then guard against failure with and open open ok – snez returns 1 for NaN.
Hint 3
Ignite: read the button's Activate and write it to the furnace.
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