Goto » 历史记录 » 修订 4
修订 3 (yangdefeng, 2023-09-11 18:01) → 修订 4/9 (tejie, 2023-09-11 18:22)
h4. _*%{color:green}goto%*_
同一脚本文件内@块跳转
标签:命令定义|goto>goto
*格式*
|命令名 |参数1 |
|goto |跳转标签 |
*说明*
* 参数1:跳转标签
以@开头的任意字符串
%{color:deepPink}支持<$str()>变量取值%
支持传参-->相关命令[[checkScriptParam]]
-
-
h4. *%{color:deepskyblue}特戒引擎脚本示例:%*
bq. [@main]
#if
#act
[[sendMsg]] 6 我是@main
*{color:green}goto* @1
%{color:lightgrey};--跳至@1%
[@1]
#if
#act
[[sendMsg]] 6 我是@1
*{color:green}goto* @2
%{color:lightgrey};--跳至@2%
[@2]
#if
#act
[[sendMsg]] 6 我是@2
-
-
h4. <notextile></notextile>
bq. %{color:fireBrick};--goto 跳转标签支持变量%
[<notextile>@</notextile>main]
%{color:lightgrey};
;--设置跳转标签1的条件%
#if
#act
[[mov]] n1 1
*{color:green}goto* <notextile>@</notextile><$str(n1)>
%{color:lightgrey};
;--设置跳转标签2的条件%
#if
#act
[[mov]] n1 2
*{color:green}goto* <notextile>@</notextile><$str(n1)>
%{color:lightgrey};
;--设置跳转标签3的条件%
#if
#act
[[mov]] n1 3
*{color:green}goto* <notextile>@</notextile><$str(n1)>
%{color:lightgrey};
;标签1执行%
[@1]
#act
[[sendMsg]] 6 特戒初次问候
%{color:lightgrey};
;标签2执行%
[@2]
#act
[[sendMsg]] 6 特戒再次问候
%{color:lightgrey};
;标签3执行%
[@3]
#act
[[sendMsg]] 6 特戒三次问候
-
-
h4. <notextile></notextile>
bq. %{color:fireBrick};--goto 跳转标签支持传参%
[<notextile>@</notextile>main]
<notextile><带1个参数跳转 @跳转(参数1)>\ \</notextile>
<notextile><带2个参数跳转 @跳转(参数2,参数3)>\ \</notextile>
<notextile></notextile>
<notextile>[@跳转]</notextile>
#if
;检查参数是否是这几组
[[checkScriptParam]] 参数1
#act
[[print]] 本次传来了<$scriptParam1>
<notextile></notextile>
#if
;检查参数是否是这几组
[[checkScriptParam]] 参数2,参数3
#act
[[print]] 本次传来了<$pgNpcParam2>,<$pgNpcParam3>