-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
.
If you know this part, there will be no big problem in making a bot.
outputs character's name if its set.
- alias:
{{bot}}
outputs user's name if its set.
This part is for making complex bots. If you are making a bot that isn't complex, you can just ignore this part.
outputs character's personality if its set.
- alias:
{{char_persona}}
outputs user's personality if its set.
- alias:
{{user_persona}}
outputs character's description if its set.
- alias:
{{char_desc}}
outputs character's example_message
- alias:
{{example_dialogue}}
outputs current main prompt
- alias:
{{system_prompt}}
outputs current global notes if its set.
- alias:
{{ujb}}
,{{system_note}}
outputs current index of the chat.
If it is first message, or unknown, it would output -1
outputs nothing. would be useful for where you need blank but not allowed to by default.
- alias:
{{none}}
outputs one of the prompt randomly.
- example:
{{random::hello::bye::good}}
outputs character's previous chat, if it is used on chat.
- example:
{{previous_char_chat}}
outputs user's previous chat, if it is used on chat.
- example:
{{previous_user_chat}}
outputs result of the caculation.
- example:
{{calc::1+9/2}}
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.
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}}
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}}
outputs variable named <varname>
.
- example:
{{getvar::a}}
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}}
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}}
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}}
checks the value and returns 0
or 1
according to the value.
used for {#if #}
syntax
checks data1 and data2 is equal.
- example:
{{equal::10::10}}
checks data1 and data2 is not equal.
- example:
{{not_equal::10::11}}
checks data1 is greater than data2.
- example:
{{greater::15::11}}
checks data1 is greater or equal than data2.
- example:
{{greater_equal::15::11}}
checks data1 is less than data2.
- example:
{{less::10::11}}
checks data1 is less or equal than data2.
- example:
{{less_equal::10::11}}
checks data1 and data2 is both truty (is 1)
- example:
{{and::1::1}}
checks one of data1 or data2 is truty (is 1)
- example:
{{or::1::0}}
checks data 1 is not truthy (is not 1)
- example:
{{not::0}}
Block Syntax is used for conditional prompts and looping. and also uses {#something #}
instead of {{something}}
if is truty (is 1), returns prompt inside. if is not truty (is not 1), removes prompt inside.
- example
{#if {{or::{{getvar::a}}::{{getvar::b}}}}
{{char}} must output sucess
#}
- using
<something>
might work like{{something}}
for some syntaxes. for example,<user>
is also equalivent with{{user}}
. but using this syntax is unrecommended and depreciated dude to HTML Syntaxes - 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