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