|
发表于 2015-3-23 21:29:56
|
显示全部楼层
本帖最后由 creat 于 2015-3-23 01:32 PM 编辑
引用红豆机器人中的一段,这是你需要的东西- create_trigger = function(t_name, t_match, t_action, t_function, t_sent_to, t_group, t_multi_line)
- DeleteTrigger (t_name)
- AddTriggerEx (t_name, t_match, t_action, 1 + 8 + 32 + 1024, -1, 0, "", t_function, t_sent_to, 90)
- if t_multi_line and t_multi_line ~= "" then
- SetTriggerOption ( t_name, "multi_line", "y");
- SetTriggerOption ( t_name, "lines_to_match", t_multi_line);
- end
- if t_group and t_group ~= "" then
- SetTriggerOption (t_name, "group", t_group)
- end
- end
复制代码 应用实例
- create_trigger ("skillscheck",
- "^(?:│\\s+|│□)(\\W+)\\s\\((\-*\\D+)\\)\\s+\\-\\s*\\W+\\s*(\\d*)\\/\\s*(\\d*)│|(\\D*)目前所学过的技能:(共.*)|\\s*\\S*\\s*\\((\\S*)\\)\\s*:\\s*(\\S*?)(?:\\[\\互备\\]|)\\s*有效等级:\\s*\\d*$","skill ("%1","%2","%3","%4","%5","%6","%7")","",12,"_check_","")
- create_trigger ("hpbrief",
- "^\\#\\d*\\.*\\d*(?:\\w*)\\,(\-*\\d*),(\\d*),(\\d*),(\\d*),(\\d*)\\n\\#(\\d*),(\\d*),(\\d*),(\\d*),(\\d*),(\\d*)$","","hpbrief",12,"_check_",2)
复制代码 |
|