刀_国服兔子测
Last updated
Last updated
--日服2018-09-18兔子脚本
--有问题请加群反馈 -> 152890561
--如果你的队伍不能红脸打,就把wait_time设置一下
--补刀装请自己打开
--远征请自己打开
---------------------------------------------------------------------
--这里是地图点的设置
--默认设置是最远线路 可自行设置要去的点
--地图编号请看脚本顶部的发布地址
--Kan.AddWayAuto(138,225); --5
Kan.AddWayAuto(272,244); --4
Kan.AddWayAuto(260,405); --9
Kan.AddWayAuto(337,492); --10
--Kan.AddWayAuto(611,175); --8
--Kan.AddWayAuto(786,183); --7
--Kan.AddWayAuto(673,273); --6
---------------------------------------------------------------------
--这里是设置区域 一般只需修改这里的值即可
local inspect = require([[base\inspect]])
math.randomseed(os.time())
--出击地图1-1
map_id = {100, 1}
--最多进入多少次地图(出击次数)
max_count = 10
--最多进入多少次战斗点(每个地图进行战斗的点数,比如你只想刷这个地图的第一个点,就设置1)
max_battle_count = 10
--在每次出击完成后等待时间(分钟)
wait_time = 0
--队形优先选择有利 索敌失败后使用的阵型(1-6)
--阵型1-6依次为 鱼鳞 横队 雁行 鹤翼 方阵 逆行 如果非1-6数值 则选择2
formation = 4
--是否锁定阵型(不使用智能有利)
formation_lock = 关
--出击的队伍(1-4)
team_id = 1
--是否无视等级提示
ignore_lv_msg = 开
--好吧 不知道怎么翻译 直接用中文变量了 ...
遇到检非不进入地图 = 关 --如果打开 则在出击时地图上有检非标记就会返回出击失败
战斗中遇到检非停止脚本 = 关
战斗中中伤停止脚本 = 关
战斗中轻伤停止脚本 = 关
---------------------------------------------------------------------
--补刀装设置
--补刀装的设置整体开关
补刀装开关 = 关
--在出击前自动获取当前队伍配置的刀装,如果为关,则必须★自定义设置。
自动采用当前刀装 = 开
--设置多种刀装等级的时候,优先选择並级别
优先使用低级刀装 = 开
if 补刀装开关 == true then --这行不要改
if 自动采用当前刀装 == true then --这行不要改
Tou.ItemSettingAuto(team_id) --这行不要改
else
-----------------------------------------------------------------------------------
--[[
★自定义设置
★选择了自动采用当前刀装的话,这里无需设置!
全=全等级 低=並、上 高=上、特上 也可以自己定义,比如"並|特上"
如果某个位置不补充,可以写为nil,所有刀命名都是简体。
{"投石兵|弓兵", "全"} = 选择投石兵或弓兵的所有等级
]]
Tou.ItemSetting(team_id, 1, {{"投石兵|弓兵", "全"}, {"銃兵", "低"}, {"弓兵", "並"}});
Tou.ItemSetting(team_id, 2, {{"投石兵", "並"}, {"銃兵", "並"}, {"弓兵", "並"}});
Tou.ItemSetting(team_id, 3, {{"投石兵", "並"}, {"銃兵", "並"}});
Tou.ItemSetting(team_id, 4, {{"投石兵", "並"}, nil, {"弓兵", "並"}});
Tou.ItemSetting(team_id, 5, {{"投石兵", "並"}, {"銃兵", "並"}, {"弓兵", "並"}});
Tou.ItemSetting(team_id, 6, {{"投石兵", "並"}, {"銃兵", "並"}, {"弓兵", "並"}});
-----------------------------------------------------------------------------------
end
end
---------------------------------------------------------------------
--远征设置
远征开关 = 关 --远征整体开关
k2_conquest = {1,1} --第2队伍 设置为时代1的第1个远征
k3_conquest = {2,1} --第3队伍 设置为时代2的第1个远征
k4_conquest = {3,1} --第4队伍 设置为时代3的第1个远征
远征检测周期 = {5,10}
--远征为5-10分钟检测一遍
---------------------------------------------------------------------
--下面的东西不要乱改了! 就改上面的设置就行
--所有延时随机增加1-100
Base.SetConfig("Sleep+?",100)
if 远征开关 == 开 then
Tou.EasyConquestInit(60*远征检测周期[1], 60*远征检测周期[2]);
end
--Base.SetValue("FunReWriteToukenBattleWaiting", "AutoWay")
--是否可以加入到坐标中
function CanAddPoint(newTable, valueMain)
Base.Print(string.format("CanAddPoint:%d",#newTable));
Base.Print(inspect(newTable));
if #newTable == 0 then
return true;
end
for key, value in ipairs(newTable) do
Base.Print("CanAddPoint#1");
if math.abs(value["x"] - valueMain["x"]) < 50 and math.abs(value["y"] - valueMain["y"]) < 50 then
return false;
end
end
--Base.Print("加入坐标");
return true;
end
function PointMerge(pointFull)
Base.Print("合并点坐标");
newTable = {};
add = true;
Base.Print("合并点坐标#1");
for key, valueMain in pairs(pointFull) do
Base.Print("合并点坐标#2");
--[[
for a,b in pairs(newTable) do
Base.Print("合并点坐标#3");
if math.abs(b["x"] - valueMain["x"]) < 50 and math.abs(b["y"] - valueMain["y"]) < 50 then
add = false;
break;
end
end
]]
if CanAddPoint(newTable, valueMain) == true then
table.insert(newTable, valueMain);
end
end
Base.Print("合并点坐标完成");
Base.Print(inspect(newTable));
return newTable;
end
--在循环中执行判定
function AutoWay()
x,y = Base.FindColor(14741750);
points = {};
if x ~= -1 then
id = math.random(1,7);
if id == 1 then
Base.Click(138,225);
elseif id == 2 then
Base.Click(272,244);
elseif id == 3 then
Base.Click(260,405);
elseif id == 4 then
Base.Click(337,492);
elseif id == 5 then
Base.Click(611,175);
elseif id == 6 then
Base.Click(786,183);
elseif id == 7 then
Base.Click(673,273);
end
end
end
function IsColorAll(array)
n = 0
ok = 0
while(array[n] ~= nil)
do
if Base.IsColor(array[n][0],array[n][1],array[n][2])==true then
ok = ok + 1
end
n= n+1
end
if ok==n then
return true
else
return false
end
end
function IsDmmunlocker() --判断界面是否正确
array = {};count = {}
array = {[0]=17,19,16777215};count[0] = array
array = {[0]=52,15,16777215};count[1] = array
array = {[0]=105,16,16777215};count[2] = array
array = {[0]=165,16,16777215};count[3] = array
return IsColorAll(count)
end
if IsDmmunlocker() == false then
mode = 0
if 战斗中遇到检非停止脚本 == true then
mode = mode + 4
end
if 战斗中中伤停止脚本 == true then
mode = mode + 1
end
if 战斗中轻伤停止脚本 == true then
mode = mode + 2
end
--执行第一次远征
Tou.EasyConquestRun(false);
for n = 1, max_count do --循环次数
a = "开始第:%d次"
Win.Print(a:format(n))
--出击
if Tou.Sally(map_id[1],map_id[2],遇到检非不进入地图) == false then
Win.Print('无法出阵 退出')
break --无法出阵
end
--战斗
ret = Tou.Battle(max_battle_count, formation, mode, team_id, ignore_lv_msg, formation_lock)
Tou.WaitHome()
if ret > 0 then Win.Print('重伤中断脚本'); break; end;
if ret == -1 then Win.Print('检非中断脚本'); break; end;
if ret == -2 then Win.Print('超过等级 中断脚本'); break; end;
if 补刀装开关 == 开 then
Tou.ItemCompletion(team_id, 优先使用低级刀装) --补充刀装
end
Win.Print('出击后等待' .. wait_time .. '分钟...');
Base.Sleep(1000 * 60 * wait_time)
Base.Sleep(2000)
end
--出击次数达到 进入远征循环
Tou.EasyConquestEnterLoop();
else
Win.Print('检测到游戏内存在空白,坐标无法对应,脚本无法运行!')
end
Win.Pop('脚本执行完毕!')