Skip to content

Curly Brased Syntaxes

kwaroran edited this page Jul 17, 2023 · 20 revisions

Curly Brased Syntaxes

Curly brased syntaxes are custom syntaxes in Risu, which you can use at prompts, character description, chat... and more!

For example, if you put {{char}} is cute in the main prompt, and roleplay with character named "Hana", the app will convert it to Hana is cute.

Basics

If you know this part, there will be no big problem in making a bot.

{{char}}

outputs character's name if its set.

  • alias: {{bot}}

{{user}}

outputs user's name if its set.

Advanced

This part is for making complex bots. If you are making a bot that isn't complex, you can just ignore this part.

{{personality}}

outputs character's personality if its set.

  • alias: {{char_persona}}

{{persona}}

outputs user's personality if its set.

  • alias: {{user_persona}}

{{global_note}}

outputs current global notes if its set.

  • alias: {{ujb}}

{{chat_index}}

outputs current index of the chat. If it is first message, or unknown, it would output -1

{{blank}}

outputs nothing. would be useful for where you need blank but not allowed to by default.

  • alias: {{none}}

{{random::<values>}}

outputs one of the prompt randomly.

  • example: {{random::hello::bye::good}}

{{calc::<formula>}}

outputs result of the caculation.

  • example: {{calc::1+9/2}}

Variables

Variable used for making complex bots. this can store values and output in the chat/lorebook and others.

the values doesn't render dynamicly, so editing the prompt might not rerender the chat.

If you are making a bot that isn't complex, you can just ignore this part.

{{setvar::<varname>::<val>}}

sets the variable named <varname> to <val>. you can store numbers and strings. only works when this syntax is in the chat or first message, otherwize it would be ignored.

  • example: {{setvar::a::10}}

{{addvar::<varname>::<val>}}

adds <val> to the variable named <varname>. If the varable is a string, it would make varable NaN. If the varable is not set, it might not work propally. only works when this syntax is in the chat or first message, otherwize it would be ignored.

  • example: {{addvar::a::5}}

{{getvar::<varname>}}

outputs variable named <varname>.

  • example: {{getvar::a}}

{{varrule_max::<varname>::<value>}}

sets the maximum value of the variable named <varname>. only works when this syntax is in the chat or first message, otherwize it would be ignored. If the varable is a string, it would make varable NaN.

  • example: {{varrule_max::a::100}}

{{varrule_min::<varname>::<value>}}

sets the min value of the variable named <varname>. only works when this syntax is in the chat or first message, otherwize it would be ignored. If the varable is a string, it would make varable NaN.

  • example: {{varrule_min::a::100}}

{{varrule_overflow::<varname1>::<value>::<varname2>}}

sets the variable named <varname2> to caculation of var1 / value, and remainder would be set in first varible only works when this syntax is in the chat or first message, otherwize it would be ignored. If the varable is a string, it would make varable NaN.

  • example: {{varrule_overflow::a::100::b}}

Other Informations

  • using <something> also works like {{something}}. for example, <user> is also equalivent with {{user}}
  • you can also nest the syntax, like: {{calc::9 + {{getvar::a}} + 1}}. The syntax can be nested up to 255 levels deep. if you nest it furder, it might not render properly

Clone this wiki locally