Skip to content

The Neconyan handbook

Your guides Miso, Taro & Nori

Choose each guide's gender to change their artwork and pronouns. Your choices stay in this browser, separately from the app.

Conditions

These Macro Enhanced macros return true or false, or choose text from a set of cases. Combine them with the core if block:

{{if::{{gte::{{getvar::supplies}}::3}}}}
There are enough supplies for the trip.
{{else}}
The party needs more supplies.
{{/if}}

Set supplies before using this example. The comparison macros treat two numeric values as numbers and other values as text. Use consistent value types for predictable results.

Browser prompts only. The comparison and switch macros on this page, and the expr macro, only run in the browser. Ordinary Roleplay replies build their prompts there, so they work. Conversation replies, Deep Swipe and replies with a selected Notebook context build their prompts on the server and stop before the model request if one is used. Test them in the Macro Enhanced Playground, and see Macro Enhanced in Roleplay prompts for the full list. The core if block works everywhere.

The plain if macro treats empty text, false, off and 0 as false. A sentence such as 0 > 0 is non-empty text, so wrap written comparisons in expr or use gt, eq and the other comparisons below. Macro Enhanced also offers an optional setting to work out comparisons directly in if conditions.

and

Returns true when every supplied value counts as true. Empty text, false, off and 0 count as false.

{{and::true::false}}

Result: false.

Arguments and other names
  • first: The first value.
  • second: The second value.
  • More values: add each extra item after ::. See the example for its format.
  • Other accepted names: me-and.

eq

Returns true when both values are equal. Compares numbers numerically and other values as text.

{{eq::3::3}}

Result: true.

Arguments and other names
  • a: The left value.
  • b: The right value.
  • Other accepted names: me-eq.

expr

Evaluates a written comparison or condition. Supports numbers, quoted text, comparisons and brackets.

{{expr::3 > 2}}

Result: true in the first example.

Use the or macro for an either/or condition. Literal pipe characters can be read as macro filter syntax before this expression is evaluated.

Arguments and other names
  • condition: The condition to work out, e.g. '{{.hp}} > 0'.
  • More values: add each extra item after ::. See the example for its format.
  • Other accepted names: me-expr.

More examples:

{{if::{{expr::3 > 2}}}}Enough supplies.{{/if}}

gt

Returns true when the first value is greater than the second.

{{gt::4::3}}

Result: true.

Arguments and other names
  • a: The left value.
  • b: The right value.
  • Other accepted names: me-gt.

gte

Returns true when the first value is greater than or equal to the second.

{{gte::3::3}}

Result: true.

Arguments and other names
  • a: The left value.
  • b: The right value.
  • Other accepted names: me-gte.

isempty

True when the value is empty or only whitespace.

{{isempty::hello}}

Result: false.

Arguments and other names
  • value: The value to check.
  • Other accepted names: blank, me-isempty.

lt

Returns true when the first value is less than the second.

{{lt::2::3}}

Result: true.

Arguments and other names
  • a: The left value.
  • b: The right value.
  • Other accepted names: me-lt.

lte

Returns true when the first value is less than or equal to the second.

{{lte::3::3}}

Result: true.

Arguments and other names
  • a: The left value.
  • b: The right value.
  • Other accepted names: me-lte.

neq

Returns true when the values differ.

{{neq::3::4}}

Result: true.

Arguments and other names
  • a: The left value.
  • b: The right value.
  • Other accepted names: me-neq.

not

Reverses a condition: true becomes false, and false becomes true.

{{not::true}}

Result: false.

Arguments and other names
  • value: The value to invert.
  • Other accepted names: me-not.

or

Returns true when at least one supplied value counts as true.

{{or::true::false}}

Result: true.

Arguments and other names
  • first: The first value.
  • second: The second value.
  • More values: add each extra item after ::. See the example for its format.
  • Other accepted names: me-or.

switch

Chooses the result of a matching case=value pair. A default=value pair handles the remaining cases. Only the chosen result runs its nested macros.

{{switch::rain::sun=Take a hat.::rain=Take an umbrella.::default=Check the forecast.}}

Result: Take an umbrella.

Arguments and other names
  • value: The value to match.
  • More values: add each extra item after ::. See the example for its format.
  • Other accepted names: me-switch.