Super Factory Manager (SFM)

Adds a certain magical factory manager to the game.
Super Factory Manager moves items, fluids, energy and Mekanism chemicals between the blocks on a cable network, following a short program you type. You need three things: a Factory Manager, a Label Gun to name the blocks, and a Program Disk to hold the program. Join everything with Inventory Cable and write a program like EVERY 20 TICKS DO INPUT FROM a OUTPUT TO b END.
On this page
- Your first Factory Manager, step by step
- The Factory Manager and the cables
- The Label Gun: naming chests and machines
- The Program Disk and the editor
- Triggers: EVERY ticks, seconds and redstone pulses
- INPUT, OUTPUT and FORGET
- What to move: items, fluids, energy and chemicals, and filters
- Limits: how many, and RETAIN
- Sides and slots
- IF: acting on what a chest holds, or on redstone
- Example programs to copy
- The Network Tool and facades
- Our server's SFM settings, and when a manager stops
- Water Tank, Printing Press and experience shards
- Questions
Your first Factory Manager, step by step
- Craft a Factory Manager, a stack of Inventory Cable, a Label Gun and a Program Disk.
- Place the manager and run cables from it so that every chest and machine you want to use touches a cable. The manager counts as a cable itself.
- Hold the Label Gun and right-click the air to open it. Type a label, for example
a, then right-click the source chest. Do the same with labelbon the target chest. - Put the disk in the manager, press Edit (or E) and type the program below. Shift+Enter saves it.
- Right-click the manager with the Label Gun to push the labels onto the disk. The manager's screen should now say State: running.
EVERY 20 TICKS DOINPUT FROM aOUTPUT TO bEND
That moves everything from the block labelled a into the block labelled b once a second. Words of the language can be written in capitals or not; every 20 ticks do works the same. Two dashes start a comment: -- this line is ignored.
The Factory Manager and the cables
The Factory Manager is four chests, four Inventory Cables and a Redstone Repeater. It holds one disk and runs the program on it. Its screen shows the state (running, missing disk, no program or invalid program), the peak tick time, the logs, and buttons to paste a program from the clipboard, copy it out, reset the disk, rebuild the cable network, view the examples and view the server's config.
A cable does nothing alone. It only joins blocks to the manager: a chest, tank or machine is part of the network when it touches a cable or the manager. Items never travel through the cables; the manager moves them directly between the blocks when its program says so.
- Inventory Cable
- 16 from a chest, two Iron Bars, two Light Weighted Pressure Plates and four Black Dye. A full block.
- Fancy Inventory Cable
- One Inventory Cable on its own in the grid, and back the same way. A thin pipe with arms toward its neighbours, and it can be waterlogged.
- Tough Inventory Cable
- A cable surrounded by six Obsidian, in either of two shapes. Resists explosions and can be disguised as tougher blocks. A Tough Fancy Cable is made the same way from a Fancy Cable.
- Tunnelled Inventory Cable
- A cable with six fences around it. It passes the block on one side through to the opposite side, so something on the far side can reach it. A Fancy Cable makes a Tunnelled Fancy Cable.
- Tunnelled Factory Manager
- A Factory Manager with six fences. The same pass-through as the tunnelled cable. Crafted alone it turns back into a plain manager.
A manager also listens for redstone. A pulse is counted when the manager, or the block above it, starts receiving power; that is what EVERY REDSTONE PULSE reacts to, and IF REDSTONE reads the signal strength.
The Label Gun: naming chests and machines
A program never names a block by its position; it names labels. A label is any word you choose, many blocks can share one (all your furnaces can be furnace), and one block can carry several. Labels are saved on the disk, so the disk's tooltip lists them with how many blocks each covers. A label can be up to 256 characters.
The Label Gun is two Sticks, a sign, a Blue Dye and a Black Dye. Its controls, with the default keys:
- Right-click the air
- Opens the gun's screen: type a new label, pick one from the list, Clear or Prune.
- Right-click a block
- Puts the active label on it, or takes it off if it is already there.
- Ctrl + right-click
- Does the same to the whole run of touching blocks along the cables, so a wall of barrels takes one click.
- Shift + right-click a block
- Removes the labels from that block.
- Alt + right-click a block
- Picks the label of that block as the active one.
- Right-click the manager
- Pushes the gun's labels onto the manager's disk. This is the step people forget.
- Shift + right-click the manager
- Pulls the disk's labels into the gun instead.
- Shift + mouse wheel
- Cycles through the gun's labels. Left Alt cycles how labels are shown in the world.
The mod's own advice: write the program first, then pull the labels from the manager into the gun, so you never retype them. Blocks that do not touch a cable are skipped, and the gun says how many. Crafting a Label Gun on its own wipes it. A label that is also a word of the language (such as block, one or slot) goes in double quotes in the program: INPUT FROM "block".
The Program Disk and the editor
The Factory Manager Program Disk is two Paper, a red, green and blue dye, a Block of Redstone, a Redstone Repeater and two redstone dust. It holds one program and its labels. You can also edit it outside a manager by right-clicking with it in your hand.
- Edit (or E) opens the text editor, with suggestions as you type. Shift+Enter saves.
- View examples (Ctrl+Shift+E) opens the mod's templates. Load one, then change the labels.
- Paste from clipboard (Ctrl+V) takes a program written elsewhere; Copy to clipboard gives it back.
- When the program has a mistake the manager shows a warning; clicking it copies the program with the errors marked, and the disk lists the problems in its tooltip.
- Reset wipes the program and every label. Crafting a disk on its own does the same.
To copy a disk, use the Printing Press: it takes a Printing Form made from a written disk, a black dye as ink, and a blank disk as paper (see the last section).
Triggers: EVERY ticks, seconds and redstone pulses
A program is an optional NAME "..." and then one or more triggers. Each trigger is EVERY ... DO, some statements, and END. There are two kinds of trigger:
EVERY 20 TICKS DO- Runs every 20 ticks of the manager's own clock.
TICK,SECONDSandSECONDwork too (a second is 20 ticks).EVERY TICK DOmeans every tick. EVERY 5 SECONDS DO- The same in seconds.
EVERY 20 GLOBAL TICKS DO- Uses the world's clock instead, so several managers run on the same tick.
Gis short forGLOBAL:EVERY 20G TICKS DO. EVERY 20 PLUS 5 TICKS DO- Adds an offset, to run a trigger 5 ticks after another.
+is short forPLUS:EVERY 20G+5 TICKS DO. EVERY REDSTONE PULSE DO- Runs once for each redstone pulse the manager received.
The manager's clock starts at zero when it is placed and starts somewhere random after the chunk is unloaded, so use GLOBAL when two triggers must line up. On our server a timer trigger cannot run more often than every 20 ticks, unless it moves only energy (then every tick is allowed); a faster one is refused with "Minimum trigger interval is 20 ticks."
INPUT, OUTPUT and FORGET
Inside a trigger there are four statements: INPUT, OUTPUT, IF and FORGET. An INPUT alone moves nothing and there is no buffer: it only marks where things may come from. Each OUTPUT then pulls from every INPUT above it in the same trigger, straight into the target. Inputs stay active until FORGET or the END of the trigger.
INPUT FROM a- Everything in the blocks labelled
amay be taken. OUTPUT TO b- Moves what the inputs offer into the blocks labelled
b, as much as fits. INPUT FROM a, c- Several labels in one statement, separated by commas.
OUTPUT 8 TO EACH furnaceEACHbefore the label applies the limit to every block separately: 8 into each furnace, not 8 shared between them.OUTPUT TO EMPTY SLOTS IN storage- Only fills empty slots. Lighter on the server when the target is large and nearly full.
FORGET- Drops every active input, so the next
OUTPUTonly takes from inputs written after it.FORGET adrops onlya. OUTPUT TO dest ROUND ROBIN BY BLOCK- Picks one block labelled
desteach time the statement runs, in turn.ROUND ROBIN BY LABELtakes turns between the labels listed instead.
Round robin is slow because it moves to one block per run. The template's own advice is to use RETAIN on each target instead (see limits below). The statement can also start with the label: FROM a INPUT and TO b OUTPUT are the same as the usual order.
What to move: items, fluids, energy and chemicals, and filters
Between INPUT or OUTPUT and FROM or TO you may say what to move. A resource is written type:mod:name, and every part you leave out matches anything. The type is item when you do not give one, and the mod is any mod, so iron_ingot matches every mod's iron_ingot; write minecraft:iron_ingot to be exact.
- Items
stone,minecraft:stone,sfm:item:*:stone: all the same thing. Items are the default.- Fluids
fluid::is every fluid;fluid::wateris water from any mod;fluid:minecraft:wateris exact. Amounts are in mB.- Energy
fe::moves Forge Energy (FE).rf,energy,powerandforge_energyare the same type. A trigger that moves only energy may run every tick.- Mekanism chemicals
chemical::moves gases, infusions, pigments and slurries, because Mekanism is in ATM10. The mod also acceptsgas,infusion,pigmentandslurryas type names.
Filters, all checked against the language: an asterisk is a wildcard (*ingot*); a name in double quotes is a full regular expression (".*ingot.*"); OR joins names under one limit (64 iron_ingot OR gold_ingot); a comma starts a new entry with its own limit; EXCEPT at the end removes names from the whole statement.
INPUT *ingot* EXCEPT iron_ingot, gold_ingot FROM atakes every ingot but iron and gold.INPUT WITH #c:ingots FROM atakes anything in the tag.WITH TAG c:ingotsis the same, and#ingotswithout a mod matches the tag in every namespace.INPUT WITH #c:ores AND NOT #c:ores/iron FROM acombines tags withAND,OR,NOTand brackets.INPUT WITHOUT #c:ores FROM atakes everything that is not in the tag.#c:ores/**matches every tag belowc:ores.
There is no WHERE clause in SFM 4.34: the word is reserved but nothing uses it. Filtering is done with names, patterns, WITH/WITHOUT tags and EXCEPT. Also, EXCEPT takes names only, not WITH tags.
Limits: how many, and RETAIN
A number before a resource caps how much one run of the statement moves. RETAIN keeps an amount back: on an input it leaves that much in the source, on an output it fills the target only up to that much. With no limit an input takes everything and an output accepts everything.
INPUT 64 FROM a- Takes at most 64 per run.
INPUT RETAIN 5 stone FROM a- Takes stone but always leaves 5 behind.
INPUT 10 RETAIN 5 stone FROM a- Both: at most 10 per run, and never the last 5.
OUTPUT RETAIN 1000 fluid::water TO EACH machine- Tops each machine up to 1,000 mB of water and no more.
INPUT 5 EACH *ingot* FROM aEACHafter the number counts every kind separately: 5 of each ingot, not 5 ingots in all.OUTPUT RETAIN 8 EACH *ingot* TO b- Keeps up to 8 of every kind of ingot in
b.
Sides and slots
Machines often give different slots to different faces, like a furnace (top for what to smelt, bottom for the result). Put the sides after the label, then the word SIDE; put the slots after that.
FROM furnace BOTTOM SIDETOP,BOTTOM,NORTH,SOUTH,EASTandWESTare fixed directions.TO press FRONT SIDEFRONT,BACK,LEFTandRIGHTturn with the way the target block faces.FROM a TOP, WEST SIDE- Several sides, separated by commas.
EACH SIDEuses all six. TO a SLOTS 0, 2-4- Only those slots; slots count from 0, and
-gives a range.SLOT 2works too.
With no side, the manager asks the block without a direction, which most chests accept. Mekanism machines are read-only that way, so always give a side for them, matching the machine's own side config. Slot numbers on screen are not always the ones automation sees: open the machine and press I to toggle SFM's container inspector, which shows how many slots automation sees.
IF: acting on what a chest holds, or on redstone
IF ... THEN ... END runs its statements only when the condition holds, with optional ELSE IF ... THEN and ELSE. A condition counts what blocks with a label hold, or reads redstone:
IF storage HAS LT 1000 cobblestone THEN- True when all
storageblocks together hold fewer than 1,000. Comparisons:GT,LT,EQ,LE,GE, or>,<,=,<=,>=. IF SOME a HAS GT 10 iron_ingot THEN- Before the label:
OVERALL(the total, the default),SOME(at least one block),EVERYorEACH(all of them),ONE(exactly one),LONE(one or none). IF a HAS EQ 0 THEN- With no resource it counts everything: true when
ais empty. IF REDSTONE GT 0 THEN- Reads the strongest redstone signal reaching the manager, 0 to 15. Always give the comparison:
IF REDSTONE THENalone is true even with no signal. AND,OR,NOT, brackets- Join conditions:
IF NOT a HAS GT 20 stone AND b HAS GE 20 cobblestone THEN.
Example programs to copy
Type each one into the editor line by line (or paste it), label the blocks with the names used, and push the labels with the gun. All run once a second, the fastest our server allows for items.
Furnace array: chests labelled ores and fuel, every furnace labelled furnace, a chest labelled storage for the results.
NAME "furnaces"EVERY 20 TICKS DOINPUT FROM oresOUTPUT 8 TO EACH furnace TOP SIDEFORGETINPUT FROM fuelOUTPUT RETAIN 4 TO EACH furnace BOTTOM SIDEFORGETINPUT FROM furnace BOTTOM SIDEOUTPUT TO storageEND
Keep a crafting chest stocked: takes from storage and tops workshop up to 64 of each, never more.
EVERY 20 TICKS DOINPUT FROM storageOUTPUT RETAIN 64 iron_ingot, RETAIN 64 gold_ingot, RETAIN 64 redstone TO workshopEND
Sort a drop chest by tag: ingots to ingots, ores to ore_chest, the rest only into empty slots of misc.
EVERY 20 TICKS DOINPUT FROM dropOUTPUT WITH #c:ingots TO ingotsOUTPUT WITH #c:ores TO ore_chestOUTPUT TO EMPTY SLOTS IN miscEND
Overflow: cobblestone goes to storage until it holds 10,000, then to trash (a trash can or a void).
EVERY 20 TICKS DOINPUT cobblestone FROM quarryIF storage HAS LT 10000 cobblestone THENOUTPUT TO storageELSEOUTPUT TO trashENDEND
Power: moves FE from every block labelled gen to every block labelled machine, every tick, which is allowed because the trigger moves only energy.
EVERY TICK DOINPUT fe:: FROM genOUTPUT fe:: TO EACH machineEND
Water for machines, only while a lever on the manager is on: up to 4,000 mB in each machine.
EVERY 20 TICKS DOIF REDSTONE GT 0 THENINPUT fluid::water FROM tankOUTPUT RETAIN 4000 fluid::water TO EACH machineENDEND
The editor's View examples list has more from the mod itself, including one that runs a row of AE2 Inscribers and ones for round robin, tags and slots.
The Network Tool and facades
The Network Tool is a Redstone Lamp, a sign, two Iron Ingots and a Heavy Weighted Pressure Plate. While you hold it, it shows your cables through walls, which finds the gap in a network fast.
- Right-click a block face to see diagnostic information about it.
- Hold the tool in your off-hand and a block in your main hand, then right-click a cable: the cable takes that block's look (a facade).
- Ctrl-click does it to the connected cables, Alt-click to every cable on the network that already looks like the clicked one, and Ctrl+Alt-click to the whole network.
Our server's SFM settings, and when a manager stops
- Fastest timer
- Every 20 ticks (once a second), the mod's default.
- Energy-only triggers
- Every tick allowed, the default.
- Programs
- Allowed to run. No resource type is blocked.
- IF statements
- 10, the default: past 10 IF statements in one trigger the manager no longer simulates every combination of them (2 to the power of their number).
- Problems on a disk
- The first 10 are listed on the disk's tooltip.
Anybody can read the settings in game with the manager's View server config button or /sfm config show.
When a manager stops for no clear reason, the mod's own known issues list says to press Rebuild cable network in its screen, or run /sfm bust_cable_network_cache, which any player may use. One more trap from that list: outputting to a composter without naming a side skips the check for compostable items, so the composter swallows everything.
Water Tank, Printing Press and experience shards
- Water Tank
- Four Iron Bars, two Water Buckets and a Light Weighted Pressure Plate. With two water sources beside it, it is an endless water supply for a program. Active tanks touching each other grow: 1,000 mB for one, doubling with each more.
- Printing Press
- Copies disks, written books, enchanted books and maps. Place it with an air gap under a downward-facing Piston, put in a form, ink and paper, and extend the piston.
- Printing Form
- Drop the thing to copy on a Block of Iron or Block of Copper and let an Anvil fall on it. The item becomes a form and the block is used up.
- Experience Shard
- An anvil falling on enchanted books lying on Obsidian or Crying Obsidian crushes each book into one shard on our server. Nine shards make Experience Goop, the ink for copying enchanted books.
Disk copies: the form is made from a disk with the program, the ink is black dye and the paper is a blank disk. Written books and maps also use black dye; enchanted books use Experience Goop and a plain book.
Questions
Why does my Factory Manager do nothing?
Check the state line in its screen. Missing disk or no program means the disk is not in or is empty; invalid program means a mistake (click the warning to copy it with the errors marked). If it says running, the labels are usually the cause: right-click the manager with the Label Gun to push them onto the disk, and make sure each labelled block touches a cable. Every OUTPUT also needs an INPUT above it in the same trigger.
How do I make SFM faster than once a second in ATM10?
For items and fluids you cannot: our server keeps the mod's minimum of 20 ticks. Move more per run instead, since a run has no size limit unless you set one. A trigger that moves only energy (fe::) may run every tick.
How do I move fluids or power with SFM?
Write the type before the name: INPUT fluid::water FROM a and OUTPUT fluid::water TO b for water, fluid:: for every fluid, fe:: for Forge Energy and chemical:: for Mekanism's gases and other chemicals.
Does SFM work with Mekanism machines?
Yes, including chemicals, but give a side (FROM machine LEFT SIDE), because SFM can only read a Mekanism block when no side is named. The side must match what the machine's own configuration allows on that face.
Does SFM use a WHERE clause for filters?
No. Filter with names and patterns (*ingot*), tags (WITH #c:ingots, WITHOUT #c:ores) and EXCEPT for names to leave out. WHERE is a reserved word in version 4.34 but does nothing.
How do I copy a program to another disk?
Copy it to the clipboard from the manager's screen and paste it into the other one, or print it: make a Printing Form from the written disk with a falling anvil on a block of iron, then put the form, black dye and a blank disk in a Printing Press under a piston.
Written from Super Factory Manager 4.34.0, its example programs and the server's own config, the SFM source code and grammar at 4.34.0 and the official example programs, and checked against this world’s recipes on .