Learn FACTORYIO-MACROS with Real Code Examples
Updated Nov 27, 2025
Code Sample Descriptions
1
Macro - Conveyor Delay
ON SensorTriggered DO
WAIT RANDOM(1000, 3000)
Motor.Start()
END
A macro script that introduces a random delay before starting a conveyor motor.
2
Macro - Machine Breakdown Simulation
ON Machine.Running FOR 60000ms DO
Machine.Stop()
ALERT("Machine breakdown occurred")
END
A macro simulating a machine breakdown after 60 seconds of continuous operation.