项目

一般

简介

AddNameList » 历史记录 » 版本 3

tejie, 2026-03-20 11:08

1 3 tejie
h4. _*%{color:green}addNameList%*_
2
3 1 machenhe
在指定文件中增加角色名
4
5
6 3 tejie
标签:命令^addNameList
7 1 machenhe
8
*格式*
9
|命令名		|参数1	 |
10
|addNameList	|文件路径|
11
12
*说明*
13
* 参数1: 写入字符串的文件路径
14 2 yangdefeng
路径需要基于..\Mir200\Envir
15 1 machenhe
%{color:lightGrey}举例
16
设定写入路径为
17 2 yangdefeng
\testlist.txt
18 1 machenhe
完整写入路径
19 2 yangdefeng
..\Mir200\Envir\testlist.txt%
20 1 machenhe
21
-
22
-
23
24 3 tejie
h4. *%{color:deepskyblue}特戒引擎脚本示例:%*
25 1 machenhe
26
27
bq. [<notextile>@</notextile>main]
28
#act
29 2 yangdefeng
mov s$file \数据文件\测试非预制数据文件.txt
30 1 machenhe
#say
31 2 yangdefeng
<增加角色名/<notextile>@</notextile>添加>\ \
32
<删除文件中角色名/<notextile>@</notextile>删除>\ \
33
<清理角色名文件/<notextile>@</notextile>清理>\ \
34
<检测角色名是否在文件中/<notextile>@</notextile>检测角色名>\ \
35
<检测角色名位置/<notextile>@</notextile>检测角色名位置>\ \
36
<检测文件存在/<notextile>@</notextile>存在>\ \
37 1 machenhe
&nbsp;
38
[<notextile>@</notextile>添加]
39
#act
40
*%{color:green}addNameList%* <$str(s$file)>
41
[[readTxt]] <$str(s$file)> s0
42
%{color:lightGrey};print命令在控制台输出文件内容%
43
print 文件内容-> s0
44
&nbsp;
45
[<notextile>@</notextile>删除]
46
#if
47
#act
48
[[delNameList]] <$str(s$file)>
49
readTxt <$str(s$file)> s0
50
print 文件内容-> s0
51
&nbsp;
52
[<notextile>@</notextile>清理]
53
#act
54
[[clearNameList]] <$str(s$file)>
55
readTxt <$str(s$file)> s0
56
print 文件内容-> s0
57
&nbsp;
58
[<notextile>@</notextile>检测角色名]
59
#if
60
[[checkNameList]] <$str(s$file)>
61
#act
62
print 角色名存在
63
#elseAct
64
print 角色名不存在
65
&nbsp;
66
#if
67
#act
68
readTxt <$str(s$file)> s0
69
print 文件内容-> s0
70
&nbsp;
71
[<notextile>@</notextile>检测角色名位置]
72
#if
73
[[checkNameListPosition]] <$str(s$file)> < 10 n0
74
#act
75
print 角色当前在前10名
76
print 名次 n0
77
#elseAct
78
print 角色当前不在前10名
79
print 名次 n0
80
&nbsp;
81
[<notextile>@</notextile>存在]
82
#if
83
[[fileExist]] <$str(s$file)>
84
#act
85
print 文件存在
86
#elseAct
87
print 文件不存在