项目

一般

简介

Goto » 历史记录 » 版本 8

tejie, 2023-09-12 10:59

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 5 tejie
h4. &nbsp;
42 3 yangdefeng
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 6 tejie
h4. &nbsp;
83 3 yangdefeng
84
bq. %{color:fireBrick};--goto 跳转标签支持传参%
85
[<notextile>@</notextile>main]
86 7 tejie
<notextile><带1个参数跳转 @goto跳转1>\ \</notextile>
87
<notextile><带2个参数跳转 @goto跳转2>\ \</notextile>
88
<notextile></notextile>
89
[@goto跳转1]
90
#act
91
*{color:green}goto* <notextile>@跳转(参数1)</notextile>
92
<notextile></notextile>
93
[@goto跳转2]
94
#act
95
*{color:green}goto* <notextile>@跳转(参数2,参数3)</notextile>
96
<notextile></notextile>
97 3 yangdefeng
<notextile></notextile>
98
<notextile>[@跳转]</notextile>
99
#if
100 8 tejie
%{color:lightGrey};检查参数是否是这几组%
101 3 yangdefeng
[[checkScriptParam]] 参数1
102
#act
103
[[print]] 本次传来了<$scriptParam1>
104
<notextile></notextile>
105
#if
106 8 tejie
%{color:lightGrey};检查参数是否是这几组%
107 3 yangdefeng
[[checkScriptParam]] 参数2,参数3
108
#act
109
[[print]] 本次传来了<$pgNpcParam2>,<$pgNpcParam3>