You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| permanent | `$permvar` | start with a single `$` and are preserved across user interactions (are saved and restored from disk). You can see and alter their value from anywhere.
120
120
| transient | `$$transientvar` | start with `$$` and completely disappear when a user interaction happens (are not saved to disk). You can see and alter their value from anywhere.
@@ -354,27 +354,27 @@ the topic name and the (keywords list). You may have multiple flags. E.g.
354
354
355
355
The flags and their meanings are:
356
356
357
-
|flag | description
358
-
|:----------------:|--------------
359
-
|__`random`__ | search rules randomly instead of linearly
360
-
|__`norandom`__ | (default) search rules linearly
361
-
|__`keep`__ | do not erase responders ever. Gambits (and rejoinders) are not affected by this
362
-
|__`erase`__ | (default) erase responders that successfully generate output.<br>Gambits automatically erase unless you suppress them specifically.
363
-
|__`nostay`__ | do not consider this a topic to remain in, leave it (except for rejoinders)
364
-
|__`stay`__ | (default) make this a pending topic when it generates output
365
-
|__`repeat`__ | allow rules to generate output which has been output recently
366
-
|__`norepeat`__ | (default) do not generate output if it matches output made recently
367
-
|__`priority`__ | raise the priority of this topic when matching keywords
368
-
|__`normal`__ | (default) give this topic normal priority when matching keywords
369
-
|__`deprioritize`__| lower the priority of this topic when matching keywords
370
-
|__`system`__ | this is a system topic. It is automatically `nostay`, `keep`.<br>`keep` automatically applies to gambits as well. The system never looks to these topics for gambits. System topics can never be considered pending (defined shortly). They can not have themselves or their rules be enabled or disabled. Their status/data is never saved to user files.
371
-
|__`user`__ | (default) this is a normal topic
372
-
|__`noblocking`__ | should not perform any blocking tests on this topic in `:verify`
373
-
|__`nopatterns`__ | should not perform any pattern tests on this topic in `:verify`
374
-
|__`nosamples`__ | should not perform any sample tests on this topic in `:verify`
375
-
|__`nokeys`__ | should not perform any keyword tests on this topic in `:verify`
376
-
|__`more`__ | normally if you try to redeclare a concept, you get an error. `more` tells CS you intend to extend the concept and allows additional keywords.
377
-
|__`bot=name`__ | if this is given, only named bots are allowed to use this topic. See [ChatScript Multiple Bots](ChatScript-Multiple-Bots.md) manual.
357
+
| flag | description
358
+
|--------------|--------------
359
+
|`random` | search rules randomly instead of linearly
360
+
|`norandom` | (default) search rules linearly
361
+
|`keep` | do not erase responders ever. Gambits (and rejoinders) are not affected by this
362
+
|`erase` | (default) erase responders that successfully generate output.<br>Gambits automatically erase unless you suppress them specifically.
363
+
|`nostay` | do not consider this a topic to remain in, leave it (except for rejoinders)
364
+
|`stay` | (default) make this a pending topic when it generates output
365
+
|`repeat` | allow rules to generate output which has been output recently
366
+
|`norepeat` | (default) do not generate output if it matches output made recently
367
+
|`priority` | raise the priority of this topic when matching keywords
368
+
|`normal` | (default) give this topic normal priority when matching keywords
369
+
|`deprioritize`| lower the priority of this topic when matching keywords
370
+
|`system` | this is a system topic. It is automatically `nostay`, `keep`.<br>`keep` automatically applies to gambits as well. The system never looks to these topics for gambits. System topics can never be considered pending (defined shortly). They can not have themselves or their rules be enabled or disabled. Their status/data is never saved to user files.
371
+
|`user` | (default) this is a normal topic
372
+
|`noblocking` | should not perform any blocking tests on this topic in `:verify`
373
+
|`nopatterns` | should not perform any pattern tests on this topic in `:verify`
374
+
|`nosamples` | should not perform any sample tests on this topic in `:verify`
375
+
|`nokeys` | should not perform any keyword tests on this topic in `:verify`
376
+
|`more` | normally if you try to redeclare a concept, you get an error. `more` tells CS you intend to extend the concept and allows additional keywords.
377
+
|`bot=name` | if this is given, only named bots are allowed to use this topic. See [ChatScript Multiple Bots](ChatScript-Multiple-Bots.md) manual.
378
378
379
379
380
380
## Rules that erase and repeat
@@ -1453,7 +1453,7 @@ Whereas most programming language separate their arguments with commas because
1453
1453
they are reserved tokens in their language, in ChatScript a comma is a normal word. So
1454
1454
you separate arguments to functions just with spaces.
1455
1455
1456
-
?: ( hi) ^FiveArgFunction( 1 3 my , word)
1456
+
?: ( hi) ^FiveArgFunction( 1 3 my , word)
1457
1457
1458
1458
Outputmacros can return a value, just like a normal function. You just dump the text as
1459
1459
you would a message to the user.
@@ -1908,13 +1908,17 @@ nothing. If the boot layer is not current, then you call ^REBOOT() which erases
1908
1908
boot data and treats the remainder of the script as refilling the boot layer with new facts and
1909
1909
variables.
1910
1910
1911
+
1911
1912
## `^CSSHUTDOWN()`
1912
1913
1913
1914
outputmacro: ^CSSHUTDOWN()
1914
1915
1915
1916
1916
1917
This function, if defined by you, will be executed on shutdown or restart of the ChatScript system.
1917
1918
1919
+
1920
+
## `^cs_topic_enter()`
1921
+
1918
1922
outputmacro: ^cs_topic_enter(^topic ^mode)
1919
1923
1920
1924
When the system begins a topic and this function is defined by you, it will be invoked
@@ -1923,6 +1927,8 @@ representing the way it is being invoked.
1923
1927
Values of `^mode` are: `s`, `?`, `u`, `t`, which represent statements, questions, both, or gambits.
1924
1928
While your function is executing, neither `^cs_topic_enter` or `^cs_topic_exit` will be invoked.
1925
1929
1930
+
## `^cs_topic_exit()`
1931
+
1926
1932
outputmacro: ^cs_topic_exit(^topic ^result)
1927
1933
1928
1934
When the system exits a topic and this function is defined by you, it will be invoked after
0 commit comments