AddNameList » 历史记录 » 修订 2
修订 1 (machenhe, 2022-04-28 14:41) → 修订 2/3 (yangdefeng, 2022-06-22 11:15)
_*%{color:green}addNameList%*_
在指定文件中增加角色名
标签:命令定义|addNameList
*格式*
|命令名 |参数1 |
|addNameList |文件路径|
*说明*
* 参数1: 写入字符串的文件路径
路径需要基于..\Mir200\Envir 路径需要基于..\\Mir200\\Envir
%{color:lightGrey}举例
设定写入路径为
\testlist.txt \\testlist.txt
完整写入路径
..\Mir200\Envir\testlist.txt% ..\\Mir200\\Envir\\testlist.txt%
-
-
*%{color:deepskyblue}特戒引擎脚本示例:%*
bq. [<notextile>@</notextile>main]
#act
mov s$file \数据文件\测试非预制数据文件.txt \\数据文件\\测试非预制数据文件.txt
#say
<增加角色名/<notextile>@</notextile>添加>\ \ <增加角色名/<notextile>@</notextile>添加>\\ \\
<删除文件中角色名/<notextile>@</notextile>删除>\ \ <删除文件中角色名/<notextile>@</notextile>删除>\\ \\
<清理角色名文件/<notextile>@</notextile>清理>\ \ <清理角色名文件/<notextile>@</notextile>清理>\\ \\
<检测角色名是否在文件中/<notextile>@</notextile>检测角色名>\ \ <检测角色名是否在文件中/<notextile>@</notextile>检测角色名>\\ \\
<检测角色名位置/<notextile>@</notextile>检测角色名位置>\ \ <检测角色名位置/<notextile>@</notextile>检测角色名位置>\\ \\
<检测文件存在/<notextile>@</notextile>存在>\ \ <检测文件存在/<notextile>@</notextile>存在>\\ \\
[<notextile>@</notextile>添加]
#act
*%{color:green}addNameList%* <$str(s$file)>
[[readTxt]] <$str(s$file)> s0
%{color:lightGrey};print命令在控制台输出文件内容%
print 文件内容-> s0
[<notextile>@</notextile>删除]
#if
#act
[[delNameList]] <$str(s$file)>
readTxt <$str(s$file)> s0
print 文件内容-> s0
[<notextile>@</notextile>清理]
#act
[[clearNameList]] <$str(s$file)>
readTxt <$str(s$file)> s0
print 文件内容-> s0
[<notextile>@</notextile>检测角色名]
#if
[[checkNameList]] <$str(s$file)>
#act
print 角色名存在
#elseAct
print 角色名不存在
#if
#act
readTxt <$str(s$file)> s0
print 文件内容-> s0
[<notextile>@</notextile>检测角色名位置]
#if
[[checkNameListPosition]] <$str(s$file)> < 10 n0
#act
print 角色当前在前10名
print 名次 n0
#elseAct
print 角色当前不在前10名
print 名次 n0
[<notextile>@</notextile>存在]
#if
[[fileExist]] <$str(s$file)>
#act
print 文件存在
#elseAct
print 文件不存在