脚本扩展 常量表 函数参考 脚本示例

溪流 WarKey 脚本扩展

脚本目录

脚本的安装目录为 溪流 WarKey 根目录下的 Scripts 目录下。 添加或删除脚本后,需要重新打开溪流 WarKey 才能生效。

脚本格式

脚本使用 lua 引擎运行,需要保存为 .lua 文件。文件内容如下:

 1Extension =
 2{
 3    Application   = "xlWarKey",
 4    Version       = "3.0",
 5    NameSpace     = "http://www.streamlet.org/Software/xlWarKey/",
 6
 7    --以上三行固定
 8
 9    ExtensionName = "SampleExtension",                  --脚本名称
10    Author        = "YourName",                         --脚本作者
11    Description   = "This extension is rather good.",   --脚本描述
12
13    --参数配置,使用方法见 喊话.lua
14    Configuration =
15    {
16        setting1  =
17        {
18            Type  = "number",
19            Desc  = "Please input an integer."
20        },
21        setting2  =
22        {
23            Type  = "string",
24            Desc  = "Please input a string."
25        }
26        -- ...
27    },
28    --运行时,上面 setting1 和 setting2 都将被直接替换为用户设置的值
29
30    --入口函数
31    Entrance      = function (id)   --参数 id 仅仅是保留着以便将来使用,目前请忽略
32        local config = Extension.Configuration;
33
34
35        -- 所有代码都请写在这里
36        -- ...
37
38
39        return true;    --返回值也保留,将来使用,请 return true。
40    end
41};