SFM examples
Six worked programs from the TheVoos tutorial, for basic moves, Ars Nouveau, Powah, Productive Bees and Hostile Neural Networks, with notes for 4.34.
Applies to: ATM-10 8.6 · All the Mons 2.2.0 · ATM-11 0.16.0-beta
These come from
TheVoos’s SFM tutorial. The
label names (barrel, orb…) are whatever you label with the gun. Notes in
the quotes mark where SFM 4.34 behaves differently from the video, from
the language page. read
1. Items, power and fluid#
Moves items from a barrel to a chest, energy every tick, and water into a tank (3:40).
name "Basic Logistics"
every tick do
input fe:: from power_source bottom side
output fe:: to energy_cube top side
end
every 20 ticks do
input from barrel
output to chest
forget
input fluid::water from sink
output fluid:: to fluid_tank top side
end
2. Ars Nouveau source gems#
Keeps one amethyst shard in every imbuement chamber and takes out only finished source gems (21:31).
name "Source Gem Automation"
every 20 ticks do
input from amethyst_drawer
output retain 1 to each imbuement_chamber
forget
input source_gem from imbuement_chamber
output to gem_drawer
end
each makes the retain 1 apply to every chamber separately. Without it, one
shard would be shared across the whole group.
3. Powah energizing orb#
The orb jams if it gets ingredients for two recipes at once, so this feeds exact amounts only when it’s empty (25:56).
name "Powah Energizing Automation"
every 20 ticks do
-- Energized Steel (1 Iron + 1 Gold)
if chest has >= 1 iron_ingot and chest has >= 1 gold_ingot and orb has = 0 then
input 1 each *ingot* from chest
output to orb
-- Blazing Crystal (1 Blaze Rod)
else if chest has >= 1 blaze_rod and orb has = 0 then
input 1 blaze_rod from chest
output to orb
end
forget
-- Extract completed items
if orb has *energized* or orb has *crystal* then
input from orb
output to chest
end
end
4. Productive Bees: breeding and incubating#
Powers both machines, keeps empty cages and two flowers in the breeder and 20 honey treats in the incubator by slot number, and moves baby bees along (36:42). The video’s program leaves out the empty cages; it’s corrected here.
name "Bee Breeding and Incubation"
every tick do
input fe:: from ender_cell
output fe:: to breeder, incubator
end
every 20 ticks do
-- Empty cages for the babies (slot 0): no cage, no finished cycle
input bee_cage from chest
output retain 4 to each breeder slots 0
forget
input poppy from chest
output retain 2 to each breeder slots 3-4
forget
input honey_treat from chest
output retain 20 to each incubator slots 1
forget
-- Move bred baby bee (slot 5) to incubator input (slot 0)
input from breeder slots 5
output to incubator slots 0
forget
-- Extract adult bee (slot 2) to storage
input from incubator slots 2
output to chest
end
In Productive Bees 13.14.0 the Breeding Chamber’s slots are: 0 empty cages, 1-2 the parent bees in cages, 3-4 breeding items, 5 the baby. The Incubator’s are: 0 the caged baby, 1 honey treats, 2 the adult. read (Breeding Chamber, Incubator)
- The chamber only finishes a cycle when slot 0 holds an empty cage and slot 5 is empty. Without one it keeps the bees and the power draw, and nothing comes out. read An open issue reports the power draw (#711).
- It takes 6,000 ticks, five minutes, per baby at 50 FE/t, and uses the breeding items when it starts. read
- Poppies suit any bee whose breeding item is a flower, the default. Some bees ask for something else; check the bee in JEI. read
5. Productive Bees: centrifuge, smelting and honey#
Tags, an except filter and round robin by block turn combs into ingots,
storage items and liquid honey
(40:25).
name "Bee Resource Automation"
every tick do
input fe:: from ender_cell
output fe:: to centrifuge, furnace
end
every 20 ticks do
-- Keep 2 glass bottles in slot 0 of every beehive
input glass_bottle from drawer
output retain 2 to each beehive slots 0
forget
-- Honey bottles and honeycomb to storage; spread the combs over centrifuges
input from beehive
output honeycomb, honey_bottle to drawer
output to centrifuge round robin by block
forget
-- Smelt raw ores; send everything else (but raw ores) to the drawer
input from centrifuge, furnace bottom side
output with tag c:raw_materials to furnace top side
output except *raw* to drawer
forget
-- Liquid honey out of the centrifuges
input fluid:: from centrifuge
output fluid:: to drawer
end
The order matters: the furnace line comes first, so raw materials go there,
and except *raw* keeps them out of the drawer.
What the hive and centrifuge allow, read from Productive Bees 13.14.0 and its library: read
- SFM can’t take from a hive’s input slots (0, the bottles, and 1), only
from its outputs, 2 to 10. So
input from beehivenever pulls the bottles back out. - Only the Heated Centrifuge processes comb blocks. A hive makes them only with a Block upgrade (or Productivity IV); without one it gives single combs, which any centrifuge takes.
- A centrifuge accepts items it can’t process into its output slots. Comb blocks or genes sent to a plain centrifuge sit there until the next line moves them on. Here that’s the drawer line, so nothing jams, but don’t count on the centrifuge to refuse them.
6. Hostile Neural Networks#
Keeps prediction matrices in slot 1, sends generalised predictions (slot 2) to storage and mob predictions (slot 3) to the loot fabricator, and collects drops (52:13).
name "Hostile Neural Networks"
every tick do
input fe:: from ender_cell
output fe:: to sim_chamber, loot_fabricator
end
every 20 ticks do
input prediction_matrix from barrel
output retain 2 to each sim_chamber slots 1
forget
input from sim_chamber slots 2
output to barrel
forget
input from sim_chamber slots 3
output to loot_fabricator
forget
input from loot_fabricator
output to barrel
end