找回密码
 注册
搜索
查看: 907|回复: 20

hs job get corpse最新修改(我的一处手误)

[复制链接]
门派:武当派
发表于 2019-3-4 17:24:18 | 显示全部楼层 |阅读模式
最后一次更改后,当get 正确的corpse后,机器人会信下来,今天仔细核对log和代码,找出原因了

shujian.lua中对create_trigger是这样定义的

  1. -- 创建一个临时的一次性触发器
  2. function create_trigger(t_name,t_match,t_response,t_function )
  3.       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)
  4. end
  5. -- 创建一个ex触发器
  6. function create_triggerex_t(t_name,t_match,t_response,t_function )
  7.       return AddTriggerEx(t_name,t_match,t_response,trigger_flag.Enabled+trigger_flag.RegularExpression+trigger_flag.Replace,-1,0,"",t_function,12,99)
  8. 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')

其他的不变,就可以了
由于我的粗心,可能让师兄弟们用了我前面的更改造成发呆,深表歉意
门派:武当派
发表于 2019-3-4 17:43:15 | 显示全部楼层
那个shujian里面也要改懂一下嘛         
门派:武当派
发表于 2019-3-4 17:49:45 | 显示全部楼层
我看了一下我的huashan就是那个你改的文件啊
create_trigger_t('huashan_cut3','^(> )*你将(\\D*)的尸体扶了起来背在背上。','','huashan_cut_con')
门派:武当派
 楼主| 发表于 2019-3-4 17:55:45 | 显示全部楼层
taot@tj 发表于 2019-3-4 17:43
那个shujian里面也要改懂一下嘛

那个千万不要动,我是说明我错在哪儿了
原来有问题的code就是用错了创建触发的函数
门派:武当派
 楼主| 发表于 2019-3-4 17:56:27 | 显示全部楼层
taot@tj 发表于 2019-3-4 17:49
我看了一下我的huashan就是那个你改的文件啊
create_trigger_t('huashan_cut3','^(> )*你将(\\D*)的尸体扶 ...

不可能吧,我的还是create_trigger呢,刚刚改过来的  
门派:武当派
发表于 2019-3-4 18:02:56 | 显示全部楼层
freely@tj 发表于 2019-3-4 17:56
不可能吧,我的还是create_trigger呢,刚刚改过来的

这个还真是真的呢!你说我是怎么回事啊         
门派:武当派
发表于 2019-3-4 18:03:29 | 显示全部楼层
freely@tj 发表于 2019-3-4 17:55
那个千万不要动,我是说明我错在哪儿了
原来有问题的code就是用错了创建触发的函数

我复制了一下看了下确实一样啊               
门派:武当派
 楼主| 发表于 2019-3-4 18:37:44 | 显示全部楼层
taot@tj 发表于 2019-3-4 18:02
这个还真是真的呢!你说我是怎么回事啊

没道理啊,我一会找找我发的code   
门派:武当派
 楼主| 发表于 2019-3-4 18:38:17 | 显示全部楼层
taot@tj 发表于 2019-3-4 18:03
我复制了一下看了下确实一样啊

难道是我发帖之后, 自己改的时候又改错了?  
门派:武当派
发表于 2019-3-4 19:31:53 | 显示全部楼层
freely@tj 发表于 2019-3-4 18:37
没道理啊,我一会找找我发的code

这好多东西就是这样的巧              
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|书剑永恒MUD ( 闽ICP备14012032号|闽公网安备 35050202000162号 )

GMT+8, 2025-6-27 02:50 , Processed in 0.054084 second(s), 26 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表