ChatScript 5 Advanced User Manual -- 4 Advanced Output

5.4 Advanced output

    Committed Output :  the output stream, a magical place that queues up each word you write in a rule output.

    So, output does two things. It queues up tokens to send to the user, which may be discarded if the rule ultimately fails. And it can call out to various functions. Things those functions may do are permanent, not undone if the rule later fails.

    ^reuse, ^gambit, ^respond

    Output cannot have rules in it

u: GREETING ( ~emohello )
    if ($username) {
        Hi $username !
    } else {
        I don't believe we've met, what's your name?
        # a: (_*) So your name is '_0?
     }
     a: (_*) So your name is '_0?
    Formatted double quotes ( Active/Format String ) : The active string ^"xxx" string is a format string. The system will remove the ^ and the quotes and put it out exactly as you have it, 

    Json Active Strings :  ^'{ "test" : "my \"value\" \x" }

    Functional Strings

    Loop Construct - loop or ^loop :  Allows you to repeat script. 

    If Construct - if or ^if
    Pattern If : Eg. if (pattern bingo _*1 ~helo ) { ... } 

    Quoting :  '$name will print $name .

    Outputting underscores :  

    Response Controlinput

    Output Macros : Eg. Outputmacro: name (^arg1 ^arg2 ...)

    Sharing function definitions

    Save-Restore locals

    Output Macros vs ^reuse()

    System Functions

    Randomized Output Revisited [ ]

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值