项目

一般

简介

CheckTextList » 历史记录 » 版本 1

machenhe, 2022-04-25 15:33

1 1 machenhe
_*%{color:green}checkTextList%*_
2
检测指定文件中,是否存在某一行,匹配指定字符串
3
4
5
标签:命令定义|checkTextList
6
7
*格式*
8
|命令名		|参数1	 |参数2		|
9
|checkTextList	|文件路径|要检测的字符串|
10
11
*说明*
12
* 参数1: 要检测的文件路径
13
路径需要基于..\Mir200\Envir
14
%{color:lightGrey}举例
15
设定读取路径为
16
\testlist.txt
17
完整读取路径
18
..\Mir200\Envir\testlist.txt%
19
20
* 参数2: 要检测的字符串
21
22
-
23
-
24
25
*%{color:deepskyblue}特戒引擎脚本示例:%*
26
27
bq. [<notextile>@</notextile>main]
28
#say
29
<text:添加一个玩家/@添加记录>
30
&nbsp;
31
[<notextile>@</notextile>添加记录]
32
#if
33
*%{color:green}checkTextList%* \testList.txt <$userName>
34
#act
35
[[getStringPos]] \testList.txt <$userName>
36
sendMsg 6 已存在,在第<$str(n0)>行
37
#elseAct
38
[[addTextList]] \testList.txt <$userName>
39
[[getStringPos]] \testList.txt <$userName>
40
sendMsg 6 写入文件的第<$str(n0)>行