|
最后一次更改后,当get 正确的corpse后,机器人会信下来,今天仔细核对log和代码,找出原因了
shujian.lua中对create_trigger是这样定义的
- -- 创建一个临时的一次性触发器
- function create_trigger(t_name,t_match,t_response,t_function )
- return AddTrigger(t_name,t_match,t_response,trigger_flag.Enabled+trigger_flag.RegularExpression+trigger_flag.Replace+trigger_flag.Temporary+trigger_flag.OneShot,-1,0,"",t_function)
- end
- -- 创建一个ex触发器
- function create_triggerex_t(t_name,t_match,t_response,t_function )
- return AddTriggerEx(t_name,t_match,t_response,trigger_flag.Enabled+trigger_flag.RegularExpression+trigger_flag.Replace,-1,0,"",t_function,12,99)
- end
复制代码
huashan_cut=function()
EnableTriggerGroup("huashan_fight",false)
EnableTriggerGroup("huashan_find",false)
DeleteTriggerGroup("huashan_cut")
create_trigger_t('huashan_cut1','^(> )*只听“咔”的一声,你将(\\D*)的首级斩了下来,提在手中。','','huashan_cut_con')
create_trigger_t('huashan_cut2','^(> )*(乱切别人杀的人干嘛啊|你手上这件兵器无锋无刃|你得用件锋利的器具才能切下这尸体的头来)','','huashan_cut_weapon')
create_trigger('huashan_cut3','^(> )*你将(\\D*)的尸体扶了起来背在背上。','','huashan_cut_con')
create_triggerex_lvl('huashan_cut4','^(> )*光天化日的想抢劫啊?','','huashan_cut_con1',50)
create_trigger_t('huashan_cut5','^(> )*你现在正忙着呢。','','huashan_cut_weapon')
SetTriggerOption("huashan_cut1","group","huashan_cut")
SetTriggerOption("huashan_cut2","group","huashan_cut")
SetTriggerOption("huashan_cut3","group","huashan_cut")
SetTriggerOption("huashan_cut4","group","huashan_cut")
SetTriggerOption("huashan_cut5","group","huashan_cut")
wudangPfmAnClose()
l_corpseNum=1
road.id=nil
job.killer={}
fight.time.e=os.time()
fight.time.over=fight.time.e-fight.time.b
messageShowT('华山任务:战斗用时:【'..fight.time.over..'】秒,搞定蒙面人:【'..job.target..'】。')
return check_halt(huashan_cut_act)
end
上面是我原来的代码,注意红色粗体部分,用的正是上面建立一次触发的函数
更改为:
create_trigger_t('huashan_cut3','^(> )*你将(\\D*)的尸体扶了起来背在背上。','','huashan_cut_con')
其他的不变,就可以了
由于我的粗心,可能让师兄弟们用了我前面的更改造成发呆,深表歉意 |
|