Skip to content

Commit db11f74

Browse files
Update ChatScript-Control-Scripts.md
1 parent 2d52c54 commit db11f74

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

WIKI/ESOTERIC-CHATSCRIPT/ChatScript-Control-Scripts.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,11 @@ u: () # whatever normal processing you do for user sentences
201201
The primary rule for output OOB is that it is within [ ] and is the first thing in the output. You can write rules that directly embed OOB with the user message like this:
202202
```
203203
u: () \[ action=wave \] How are you?
204+
```
204205

205206
But that gets messy and if you output multiple messages, you cannot easily combine distinct OOB messages into a single composite OOB. Therefore the usual technique is to
206207
define a macro that holds OOB data and use a postprocessing topic to output it at the end.
208+
207209
```
208210
outputmacro: ^OOB(^value) $oob = ^join($oob " " ^value)
209211
@@ -213,12 +215,14 @@ u: () ^OOB(action=wave ) How are you?
213215
topic: ~postprocess system repeat()
214216
t: ( $oob ) ^postprintbefore( \[ $oob \] )
215217
```
218+
216219
In the above code use $$oob instead of $oob (pdf converter didnt like it)
217220

218221
# Changing input token processing
219222

220223
There are times you may want to alter input processing by changing $cs_token. For example if you ask the user their name, on the next user input you probably don't want spell checking
221224
happening which could make a mess of foreign names (or even normal English ones CS is not aware of). So you want a convenient way to temporarily change $cs_token. Here is how:
225+
222226
```
223227
# in your bot definition make a copy of your normal $cs_token
224228
outputmacro: yourbot()
@@ -236,6 +240,4 @@ topic: ~postprocess system repeat()
236240
237241
t: ($cs_token!=$std_token) $cs_token = $std_token
238242
t: ($$newtoken) $cs_token = $newtoken
239-
240-
241243
```

0 commit comments

Comments
 (0)