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.
Lists and JSON¶
These Macro Enhanced macros work with lists such as:
Most list macros use a comma between items unless you supply another separator. The first item is 0; -1 selects the last item where negative positions are supported. The end position of a slice is excluded.
Browser prompts only. These macros 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.
JSON is a text format for structured data. For example, a saved inventory could contain:
A path such as items[0].name means the name of the first item. Save complicated JSON in a variable, then read it through getvar inside the JSON macro. This avoids confusing an object’s closing braces with macro punctuation.
count¶
Counts the items in a separated list.
Result: 3.
Arguments and other names
- list: The list as one string.
- separator: Optional. What separates the items. Default:
,. - Other accepted names:
me-count.
item¶
Picks one item out of a separated list.
Result: red in the first example.
Arguments and other names
- index: Position of the item (0 is first; negative counts from the end).
- list: The list as one string.
- separator: Optional. What separates the items. Default:
,. - Other accepted names:
me-item.
More examples:
join¶
Joins the remaining arguments into one string.
Result: sword,shield,potion.
Arguments and other names
- separator: Placed between the items.
- More values: add each extra item after
::. See the example for its format. - Other accepted names:
me-join.
jsonget¶
Reads a value out of JSON text by path.
Result: shield.
Arguments and other names
- json: The JSON text.
- path: The path to read, e.g. 'user.name' or 'items[0].id'.
- Other accepted names:
me-jsonget.
jsonkeys¶
The keys of a JSON object, comma-separated.
For an inventory value of {"weapon":"sword","coins":3}, the result is weapon,coins. Save the JSON in a variable first to avoid adjacent closing braces being read as macro syntax.
Arguments and other names
- json: The JSON text.
- path: Optional. A path like a.b[0]. Omit for the top level. Default: empty text.
- Other accepted names:
me-jsonkeys.
jsonlength¶
The length of a JSON value: array items, object keys, or string characters.
Result: 2.
Arguments and other names
- json: The JSON text.
- path: Optional. A path like a.b[0]. Omit for the top level. Default: empty text.
- Other accepted names:
me-jsonlength.
jsonset¶
Sets a value inside a JSON variable, creating missing levels. Returns nothing, like {{setvar}}.
Uses the ordinary local or global variable store. It does not write to Macro Enhanced chat variables.
Arguments and other names
- variable: The variable holding JSON (created if missing).
- path: A path like a.b[0]. Missing levels are created.
- value: The value to store (as text).
- scope: Optional. local (this chat, default) or global. Default:
local. - Other accepted names:
me-jsonset.
listcontains¶
Returns true when the list contains the item. Numeric values match by their number.
Result: true.
Arguments and other names
- list: The list to search.
- item: The item to look for.
- separator: Optional. The list separator. Default:
,. - Other accepted names:
me-listcontains.
listreverse¶
Reverses the order of the items.
Result: c,b,a.
Arguments and other names
- list: The list to reverse.
- separator: Optional. The list separator. Default:
,. - Other accepted names:
me-listreverse.
listshuffle¶
Shuffles the items. A seed makes the order repeatable for an unchanged input list. Without a seed, each evaluation can change it.
Arguments and other names
- list: The list to shuffle.
- seed: Optional. With a seed the order is fixed (cache-friendly); without one it re-shuffles every call. Default: empty text.
- separator: Optional. The list separator. Default:
,. - Other accepted names:
me-listshuffle.
listslice¶
Extracts part of a list by item positions.
Result: a,b in the first example.
Arguments and other names
- list: The source list.
- start: Start index (0-based). Negative counts from the end.
- end: Optional. End index (exclusive). Omit for 'until the end'.
- separator: Optional. The list separator. Default:
,. - Other accepted names:
me-listslice.
More examples:
listsort¶
Sorts a separated list alphabetically (numbers sort naturally).
Result: apple,banana,cherry.
Arguments and other names
- list: The list as one string.
- separator: Optional. What separates the items. Default:
,. - order: Optional. 'asc' or 'desc'. Default:
asc. - Other accepted names:
me-listsort.
listunique¶
Removes duplicate items, keeping the first occurrence.
Result: a,b,c.
Arguments and other names
- list: The list to deduplicate.
- separator: Optional. The list separator. Default:
,. - Other accepted names:
me-listunique.