Skip to content

Kether

Kether脚本文件放置于 plugins\CraneCore\script 文件夹下,命名为 文件名.yml 即可

示例文件

HelloWorld.yml

YAML
enable: |
  tell 'HelloWorld.yml enable!'

disable: |
  tell 'HelloWorld.yml disable!'

run: |
  tell 'Hello World'

run2: |
  tell inline '{{ &arg0 }}'
  tell inline '{{ &arg1 }}'
  tell inline '{{ &arg2 }}'

使用

使用命令 /cranecore script <player> <file> <function> 可运行脚本

比如使用 /cranecore script MonsterChum HelloWorld.yml run 可以为玩家 MonsterChum 运行 HelloWorld.yml 中的 run 函数

使用 /cranecore script MonsterChum HelloWorld.yml run2 1 2 3 可以为玩家 MonsterChum 运行 HelloWorld.yml 中的 run2 函数,1 2 3 作为 3 个参数,它们都是字符串

当玩家为 ~ 时,可以为控制台运行,比如 /cranecore script ~ HelloWorld.yml run

生命周期

当脚本加载卸载时,会自动运行所有脚本中的 enable()disable() 函数,若没有编写对应函数则不会运行