行为
getStringPos
指定文件中某一行,匹配指定字符串,则返回(行号-1)至变量n0
如n0=9999999说明没有找到
标签:命令定义|getStringPos
格式| 命令名 | 参数1 | 参数2 | 
| getStringPos | 文件路径 | 要检测的字符串 | 
- 参数1: 写入字符串的文件路径
 路径需要基于..\Mir200\Envir
 举例
 设定读取路径为
 \testlist.txt
 完整读取路径
 ..\Mir200\Envir\testlist.txt
- 参数2: 要检测的字符串
脚本示例:
[@main]
#say
<text:添加一个玩家/@添加记录>
[@添加记录]
#if
checkTextList \testList.txt <$userName>
#act
getStringPos \testList.txt <$userName>
sendMsg 6 已存在,在第<$str(n0)>行
#elseAct
addTextList \testList.txt <$userName>
getStringPos \testList.txt <$userName>
sendMsg 6 写入文件的第<$str(n0)>行