舰_2-2偷铝改

--[[
2-2 偷铝
3CVL 旗舰塞舰攻+彗星22或者扳手 另外两个带个彩云塞中威力的舰攻舰爆
3DD  塞满大发和桶
红脸出击

2018-11-08
新增定时设置
新增拆船设置

★偷铝因只有1战,所以设置了大破强制进击,★严禁使用此脚本出击其他地图★
★偷铝因只有1战,所以设置了大破强制进击,★严禁使用此脚本出击其他地图★
★偷铝因只有1战,所以设置了大破强制进击,★严禁使用此脚本出击其他地图★
★偷铝因只有1战,所以设置了大破强制进击,★严禁使用此脚本出击其他地图★
★偷铝因只有1战,所以设置了大破强制进击,★严禁使用此脚本出击其他地图★
★偷铝因只有1战,所以设置了大破强制进击,★严禁使用此脚本出击其他地图★
★偷铝因只有1战,所以设置了大破强制进击,★严禁使用此脚本出击其他地图★
★偷铝因只有1战,所以设置了大破强制进击,★严禁使用此脚本出击其他地图★
★偷铝因只有1战,所以设置了大破强制进击,★严禁使用此脚本出击其他地图★

]]

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

--偷铝因只有1战,所以设置了强制进击,严禁使用本脚本出击其他地图
Kan.DelBattleInfo()
Kan.AddBattleInfo(1, 阵型.单纵, false, false, true) --第1个点 单纵 强制进击

--出击地图可自行改为其他图
mapId = {2, 2}

--出击次数 
battleCount = 30

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

--在每次出击正常结束后等待时间(分钟)
waitTime = 3

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

--在打完count次数后进入远征循环后是否修船(不用桶)
repair = false

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

--[[---------------------------------------------------------------------------]]
--[[---------------------------------定时设置-----------------------------------]]
--[[---------------------------------------------------------------------------]]
--是否启用定时
isOpenRunHour = false;

--出击的时间段设置
--设置举例:'["9:10-12:01", "13:30-17:10", "19:20-21:40"]'
runHour = '["09:00-23:59"]';

--是否在每次等待到可执行的时间后重置战斗次数
--比如"[8,10,[20,22]]"的设置,会在8点,10点,20点进行重置
reseBattleCount = true;

--在每进行多少次出击后执行拆船 如果设置0则不会拆船
--拆船未实现
deleteKanAtBattleCount = 0

--是否在战斗次数满足后修船,需要设定远征才生效
overBattleRepair = true 


--[[---------------------------------------------------------------------------]]
--[[---------------------------------远征设置-----------------------------------]]
--[[---------------------------------------------------------------------------]]
--1.可自行新建一个远征脚本复制出这几行数据
--2.可输入C.会弹出输入提示,下拉可找到相应远征
k2_conquest = C.北方鼠輸送作戦_ID21
k3_conquest = C.防空射撃演習_ID6
k4_conquest = C.長距離練習航海_ID2

--设置5-10分钟检测收回并放出一次远征 如果需要远征 请取消前面“--”注释
--Kan.EasyConquestInit(60*5, 60*10);
---------------------------------------------------------------------------------
--所有延时随机增加1-100
Base.SetConfig("Sleep+?",100) 

fullBattleCount = 0

--在执行完一次远征后执行这个函数
function RunRepair()
	if repair == true then
		math.randomseed(os.time())
		if math.random(1,2) == 1 then
			Kan.Repair(2);
		end	
	end
end

function GetRepairID()
	local 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
	return rep_id;
end

function ReSetBattleCount() --每达到某个时间点后重设当前战斗次数
	if reseBattleCount == true then
		Win.Print("战斗次数清零,并清理")
		battleCountNow = 0
	end 
end

s1 = os.time() 

battleCountNow = 0 ; runCount = 0; --初始化当前战斗次数,请勿修改
--执行第一次远征
Kan.EasyConquestRun(false)


while true do --开始无限循环
	if isOpenRunHour then
        Base.WaitRunHour(runHour, true, "", "ReSetBattleCount");
    end
    local a = "开始第:%d次"
	runCount = runCount + 1;
	
	if deleteKanAtBattleCount ~= 0 and runCount % deleteKanAtBattleCount == 1 then
		Kan.DeleteKan(30);
	end

	Win.Print(a:format(runCount))

	local ret = Kan.SupplyAllT();

    if ret.kan11>0 or ret.kan12>0 or ret.kan13>0 or 
	   ret.kan14>0 or ret.kan15>0 or ret.kan16>0 then
        Win.Print('船大/中/小破!使用进入修理')
        
        --修理大中小破的船 6次 都使用桶!!
        Kan.Repair(6, 1 + 2 + 4 + 8, GetRepairID(), false , 1);
    elseif ret.team1 == -1 then
        Win.Pop('补给不足 脚本停止!',true)
        break
    end

    if (battleCountNow >= battleCount) then
		if Kan.EasyConquestIsEnabled() == false then break end
		Kan.EasyConquestWaitNextRun() --等待并执行远征
		if math.random(1,2) == 1 and overBattleRepair == reue then
			Kan.Repair(6, 0, 15, false , 0);
		end
	else 
	    Kan.Sally(mapId[1], mapId[2]) --出击
    	--第一舰队\战斗4次\使用能动点
		
		local battleResult = Kan.Battle(teamId, mapBattlePointCount);
		
		battleCountNow = battleCountNow + 1;
		fullBattleCount = fullBattleCount + 1;
		Win.SetState("累计战斗:" .. fullBattleCount);
		
    	if battleResult == false then
    	    Win.Print('战斗非正常结束..等待' .. waitTime .. '分钟恢复疲劳再打...')
    	    Base.Sleep(1000 * 60 * waitTime); --等待时间
    	else
    	    Win.Print('战斗正常结束..等待' .. waitTime .. '分钟恢复疲劳再打...')
    	    Base.Sleep(1000 * 60 * waitTime); --等待时间
    	end

    	Kan.WaitHome(2000);
    	Base.Sleep(2000);
    end

end

--进入收发远征循环
Kan.EasyConquestEnterLoop("RunRepair")

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

Last updated