|
发表于 2011-8-10 17:43:58
|
显示全部楼层
如果是mush的话这么写。注意有两个子函数,包括返回具体路径和具体页数的没有提供,怕被删帖扣分封IP
哦,道德经也暂时不支持,懒的做了
- function ReadJing_init( name, line, wildcards )
- print(name); print(line); table.foreachi (wildcards, print)
- SetJhantingPath(wildcards[1]);
- local jieBookName, startPageNumber
- if wildcards[2] == "阴符经" then
- jieBookName = "阴符经"; trueJingBookNumber = tonumber(wildcards[3]);
- startPageNumber = 1;
- else
- jieBookName = wildcards[2]; startPageNumber = GetJingStartPageNumber(wildcards[2]..wildcards[3]);
- trueJingBookNumber = startPageNumber - 1 + tonumber(wildcards[4]);
- end
- if startPageNumber > 0 and chantingPath.goto ~= "" then
- EnableTimer("goodgoodstudy", false);
- DoAfterSpeedWalk(2, "3n2wu(jie " .. jieBookName .. ")")
- else
- DoAfterSpeedWalk(2, "(ask chongxu about cancel)")
- end
- end
- AddTriggerEx ("tr_ReadJing_init",
- "^\\>?\\s?你向冲虚道长打听有关『quest』的消息。\\n冲虚道长说道:「今天全派弟子要在(.+)熟读典籍,据说要诵唱(.+)的.+·.+·(.+)\\((\\d+)\\)",
- "",
- trigger_flag.Enabled + trigger_flag.RegularExpression + trigger_flag.KeepEvaluating, custom_colour.NoChange, 0, "",
- "ReadJing_init",
- 0, 100)
- SetTriggerOption("tr_ReadJing_init", "multi_line", "y");
- SetTriggerOption("tr_ReadJing_init", "lines_to_match", "2");
- AddTriggerEx ("tr_ReadYinFuJing_init",
- "^\\>?\\s?你向冲虚道长打听有关『quest』的消息。\\n冲虚道长说道:「今天全派弟子要在(.+)熟读典籍,据说要诵唱阴符经的(.+)\\((\\d+)\\)",
- "",
- trigger_flag.Enabled + trigger_flag.RegularExpression + trigger_flag.KeepEvaluating, custom_colour.NoChange, 0, "",
- "ReadJing_init",
- 0, 100)
- SetTriggerOption("tr_ReadYinFuJing_init", "multi_line", "y");
- SetTriggerOption("tr_ReadYinFuJing_init", "lines_to_match", "2");
复制代码 |
|