Goto » 历史记录 » 版本 4
tejie, 2023-09-11 18:22
1 | 3 | yangdefeng | h4. _*%{color:green}goto%*_ |
---|---|---|---|
2 | 2 | yangdefeng | |
3 | 1 | machenhe | 同一脚本文件内@块跳转 |
4 | |||
5 | 2 | yangdefeng | 标签:命令定义|goto>goto |
6 | 1 | machenhe | *格式* |
7 | |命令名 |参数1 | |
||
8 | |goto |跳转标签 | |
||
9 | |||
10 | *说明* |
||
11 | 2 | yangdefeng | * 参数1:跳转标签 |
12 | 1 | machenhe | 以@开头的任意字符串 |
13 | %{color:deepPink}支持<$str()>变量取值% |
||
14 | 3 | yangdefeng | 支持传参-->相关命令[[checkScriptParam]] |
15 | 1 | machenhe | |
16 | - |
||
17 | - |
||
18 | |||
19 | 2 | yangdefeng | h4. *%{color:deepskyblue}特戒引擎脚本示例:%* |
20 | 1 | machenhe | |
21 | bq. [@main] |
||
22 | #if |
||
23 | #act |
||
24 | 2 | yangdefeng | [[sendMsg]] 6 我是@main |
25 | *{color:green}goto* @1 |
||
26 | 1 | machenhe | %{color:lightgrey};--跳至@1% |
27 | [@1] |
||
28 | #if |
||
29 | #act |
||
30 | 2 | yangdefeng | [[sendMsg]] 6 我是@1 |
31 | *{color:green}goto* @2 |
||
32 | 1 | machenhe | %{color:lightgrey};--跳至@2% |
33 | [@2] |
||
34 | #if |
||
35 | #act |
||
36 | 2 | yangdefeng | [[sendMsg]] 6 我是@2 |
37 | 1 | machenhe | |
38 | - |
||
39 | - |
||
40 | |||
41 | 3 | yangdefeng | h4. <notextile></notextile> |
42 | |||
43 | bq. %{color:fireBrick};--goto 跳转标签支持变量% |
||
44 | 1 | machenhe | [<notextile>@</notextile>main] |
45 | %{color:lightgrey}; |
||
46 | ;--设置跳转标签1的条件% |
||
47 | #if |
||
48 | #act |
||
49 | 2 | yangdefeng | [[mov]] n1 1 |
50 | *{color:green}goto* <notextile>@</notextile><$str(n1)> |
||
51 | 1 | machenhe | %{color:lightgrey}; |
52 | ;--设置跳转标签2的条件% |
||
53 | #if |
||
54 | #act |
||
55 | 2 | yangdefeng | [[mov]] n1 2 |
56 | *{color:green}goto* <notextile>@</notextile><$str(n1)> |
||
57 | 1 | machenhe | %{color:lightgrey}; |
58 | ;--设置跳转标签3的条件% |
||
59 | #if |
||
60 | #act |
||
61 | 2 | yangdefeng | [[mov]] n1 3 |
62 | *{color:green}goto* <notextile>@</notextile><$str(n1)> |
||
63 | 1 | machenhe | %{color:lightgrey}; |
64 | ;标签1执行% |
||
65 | [@1] |
||
66 | #act |
||
67 | 2 | yangdefeng | [[sendMsg]] 6 特戒初次问候 |
68 | 1 | machenhe | %{color:lightgrey}; |
69 | ;标签2执行% |
||
70 | [@2] |
||
71 | #act |
||
72 | 2 | yangdefeng | [[sendMsg]] 6 特戒再次问候 |
73 | 1 | machenhe | %{color:lightgrey}; |
74 | ;标签3执行% |
||
75 | [@3] |
||
76 | #act |
||
77 | [[sendMsg]] 6 特戒三次问候 |
||
78 | 3 | yangdefeng | |
79 | - |
||
80 | - |
||
81 | |||
82 | h4. <notextile></notextile> |
||
83 | |||
84 | bq. %{color:fireBrick};--goto 跳转标签支持传参% |
||
85 | [<notextile>@</notextile>main] |
||
86 | <notextile><带1个参数跳转 @跳转(参数1)>\ \</notextile> |
||
87 | <notextile><带2个参数跳转 @跳转(参数2,参数3)>\ \</notextile> |
||
88 | <notextile></notextile> |
||
89 | <notextile>[@跳转]</notextile> |
||
90 | #if |
||
91 | ;检查参数是否是这几组 |
||
92 | [[checkScriptParam]] 参数1 |
||
93 | #act |
||
94 | [[print]] 本次传来了<$scriptParam1> |
||
95 | <notextile></notextile> |
||
96 | #if |
||
97 | ;检查参数是否是这几组 |
||
98 | [[checkScriptParam]] 参数2,参数3 |
||
99 | #act |
||
100 | [[print]] 本次传来了<$pgNpcParam2>,<$pgNpcParam3> |