找回密码
 注册
搜索
楼主: taot@tj

任师弟 这些东西也要改么!华山和雪山也要改么

[复制链接]
门派:武当派
发表于 2019-3-1 01:20:15 | 显示全部楼层
gooy@tj 发表于 2019-3-1 00:25
多的一个";"应该是可以去掉的

我今天把lujing.lua一处改了,好像已经去掉了
门派:武当派
发表于 2019-3-1 01:20:47 | 显示全部楼层
gooy@tj 发表于 2019-3-1 00:27
发送命令的数量和被吞的数量一比就能知道是那些命令

但是你无法记录并保存flood之前发送的命令啊
门派:武当派
 楼主| 发表于 2019-3-1 04:23:50 | 显示全部楼层
听你们说起来很高级的样子啊
门派:武当派
发表于 2019-3-2 11:42:14 | 显示全部楼层
freely@tj 发表于 2019-3-1 01:20
我今天把lujing.lua一处改了,好像已经去掉了

这是多余的:是要在哪里改啊
门派:武当派
发表于 2019-3-2 11:43:08 | 显示全部楼层
freely@tj 发表于 2019-3-1 01:20
但是你无法记录并保存flood之前发送的命令啊

可以存进一个全局变量里面吧
门派:武当派
发表于 2019-3-2 12:46:38 | 显示全部楼层
taot@tj 发表于 2019-3-1 04:23
听你们说起来很高级的样子啊

高级吗?还是那个机器人啊
门派:武当派
发表于 2019-3-2 12:52:00 | 显示全部楼层
gooy@tj 发表于 2019-3-2 11:42
这是多余的:是要在哪里改啊

path_start里面:

function path_start()
        --print("run path_start")
    EnableTrigger("hp12",false)
    EnableTimer("roadWait",false)
        DeleteTimer("roadWait",false)
    local l_road
    road.i=road.i + 1
    if flag.find==1 then return end
    if road.i>table.getn(road.detail) then
       locate()
       --if job.name=='huashan' then
       --   return road.act()
       --else
          return check_halt(go_confirm)
       --end
    end
    l_road=road.detail[road.i]        
    if string.find(l_road,'#') then
       local _,_,func,params = string.find(l_road,"^#(%a%w*)%s*(.-)$")
       if func then
                  return _G[func](params)
           end
    else
           local l_len=string.len(l_road)
                if string.sub(l_road,-1,-1)==';' then l_road=string.sub(l_road,1,l_len-1) end
                exe(l_road)

        exe('yun jingli')
        return walk_wait()
    end
end

红色部分是我改动的


还有function path_create()
function path_create()
    local l_set
    local l_num=0
    local l_cnt=1
        local l_cntt=1
    road.detail={}
    l_sett=0
        l_settt=0
    l_path=path_cal()
    --Note(l_path)
    if type(l_path)~='string' then
       if math.random(1,4)==1 then
          l_path='stand;out;northeast;northwest;southeast;southwest;south;south;south;south;south'
       elseif math.random(1,4)==2 then
          l_path='stand;out;northeast;northwest;southeast;southwest;east;east;east;east;east;east'
       elseif math.random(1,4)==3 then
          l_path='stand;out;northeast;northwest;southeast;southwest;west;west;west;west;west;west'
       else
          l_path='stand;out;northeast;northwest;southeast;southwest;north;north;north;north;north'
       end
    end
    l_set=utils.split(l_path,';')  --一个alias里有几个命令
    l_settt=table.getn(l_set)
    --print(l_path)
    if wdgostart==1 then
      if l_settt<= wd_distance then l_settt=wd_distance end
      for i=1,table.getn(l_set) do
          if i<l_settt-wd_distance-2 then
             if string.find(l_set,'#') then
                if l_num>0 then
                      l_cnt=l_cnt+1
                end
                road.detail[l_cnt]=l_set
                l_cnt=l_cnt+1
                l_num=0
             else
                if l_num==0 then
                   road.detail[l_cnt]=l_set
                else
                                   if string.sub(road.detail[l_cnt],-1,-1)==';' then
                                      road.detail[l_cnt]=road.detail[l_cnt]..l_set
                                   else
                      road.detail[l_cnt]=road.detail[l_cnt]..';'..l_set
                                   end

                end
                l_num=l_num+1
                if l_num>road.steps then
                   l_cnt=l_cnt+1
                   l_num=0
                end
             end
            else
                if string.find(l_set,'#') then
                    if l_num>0 then
                      l_cnt=l_cnt+1
                    end
                    road.detail[l_cnt]=l_set
                    l_cnt=l_cnt+1
                    l_num=0
                else
                    if l_num==0 then
                      road.detail[l_cnt]=l_set
                    else
                       if string.sub(road.detail[l_cnt],-1,-1)==';' then
                                          road.detail[l_cnt]=road.detail[l_cnt]..l_set
                                       else
                          road.detail[l_cnt]=road.detail[l_cnt]..';'..l_set
                                       end

                    end
                    l_num=l_num+1
                    if l_num>0 then
                       l_cnt=l_cnt+1
                       l_num=0
                    end
                end
            end
      end
    else
      for i=1,table.getn(l_set) do
          if string.find(l_set,'#') then
                if l_num>0 then
                  l_cnt=l_cnt+1
            end
                road.detail[l_cnt]=l_set
                l_cnt=l_cnt+1
                l_num=0
              else
                if l_num==0 then
                  road.detail[l_cnt]=l_set
                else
                   if string.sub(road.detail[l_cnt],-1,-1)==';' then
                                      road.detail[l_cnt]=road.detail[l_cnt]..l_set
                                   else
                      road.detail[l_cnt]=road.detail[l_cnt]..';'..l_set
                                   end

            end
                l_num=l_num+1
                if l_num>road.steps then
                   l_cnt=l_cnt+1
                   l_num=0
                end
          end
        end
    end
end
门派:武当派
发表于 2019-3-2 12:52:55 | 显示全部楼层
gooy@tj 发表于 2019-3-2 11:43
可以存进一个全局变量里面吧

如果这样,那要改的地方太多了,所有脚本向mud发命令的地方全要加
我现在已经能监控到flood了
门派:武当派
发表于 2019-3-2 12:56:38 | 显示全部楼层
freely@tj 发表于 2019-3-2 12:52
如果这样,那要改的地方太多了,所有脚本向mud发命令的地方全要加
我现在已经能监控到flood了

只在exe(cmd)函数那里加就可以
门派:武当派
发表于 2019-3-2 13:48:20 | 显示全部楼层
嗯,这也是一个思路,我现在有一个想法雏形,因为我已经能监控到flood,所以只要能记录到任务的状态,那利用mush机器人强大的恢复能力,就能再继续当前的任务,这样的话永远不会因为flood而发呆了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-6-27 08:12 , Processed in 0.029122 second(s), 23 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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