自定义变量 » 历史记录 » 版本 1
yangdefeng, 2022-05-07 20:31
| 1 | 1 | yangdefeng | h3. 自定义变量数据类型 |
|---|---|---|---|
| 2 | |||
| 3 | |_.类型名称 |_.类型说明 | |
||
| 4 | |integer |整数型 | |
||
| 5 | |string |字符串 | |
||
| 6 | |||
| 7 | %{color:deepPink}自定义变量声明时,需要说明其数据类型 |
||
| 8 | 特戒引擎中,自定义变量声明已不再需要% |
||
| 9 | 在此列出来,只为兼容其它引擎,作说明用 |
||
| 10 | |||
| 11 | |||
| 12 | *%{color:deepskyblue}脚本示例:%* |
||
| 13 | |||
| 14 | bq. [@main] |
||
| 15 | #act |
||
| 16 | var integer human 个人捐款 |
||
| 17 | var string human 个人密码 |
||
| 18 | |||
| 19 | - |
||
| 20 | - |
||
| 21 | |||
| 22 | h3. 自定义变量作用域 |
||
| 23 | |||
| 24 | |_.名称 |_.范围 |_.使用说明 | |
||
| 25 | |global |全局 |服务器重启不清除 | |
||
| 26 | |guild |行会 |服务器重启清除 | |
||
| 27 | |guild2 |行会 |服务器重启不清除 | |
||
| 28 | |human |私人 |小退清0 | |
||
| 29 | |||
| 30 | |||
| 31 | *%{color:deepskyblue}脚本示例:%* |
||
| 32 | |||
| 33 | bq. [@main] |
||
| 34 | #say |
||
| 35 | <text:变量赋值:50:50/<notextile>@</notextile>按钮1> |
||
| 36 | <text:变量读值:50:150/<notextile>@</notextile>按钮2> |
||
| 37 | %{color:lightGrey};给变量赋值% |
||
| 38 | [<notextile>@</notextile>按钮1] |
||
| 39 | #act |
||
| 40 | calcVar global 全服总捐款 = 999999 |
||
| 41 | calcVar guild 行会总捐款 = 88888 |
||
| 42 | calcVar guild2 行会总杀怪 = 77777 |
||
| 43 | calcVar human 个人捐款 = 9527 |
||
| 44 | sendMsg 6 赋值完毕 |
||
| 45 | %{color:lightGrey};读取变量值 |
||
| 46 | ;可尝试重启客户端后读取 |
||
| 47 | ;可尝试重启服务器后读取% |
||
| 48 | [<notextile>@</notextile>按钮2] |
||
| 49 | #act |
||
| 50 | sendMsg 6 <notextile>%</notextile>s所在服务器全服总捐款:<$global(全服总捐款)> |
||
| 51 | %{color:lightGrey};角色未加入行会,将输出空% |
||
| 52 | sendMsg 6 <notextile>%</notextile>s所在行会总捐款数:<$guild(行会总捐款)> |
||
| 53 | %{color:lightGrey};角色未加入行会,将输出空% |
||
| 54 | sendMsg 6 <notextile>%</notextile>s所在行会总杀怪数:<$guild2(行会总杀怪)> |
||
| 55 | sendMsg 6 <notextile>%</notextile>s个人捐款:<$human(个人捐款)> |