1. Home
  2. /
  3. Factoryio-macros
  4. /
  5. Macro - Conveyor Delay

Macro - Conveyor Delay - Factoryio-macros Typing CST Test

Loading…

Macro - Conveyor Delay — Factoryio-macros Code

A macro script that introduces a random delay before starting a conveyor motor.

ON SensorTriggered DO
	WAIT RANDOM(1000, 3000)
	Motor.Start()
END

Factoryio-macros Language Guide

Factory I/O Macros are small, script-like automation blocks used inside Factory I/O to create dynamic behaviors, event logic, interactions, and simulated control sequences within industrial 3D factory environments. They extend built-in components by enabling custom logic without requiring a full PLC.

Primary Use Cases

  • ▸Simple automation logic without a PLC
  • ▸Scene interactions and dynamic events
  • ▸Custom conveyor and machine behaviors
  • ▸Sequential operations and timing sequences
  • ▸Rapid prototyping of logic before PLC deployment

Notable Features

  • ▸Built-in logic blocks (conditions, timers, toggles)
  • ▸Simple event-based scripting
  • ▸Direct access to all Factory I/O tags
  • ▸Real-time update loop for simulation logic
  • ▸PLC-free testing environment

Origin & Creator

Introduced by Real Games (creators of Factory I/O) to provide quick in-simulation logic without external controllers.

Industrial Note

Used heavily in vocational training, prototyping, and early-stage virtual commissioning where a PLC is not available or needs rapid iteration.

Quick Explain

  • ▸Factory I/O Macros provide lightweight scripting logic to drive simulation behaviors.
  • ▸They enable conditions, timers, triggers, and dynamic responses without external PLCs.
  • ▸Used to prototype automation logic before moving to real PLC code.
  • ▸Macros can interact with sensors, actuators, conveyors, and animated objects.
  • ▸Designed to bridge the gap between static scenes and fully dynamic automation.

Core Features

  • ▸IF/ELSE conditional logic
  • ▸Digital/analog read & write
  • ▸Macros attached to scene objects
  • ▸Clock/timer functions
  • ▸Triggers for events and motion

Learning Path

  • ▸Learn sensors and actuators in Factory I/O
  • ▸Experiment with triggers and conditions
  • ▸Use timers for sequencing
  • ▸Build small machines using macros
  • ▸Integrate with real PLC for advanced practice

Practical Examples

  • ▸Auto-start a conveyor when a part enters a zone
  • ▸Create a timed piston extension with delay
  • ▸Toggle a machine state on repeated sensor triggers
  • ▸Simulate machine warm-up sequences
  • ▸Implement custom part sorting logic

Comparisons

  • ▸Macros vs PLC: Macros are quick; PLCs are industrial-grade
  • ▸Macros vs Python Scripting: Macros are simpler and built-in
  • ▸Macros vs Behavior Blocks: Macros offer more control
  • ▸Macros vs Control I/O: Macros simulate logic; Control I/O connects external drivers
  • ▸Macros vs Automation ML: Macros drive logic, AML handles interoperability

Strengths

  • ▸Very easy to learn-even non-programmers can use it
  • ▸Perfect for quick prototyping
  • ▸No external PLC hardware/software needed
  • ▸Immediate visual feedback of logic
  • ▸Ideal for training and classroom demos

Limitations

  • ▸Not suitable for complex automation logic
  • ▸Limited compared to IEC 61131-3 languages
  • ▸Not portable to real PLCs-cannot be deployed on hardware
  • ▸Performance tied to simulation loop
  • ▸Hard to modularize for large scenes

When NOT to Use

  • ▸High complexity control systems
  • ▸Real PLC commissioning
  • ▸Precise timing-critical logic
  • ▸Large distributed automation
  • ▸Simulation requiring accurate PLC scan cycles

Cheat Sheet

  • ▸Always verify tag mapping
  • ▸Use timers for delays instead of manual counters
  • ▸Group related logic together
  • ▸Test macros in slow motion
  • ▸Check sensor alignment

FAQ

  • ▸Do macros replace a PLC? -> Only for simulation logic.
  • ▸Can macros be exported to real PLC code? -> No.
  • ▸Are macros beginner friendly? -> Yes.
  • ▸Do macros support analog operations? -> Yes.
  • ▸Can macros run across multiple components? -> Yes, via tags.

30-Day Skill Plan

  • ▸Week 1: Learn basic macro blocks
  • ▸Week 2: Build small logic-driven simulations
  • ▸Week 3: Use timers and multi-step sequences
  • ▸Week 4: Integrate macros with tags and external PLC
  • ▸Week 5: Create complex automated lines

Final Summary

  • ▸Factory I/O Macros enable quick, lightweight automation logic inside simulations.
  • ▸They’re ideal for training, prototyping, and interactive scenes.
  • ▸Best used for simple to medium automation behavior.
  • ▸Easier than PLC programming but not as scalable.
  • ▸Provides fast, visual logic testing in the 3D environment.

Project Structure

  • ▸Scene file (.factoryio)
  • ▸Macro definitions embedded per object
  • ▸Tag list defining available IO
  • ▸Connections to external drivers (optional)
  • ▸Physics objects and animations

Monetization

  • ▸Used in automation training courses
  • ▸Supports consulting demos
  • ▸Enables low-cost prototyping
  • ▸Used to teach PLC logic basics
  • ▸Education licensing for institutions

Productivity Tips

  • ▸Duplicate objects with macros for consistency
  • ▸Use templates for repeating machine behavior
  • ▸Leverage slow-motion mode when debugging
  • ▸Name tags meaningfully (sensor_in, motor_out)
  • ▸Build logic incrementally

Basic Concepts

  • ▸Tags - track sensor/actuator values
  • ▸Events - condition triggers logic
  • ▸Execution Loop - logic updates each frame
  • ▸States - toggles, memory bits
  • ▸Timers - delays, transitions, sequencing

Official Docs

  • ▸Factory I/O Official Documentation
  • ▸Factory I/O Macro Tutorials
  • ▸Factory I/O Education Guide

More Factoryio-macros Typing Exercises

Macro - Machine Breakdown Simulation

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher