suwuji 发表于 2017-7-11 21:52:52

鉴定

纯粹鉴定很简单,枚举即可require "wait"

weapons_armors_list = {
"sword","blade","staff","whip","axe","spear","hammer","halberd","throwing","dagger","needle","flute","armor","boots","cloth","hands","head","shield","surcoat","waist","wrists","ring","necklace",
};

weapons_armors_count = table.getn(weapons_armors_list)

function jianding_all()
   for jianding_idx = 1,weapons_armors_count do
       for jianding_id = 1,1000 do
             jianding_cmd = "jianding "..weapons_armors_list.." "..jianding_id
             Execute(jianding_cmd)
                   local l,w=wait.regexp("你要鉴定什么",0.2)
                   if l~=nil then
                                break
                   end
           end
   end
end
wait.make(jianding_all)

功能初步完成,建立一个alias执行即可
如果想要保存装备到包袱怎么办?加个记忆功能就可以了。require "wait"

weapons_armors_list = {
        "sword","blade","staff","whip","axe","spear","hammer","halberd","throwing","dagger","needle","flute","armor","boots","cloth","hands","head","shield","surcoat","waist","wrists","ring","necklace",
};

weapons_armors_count = table.getn(weapons_armors_list)

remember_jianding_goods = {}

function jianding_all()

   remember_jianding_goods = nil
   remember_jianding_goods = {}
   remember_jianding_goods_idx = 1
   
   for jianding_idx = 1,weapons_armors_count do
       for jianding_id = 1,1000 do
             jianding_cmd = "jianding "..weapons_armors_list.." "..jianding_id
             Execute(jianding_cmd)
                   local l,w=wait.regexp("你要鉴定什么|你捧着.*打量",1)
                   if l~=nil then
                                if string.find(l,"鉴定什么")~=nil then
                                        break
                                else
                                        wait.time(0.1)
                                        if need_remember_jianding == true then
                                           need_remember_jianding = false
                                           remember_jianding_goods = {jianding_idx,jianding_id}
                                           remember_jianding_goods_idx = remember_jianding_goods_idx + 1
                                        end
                                end
                   else
                           --网络故障
                   end
           end
   end
end

wait.make(jianding_all)


所有有用的东西,需要自行加入触发器判定置标志need_remember_jianding= true ,记忆在remember_jianding_goods中之后能放包里了吧?请自行完善放包里的过程。

北大侠客行MUD,中国最好的MUD

longzaitian 发表于 2017-7-12 09:42:46

感谢楼主分享~~~正好学习一下。

salonpas 发表于 2017-7-12 12:57:22

楼主大才

foolenough 发表于 2017-7-13 11:50:21

页: [1]
查看完整版本: 鉴定