What you learn today
- Check materials, fabricate, report
- Detect jams
- Status display
This week showed you the parts: rmap and lr for missing material, fabricators via logic, centrifuge and jam, ice crusher, start lock. Now you build a small production line that explains itself.
The plant
| Device | Prefab | Name |
|---|---|---|
| autolathe | StructureAutolathe | “Drehbank” |
| button | StructureLogicButton | “Start” |
| two LED displays | StructureConsoleLED5 | “Status”, “Fortschritt” |
The lathe makes iron frames. One piece needs 4 iron.
One status instead of many lights
| Status | Meaning | Colour |
|---|---|---|
| 0 | ready | green |
| 1 | fabricating | blue |
| 2 | material missing | yellow |
| 3 | jam at the output | red |
| 4 | lathe unreachable | red |
The chip checks from unimportant to important, every hit overwrites the previous one. Fabricating beats material shortage: a running job already has its material. A jam beats both, and the missing lathe beats everything.
Starting only in status 0
bnez status start
If the status is not “ready”, the chip jumps back before it even reads the button. That way nobody starts a job without material or into a jam.
Milestones
- Check material: below 4 units status 2, otherwise 0
- Fabricate: start by button, status 1 during the job
- Progress in percent
- Jam after 20 ticks of occupied output: status 3, red
- Lathe missing: status 4, red
The colour depends only on the status. First yellow or green with select colour status … – every status other than 0 starts as yellow –, then blue for 1 and red from 3. Three lines, no jump.
Project task
Task
Build the production line following the tables. The lathe makes iron frames (ItemIronFrames). defines and reading are there, recipe choice, status, colours, progress and the start are missing.
Milestones
- Milestone 1: check material
- Milestone 2: fabricate by button
- Milestone 3: progress
- Milestone 4: detect a jam
- Milestone 5: lathe missing
Hints
Hint 1
Status: move status READY, then shortage, working, jam, missing – each with select status … status.
Hint 2
Jam counter as with the centrifuge: add, then mul with “slot 1 occupied”.
Hint 3
Start: bnez status start, check the button with sgtz, then Activate 1.
Quiz
2 questions. You pass from 60 % – the server does the grading.
Complete the day
- Passed all milestones of the project
- 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