舰_1-5捞秋刀鱼

配置参考:


--2016 1-5捞秋刀鱼
--其实就是简单调了下通用脚本

--装备和配置参考请点击右侧--->>>访问发布页

---------------------------------------------------------------------------------
--这里是设置区域 请务必阅读!
--这里是设置区域 请务必阅读!
--这里是设置区域 请务必阅读!

Kan.DelBattleInfo()
Kan.AddBattleInfo(1, 阵型.单横, false, false) --第1个点 单纵
Kan.AddBattleInfo(2, 阵型.单横, false, false) --第1个点 单纵 
Kan.AddBattleInfo(3, 阵型.单横, false, false) --第1个点 单纵 
Kan.AddBattleInfo(4, 阵型.单横, true, false)  --第1个点 单纵 夜战
--★如果你要打的地图会超过4个战斗点,请添加自行添加,否则多出的战斗点会按照第1个的设置战斗
--★请一定要注意,如果去打1-5你不改这个,就是去送死!

map_id = {1,5}
--★出击地图2-5,可自行改为其他图

count = 20
--★出击次数 

team_id = 1
--★出击的队伍ID(1-4)

修理大破 = true; 修理中破 = true; 修理小破 = true; 修理损坏 = false; 
--★所有修理都是高速修理!
--修理损坏=不到小破的那种掉血,建议高难度的图才开

-----------------------------------------------------------------------------
--★远征设置
conquest_open = true
--远征的整体开关,如果是false就不进行远征,true远征,
--false的情况下无需设置下面的时间及远征出击图,当然设置了也没用。

k2_conquest = C.長距離練習航海_ID2
k3_conquest = C.海上護衛任務_ID5
k4_conquest = C.北方鼠輸送作戦_ID21
--1.可自行新建一个远征脚本复制出这几行数据
--2.可输入C.会弹出输入提示,下拉可找到相应远征

check_time = {5,10}
--设置5-10分钟检测收回并放出一次远征

---------------------------------------------------------------------------------
--下面的设置一般不需要改

map_battle_count = 10
--在地图中进行几个点的战斗 超过也可以 但是不能少 少了到Boss前就撤退了 
--(不包括资源点和能动点还有漩涡等不战斗的点的数量)

Base.SetConfig("Sleep+?",100) --所有延时随机增加1-100
---------------------------------------------------------------------------------

use_way = false
--是否使用能动点 地图如果不需要使用能动点 就写false 普通图一般不需要


function YuanZhengCore() 
	ret = Kan.ConquestGet()
	Base.Sleep(2000)
	a,b,c,d = Kan.SupplyAll() --执行1234舰队的补给
	Win.Print("补给完毕 尝试远征")
	
	
	if b ~= -3 and b ~= -1 and k2_conquest ~= nil then --判断第二战队不在远征状态
		Kan.Conquest(2,k2_conquest[1],k2_conquest[2])
	end
	
	if c ~= -3 and c ~= -1 and k3_conquest ~= nil then
		Kan.Conquest(3,k3_conquest[1],k3_conquest[2])
	end
	
	if d ~= -3 and d ~= -1 and k4_conquest ~= nil then
		Kan.Conquest(4,k4_conquest[1],k4_conquest[2])
	end
end

function YuanZheng() --这个函数不要修改了!
--远征函数 如果时间大于 5分钟 就检查一次脚本 放出一次
	s2 = os.time()
	s = os.difftime(s2, s1)
	
	math.randomseed(os.time())
	min = math.random(check_time[1],check_time[2]) --取随机分钟数3-5
	
	if s > 60*min then
		s1 = os.time()
		Win.Print('时间符合 进行一次远征尝试')
		YuanZhengCore()
	else
		Win.Print('时间不符合 不远征')
	end
end

function SupplyAllStringMatch(_str)
    local t2 = { string.match(_str , "^(-?%d+),(-?%d+),(-?%d+),(-?%d+)|(%d+),(%d+),(%d+),(%d+),(%d+),(%d+)") }
    --将返回的数据匹配到表中
    t = {}

    for key, value in pairs(t2) do  
        table.insert(t,tonumber(value))
    end  --转为数值
    Base.Print(string.format("舰队状态:%d %d %d %d",t[1],t[2],t[3],t[4]))
    Base.Print(string.format("第一舰队单船状态:%d %d %d %d %d %d",t[5],t[6],t[7],t[8],t[9],t[10]))
    
    return t
end


s1 = os.time() 
if conquest_open == true then
	YuanZhengCore()
end

for n = 1, count do --循环次数
    a = "开始第:%d次"
    Win.Print(a:format(n))

    ret = Base.CallFunc("Kan.SupplyAll") --补给全部并返回所有数据
    Base.Print(ret)

    t = SupplyAllStringMatch(ret) --返回的文本转到table

    if kan_support_boss_id ~= nil and t[kan_support_boss_id] ~= -3 then
        Kan.Conquest(kan_support_boss_id,10,2) --出击Boss支援(暂时没用)
    end

    if kan_support_id ~= nil and t[kan_support_id] ~= -3 then
        Kan.Conquest(kan_support_id,10,1) --出击道中支援(暂时没用)
    end

    if t[5]>0 or t[6]>0 or t[7]>0 or t[8]>0 or t[9]>0 or t[10]>0 then
        Win.Print('船大/中/小破!使用进入修理')
        
        --修理大中小破的船 6次 都使用桶!!
		rep_id = 0
		if 修理大破 == true then
			rep_id = rep_id + 8
		end
		if 修理中破 == true then
			rep_id = rep_id + 4
		end
		if 修理小破 == true then
			rep_id = rep_id + 2
		end
		if 修理损坏 == true then
			rep_id = rep_id + 1
		end
        Kan.RepairEx(6, 16, rep_id)

    elseif t[1] == -1 then
        Win.Pop('补给不足 脚本停止!',true)
        break
    end

    Kan.Sally(map_id[1], map_id[2]) --出击


    --第一舰队\战斗4次\使用能动点
    if Kan.BattleEx(team_id, map_battle_count , use_way) == false then
        LastBattleCount = Base.GetValue("LastBattleCount")
        Win.Print(LastBattleCount)    
        
        if LastBattleCount ~= nil then
            min = (7 - tonumber(LastBattleCount)) * 3
            Win.Print('战斗结束..等待'..min ..'分钟恢复疲劳再打...')
            Base.Sleep(1000 * 60 *  min) --等待时间
        else
            Win.Print('战斗结束..等待24分钟恢复疲劳再打...')
            Base.Sleep(1000 * 60 *  24) --等待时间
        end
    else
        Win.Print('战斗正常结束..等待10分钟恢复疲劳再打...')
        Base.Sleep(1000 * 60 * 10) --等待时间
    end

    Kan.WaitHome(2000)
    Base.Sleep(2000)
	
	if conquest_open == true then
		goto yc
	end

	::yc:: do
		if conquest_open == true then
			YuanZheng(0)
		end
	end
	
end


if conquest_open == true then
	Win.Print('出击完成,进入远征状态!')
	
	while true do 
		Win.Print('等待1分钟后检测时间')
		Base.Sleep(1000*60)
		YuanZheng(0)
	end
	
end

Win.Pop('脚本执行完毕!')

Last updated