输入捕获

为玩家创建输入捕获器,并根据输值做出反应

节点

(input)?(-)?catcher(s)?

旧版写法示例

- |-
  Catcher:
   <Type=CHAT>
   <Before=tell:请输入一个值>
   <Valid=tell: 你成功输入了一个数值 ${input}>
   <Invalid=tell: 你输入的不是一个数值>
   <Require=isNumber.${input}>
   <Cancel=tell: 已取消捕获器>

捕获器的类型

高级写法示例

- catcher:

    target:
      type: CHAT
      before: 'tell: 请输入一名玩家的名称'
      cancel: 'tell: 已取消捕获器'
      reactions:
        - condition: 'isOnline.${input_target}'
          execute: 'tell: 名称确认. ${input_target}'
          deny:
            - 'tell: 抱歉, 但玩家 ${input_target} 不在线'
            - 'return'

    amount:
      type: CHAT
      before: 'tell: 请提供支付数额'
      cancel: 'tell: 已取消捕获器'
      reactions:
        - condition: 'isNumber.${input_amount}'
          execute:
            - 'tell: 数额确认. ${input_amount}'
            - 'command: pay ${input_target} ${input_amount}'
          deny:
          - 'tell: 请提供有效数字'
          - 'retype'
  • 执行到中断动作 Return 将会中断该输入捕获器

  • 执行到重新输入动作 Retype 将重新执行当前的子捕获器

page重新输入

类型

  • CHAT

    • 捕获玩家发送到聊天框的内容

  • SIGN

    • 向玩家发送一个虚拟木牌,捕获输入的内容

  • ANVIL

    • 向玩家发送一个虚拟铁砧,捕获命名的内容

Last updated