找回密码
 注册
搜索
查看: 301|回复: 4

战斗时间,任务完成时间 修改 统计到 0.01秒的办法

[复制链接]
门派:天龙寺
发表于 2017-12-1 22:42:55 | 显示全部楼层 |阅读模式
我以xs job和hs job为例(sx和wd任务因为我不做,所以我也没改,如果需要改的话,按照我下面办法找到相应的地方也能自行修改的)

1.打开xueshan.lua
2.把文本中所有的os.time()替换成os.clock()

3. 找到
   
   function xueshan_over()
        nobusy=0
        job.time.e=os.clock()
        job.time.over=job.time.e-job.time.b
    EnableTriggerGroup("xueshan_finish",false)
    xueshan_triggerDel()
    --print('雪山job完成,检查food...')
    messageShowT('雪山任务:任务完成,用时:【'..job.time.over..'】秒。')

替换成   

    function xueshan_over()
        nobusy=0
        job.time.e=os.clock()
        job.time.over=job.time.e-job.time.b
        job.time.over1=string.format("%.2f", job.time.over)
    EnableTriggerGroup("xueshan_finish",false)
    xueshan_triggerDel()
    --print('雪山job完成,检查food...')
    messageShowT('雪山任务:任务完成,用时:【'..job.time.over1..'】秒。')

4.找到

   function xueshan_sa(n,l,w)
       fight.time.e=os.clock()
       fight.time.over=fight.time.e-fight.time.b
    if job.target==w[2] then
       tmp.kill=true
       EnableTriggerGroup("xueshan_fight",false)
       messageShowT('雪山任务:搞定保镖【'..job.target..'】!战斗用时:【'..fight.time.over..'】秒。')

替换成

      function xueshan_sa(n,l,w)
       fight.time.e=os.clock()
       fight.time.over=fight.time.e-fight.time.b
       fight.time.over1=string.format("%0.2f", fight.time.over)
    if job.target==w[2] then
       tmp.kill=true
       EnableTriggerGroup("xueshan_fight",false)
       messageShowT('雪山任务:搞定保镖【'..job.target..'】!战斗用时:【'..fight.time.over1..'】秒。')

5.打开huashan.lua
6.把文本中的os.time()全部替换成os.clock()

7.找到(这段修改是因为原来的时间计算有问题,需要把计算时间的函数移动一个地方)

  function huashan_npc()
    exe('nick 华山任务中')
    job.time.b=os.clock()
        if hsjob2<1 then
                messageShow('华山任务:开始任务。')
        end
        exe('set wimpy 100')
    EnableTriggerGroup("huashan_accept",false)
        job.last="huashan"
    return check_bei(huashan_npc_go)
end

替换成

function huashan_npc()
    exe('nick 华山任务中')
        if hsjob2<1 then
                messageShow('华山任务:开始任务。')
                job.time.b=os.clock()
        end
        EnableTriggerGroup("huashan_accept",false)
        job.last="huashan"
    return check_bei(huashan_npc_go)
end

8.找到

fight.time.e=os.clock()
       fight.time.over=fight.time.e-fight.time.b
        messageShowT('华山任务:战斗用时:【'..fight.time.over..'】秒,搞定蒙面人:【'..job.target..'】。')

替换成

fight.time.e=os.clock()
       fight.time.over=fight.time.e-fight.time.b
       fight.time.over1=string.format("%0.2f", fight.time.over)
        messageShowT('华山任务:战斗用时:【'..fight.time.over1..'】秒,搞定蒙面人:【'..job.target..'】。')

9.找到

exe('drop ling pai')
        job.time.e=os.clock()
        job.time.over=job.time.e-job.time.b
    messageShowT('华山任务:完成任务,用时:【'..job.time.over..'】秒。')

替换成

exe('drop ling pai')
        job.time.e=os.clock()
        job.time.over=job.time.e-job.time.b
        job.time.over1=string.format("%0.2f", job.time.over)
    messageShowT('华山任务:完成任务,用时:【'..job.time.over1..'】秒。')

门派:少林派
发表于 2017-12-1 22:55:12 | 显示全部楼层
我了个天,小星星大神
为了这0.01你也是真拼了
门派:少林派
发表于 2017-12-1 22:55:43 | 显示全部楼层
为大神这份研究劲头点个赞
我也去改改
门派:天龙寺
 楼主| 发表于 2017-12-1 23:02:42 | 显示全部楼层
woshicy@tj 发表于 2017-12-1 22:55
我了个天,小星星大神
为了这0.01你也是真拼了

因为我想看看确切的战斗时间到底是多少么..........
门派:天龙寺
 楼主| 发表于 2017-12-1 23:03:14 | 显示全部楼层
woshicy@tj 发表于 2017-12-1 22:55
为大神这份研究劲头点个赞
我也去改改

我这是无聊闲得慌,哈哈              
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-6-10 10:24 , Processed in 0.025685 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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