Rules

A rule has three fields:

blank, the rule always runs.

code block (see below).

A simple rule

name:  eat_grass
when:  patch_here().grass > 0
do:    self.energy = self.energy + 4; patch_here().grass = 0

Toggling a rule

Every rule has an enabled flag. Disabling a rule keeps it visible in the navigator but skips it during ticks - useful for A/B tests.

Scopes recap

Try it in the app

Everything described here works in the live editor. Open Stigmery and follow along.

Open the app →