Skip to content

Latest commit

 

History

History
 
 

examples

Examples

This directory contains some example scripts for getting familiar with the langauge that SFM uses.

Basics

All inventories must be connected to the manager via inventory cables for them to be usable by the program.
The manager itself acts as an inventory cable as well.

Use the label gun to apply or remove labels from blocks in the world.
Hold shift while scrolling with the label gun in hand to cycle through the loaded labels.

I recommend writing your program, then pulling the labels from the program instead of manually retyping all the labels you used.

An example video of loading scripts and labels into a manager:

example.mp4

Details

Keywords are case-insensitive.

Super-nerds can read the grammar file here
Some stuff may not be implemented yet, like redstone pulse triggers.

Triggers

  • A program consists of an ordered list of triggers
  • Each trigger has an ordered list of inputs
  • Each trigger clears the input list after executing (so they don't affect other triggers)
  • Each trigger contains a block, which is an ordered list of statements

Example:

EVERY 20 TICKS DO
  -- do stuff here
END
every 5 seconds do
  -- do stuff here
end

Statements

There are currently 3 statements.

  • INPUT
  • OUTPUT
  • IF

See example scripts for detailed usage