Skip to content

Commit

Permalink
add 至简、鸿雪、晓歌技能;fix 代理前后跳过剧情卡住
Browse files Browse the repository at this point in the history
  • Loading branch information
tkkcc committed Aug 13, 2022
1 parent 117232f commit c79c782
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 61 deletions.
2 changes: 1 addition & 1 deletion 0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
extract() {
rm -rf arknights
rm -rf arknights_extract
unzip ${1:-arknights.apk} -d arknights
unzip ${1:-arknights-hg-1861.apk} -d arknights
./extract.py unpack
}
release() {
Expand Down
2 changes: 1 addition & 1 deletion ArknightsGameData
Submodule ArknightsGameData updated 680 files
2 changes: 1 addition & 1 deletion docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ pr => pr-b-2*99 pr-a-2*99 pr-c-2*99 pr-d-2*99 pr-b-1*99 pr-a-1*99 pr-c-1*99 pr-d

高产换班根据 当前实际可用基建技能 穷举所有干员组合,计算每个组合8小时平均加成,选择最高加成组合,有以下限制:
1. 只考虑制造站贸易站收益。只考虑当前站最优,并非同类站总和最优。
1. 忽略其他站技能效果(迷迭香、焰尾、森蚺),忽略“意识协议”技能(水月)效果。
1. 忽略其他站技能效果(迷迭香、焰尾、森蚺)“意识协议”(水月)、“源石技艺理论应用”(多萝西)效果。
1. 部分技能效果采用近似估计,且假定每次换班间隔8小时。
1. 检查各站效率加成,动手换下看看会不会更高,有问题最好录屏反馈。

Expand Down
2 changes: 1 addition & 1 deletion main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ default_findcolor_confidence = 95 / 100
-- 设成1000//30时,真机同时开着B服与官服时会出现点着点着脚本就停(从基建开始做邮件)
frame_milesecond = 1000 // 30
milesecond_after_click = frame_milesecond
release_date = "08.11 20:30"
release_date = "08.13 15:37"
ui_submit_color = "#ff0d47a1"
ui_cancel_color = "#ff1976d2"
ui_warn_color = "#ff33ccff"
Expand Down
82 changes: 57 additions & 25 deletions path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ path.base = {
if not wait(function()
if not findOne("接管作战") then return true end
-- log(126)
if findOne("暂停中") then
if findOne("暂停中") and not disappear("暂停中", 5) then
tap("开包skip")
disappear("暂停中")
end
Expand Down Expand Up @@ -197,7 +197,8 @@ path.base = {
end

-- 战斗记录未同步
if findOne("返回确认界面") then
if findOne("返回确认界面") and
not disappear("返回确认界面", 5) then
tap("左取消")
unexpect_return = true
end
Expand All @@ -214,7 +215,14 @@ path.base = {
tap("开始行动1")

appear({"开始行动", "接管作战"}, 1)
end), 60) then return end

end), 60) then
-- if findOne("跳过剧情2") and not disappear("跳过剧情2", 10) then
path.跳过剧情()
-- end

return
end

if unfinished then return path.base.接管作战() end

Expand Down Expand Up @@ -1351,6 +1359,7 @@ path.基建信息获取 = function()
goldStationNum = 0
tradingStationNum = 0
powerStationNum = 0
totalStationLevel = 0

dormitoryStation = {}
dormitoryLevel = {}
Expand Down Expand Up @@ -1458,6 +1467,17 @@ path.基建信息获取 = function()
-- manufacturingStationLevel = map(function() return 3 end, manufacturingStation)
manufacturingStationNum = #manufacturingStation

-- 控制中枢与右侧满设施 按其他站等级情况近似
totalStationLevel = table.sum(table.cat({
dormitoryLevel, powerStationLevel, manufacturingStationLevel,
tradingStationLevel,
}))
totalStationLevel = totalStationLevel +
math.round((5 + 12) * totalStationLevel / (47))

log("totalStationLevel", totalStationLevel)
-- exit()

releaseCapture()

log(1216, tradingStationLevel, manufacturingStationLevel, powerStationLevel,
Expand Down Expand Up @@ -1672,7 +1692,7 @@ path.制造换班 = function(trading)
local stationType = trading and "贸易站" or "制造站"
chooseOperator(stationType, type, stationLevel, tradingStationNum,
powerStationNum, dormitoryCapacity, dormitoryLevelSum,
goldStationNum)
goldStationNum, totalStationLevel)

wait(function(reset_wait_start_time)
tap("确认蓝")
Expand Down Expand Up @@ -1921,7 +1941,7 @@ path.总览换班 = function()
-- 排除异格干员
local operator = {}
discover(operator, {}, 1, true)
-- log("1905", operator)
log("1905", operator)
operator = table.filter(operator, function(x) return x[3] >= 0 end)
operator = map(function(x) return x[4] end, operator)
operator = table.slice(operator, 1, limit)
Expand Down Expand Up @@ -2031,7 +2051,7 @@ path.办公室换班 = function(stationType)

chooseOperator(stationType, type, stationLevel, tradingStationNum,
powerStationNum, dormitoryCapacity, dormitoryLevelSum,
goldStationNum)
goldStationNum, totalStationLevel)

if not wait(function(reset_wait_start_time)
tap("确认蓝")
Expand Down Expand Up @@ -2084,7 +2104,7 @@ path.会客厅换班 = function(stationType)

chooseOperator(stationType, type, stationLevel, tradingStationNum,
powerStationNum, dormitoryCapacity, dormitoryLevelSum,
goldStationNum)
goldStationNum, totalStationLevel)

if not wait(function(reset_wait_start_time)
tap("确认蓝")
Expand Down Expand Up @@ -2810,10 +2830,19 @@ path.开始游戏 = function(x, disable_ptrs_check)
if not findOne(state) then return true end
tap("开始行动红按钮")
end, 10) then return end
if not appear({"接管作战", "单选确认框"}, 60) then
log(1430)
if not wait(function()
if findAny({"接管作战", "单选确认框"}) then return true end
end, 60) then

-- if findOne("跳过剧情2") and not disappear("跳过剧情2", 10) then
path.跳过剧情()
-- end
return
end
-- if not appear({"接管作战", "单选确认框"}, 60) then
-- log(1430)
-- return
-- end
if findOne("单选确认框") then return end
return path.base.接管作战()
elseif stone_times < max_stone_times and state == "源石恢复理智取消" or
Expand Down Expand Up @@ -3336,11 +3365,7 @@ path.活动 = function(x)
tap("面板活动2")
if not wait(function()
if findOne("活动导航1") then return true end
if findOne("跳过剧情") then
tap("跳过剧情")
ssleep(.5)
tap("跳过剧情确认")
end
if findOne("跳过剧情") then path.跳过剧情() end
end, 10) then return end

local car_check = function()
Expand All @@ -3363,7 +3388,8 @@ path.活动 = function(x)
reset_wait_start_time()
end
tap("车友交流")
end, 2) then return end
disappear("车友交流")
end, 5) then return end

if not wait(function(reset_wait_start_time)
if findOne("车友交流") then return true end
Expand Down Expand Up @@ -3422,11 +3448,7 @@ path.活动任务与商店 = function()
if not wait(function()
tap("作战主页列表1")
if findOne("活动导航1") then return true end
if findOne("跳过剧情") then
tap("跳过剧情")
ssleep(.5)
tap("跳过剧情确认")
end
if findOne("跳过剧情") then path.跳过剧情() end
end, 10) then return end

-- if not wait(function()
Expand Down Expand Up @@ -3583,11 +3605,7 @@ path["1-11"] = function()
if not appear("跳过剧情", 20) then return end
ssleep(.5)

if findOne("跳过剧情") then
tap("跳过剧情")
ssleep(.5)
tap("跳过剧情确认")
end
if findOne("跳过剧情") then path.跳过剧情() end

-- start
ssleep(23)
Expand Down Expand Up @@ -5487,3 +5505,17 @@ path.公开招募加急 = function()
point.公开招募列表 = table.slice(point.公开招募列表, 1, 1)
forever(path.公开招募)
end

path.跳过剧情 = function()
tap("战略确认")
ssleep(2)
back()
ssleep(2)
local txt = nil
if not wait(function()
txt = ocr("fullscreen")
txt = table.findv(txt, function(x) return x.text:find('跳过剧情') end)
if txt then return true end
end, 5) then return back() end
tap({txt.r, txt.b})
end
6 changes: 6 additions & 0 deletions point.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ minscale = min(hscale, wscale)
maxscale = max(hscale, wscale)

point = {
fullscreen = {0, 0, screen.width - 1, screen.height - 1},
后院工坊 = {174, 814},
自走车友会有 = "193|895|FF5341",
自走车友会 = {225, 1015},
Expand Down Expand Up @@ -1235,8 +1236,10 @@ point = {
邮件信封 = "320|52|313131,377|53|313131,377|91|313131,337|80|313131",
源石理智兑换次数上限 = "1913|923|FDFDFD,1909|87|FFFFFF,1325|333|CED0D6,1343|529|898989,1325|568|FEFEFE,1345|556|FBFBFB,1378|566|F3F3F3,1347|591|898989,1554|683|898989,1339|672|898989,1524|672|898989,1593|679|898989",
源石不足 = "1309|548|898989,1464|463|898989,1344|598|FBFBFB,1349|608|FCFCFC,1483|687|898989,1474|583|FDFDFD,965|254|676767,964|255|FCFCFC,1428|474|F9F9F9,1402|474|898989,252|345|FFFFFF,922|904|C5C5CD",
跳过剧情2 = "1812|1039|000000,1818|78|FFFFFF,822|1048|000000",
跳过剧情 = "1820|79|FFFFFF",
跳过剧情确认 = {1197, 547},
-- "1192|688|1C1A16"
-- 两倍速 = {1650, 75},
两倍速 = "1657|102|FFFFFF",
资源收集列表 = {
Expand All @@ -1262,6 +1265,7 @@ autojs提供OCR、图像匹配、速度没测过。OCR看现有明日方舟辅
--]]

center = {

车友交流2 = "center_center",
车友交流1 = "center_center",
车友交流 = "right_bottom",
Expand Down Expand Up @@ -1469,6 +1473,8 @@ center = {
药剂恢复理智取消 = "center_center",
恢复理智确认 = "center_center",

-- 跳过剧情 = "right_top",
跳过剧情2 = "center_center",
跳过剧情 = "right_top",
跳过剧情确认 = "center_center",
两倍速 = "right_top",
Expand Down
2 changes: 1 addition & 1 deletion release
Submodule release updated from 3623ab to 2bb5f9
32 changes: 26 additions & 6 deletions skill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ discover = still_wrapper(function(operators, pngdata, pageid, mood_only)
if math.abs(colorDiff(yg1, yg2)) < 36 and table.any(ygStaitonColor,
function(color)
return math.abs(colorDiff(yg1, color)) < 36
end) and (math.abs(colorDiff(yg3, "ff003030")) < 45) then
end) and (math.abs(colorDiff(yg3, "ff003030")) < 75) then
-- ffffbb22
log("异格干员")
mood = -mood
if mood == 0 then mood = -1 end
Expand Down Expand Up @@ -351,6 +352,10 @@ tradingStationOperatorBest = function(operator, dormitoryCapacity,
if all['bskill_tra_flow_gs1'] then
base = base + 0.05 + (gold // 4) * 0.15 * all['bskill_tra_flow_gs1']
end
-- 鸿雪
if all['bskill_tra_flow_gs'] then
base = base + 0.00 + (gold // 1) * 0.05 * all['bskill_tra_flow_gs']
end

--
if all['bskill_tra_limit_count'] then
Expand Down Expand Up @@ -452,8 +457,8 @@ testManufacturingStationOperatorBest = function()
local best, best_score
best, best_score = manufacturingStationOperatorBest(operator,
tradingStationNum,
powerStationNum, goodType,
level)
powerStationNum, 0,
goodType, level)

log(best, best_score)
end
Expand All @@ -462,11 +467,13 @@ end
-- operator: 列表,每个元素包含两个技能图标与心情
-- tradingStationNum: 贸易站数量
-- powerStationNum: 发电站数量
-- totalStationLevel: 等级总量
-- type: 制造物类别
-- level: 制造站等级
-- 返回效率最高的index
manufacturingStationOperatorBest = function(operator, tradingStationNum,
powerStationNum, goodType, level)
powerStationNum, totalStationLevel,
goodType, level)
-- 参考 https://prts.wiki/w/罗德岛基建/制造站
local maxStorage, maxOperator
maxOperator = level
Expand All @@ -488,10 +495,11 @@ manufacturingStationOperatorBest = function(operator, tradingStationNum,
-- 4. 忽略 意识协议 效果(标准化技能识别不支持)
-- 5. 忽略 我寻思能行 效果(发电站技能加成)
local base, disable_moon_effect, storage, storages, standard, all, station,
station_only, only_need
station_only, only_need, robot

local score = function(icons)
base = 0
robot = 0 -- 工程机器人
storage = {} -- 容量效果
standard = 0 -- 标准化技能数量
station = 0 -- 根据设施加成
Expand Down Expand Up @@ -591,6 +599,8 @@ manufacturingStationOperatorBest = function(operator, tradingStationNum,
if goodType == '源石' then base = base + 0.35 end
elseif icon == 'bskill_man_originium1' then
if goodType == '源石' then base = base + 0.3 end
elseif icon == 'bskill_man_constrlv' then
robot = min(64, robot + totalStationLevel)
elseif icon == 'empty' then
log('empty')
end
Expand All @@ -599,6 +609,10 @@ manufacturingStationOperatorBest = function(operator, tradingStationNum,
if debug_mode then log(428, icon, icons, base, station, storage) end

-- 应用全局性技能
-- 至简
if all["bskill_man_spd_bd3"] then base = base + (robot // 16) * 0.05 end
if all["bskill_man_spd_bd4"] then base = base + (robot // 8) * 0.05 end

if all['bskill_man_spd_variable31'] then
-- 泡泡
for _, s in pairs(storage) do
Expand Down Expand Up @@ -885,7 +899,7 @@ end
-- 是否是贸易站,商品类别
chooseOperator = function(stationType, goodType, stationLevel,
tradingStationNum, powerStationNum, dormitoryCapacity,
dormitoryLevelSum, goldStationNum)
dormitoryLevelSum, goldStationNum, totalStationLevel)
log("stationType", stationType)
log("goodType", goodType)
log("stationLevel", stationLevel)
Expand All @@ -894,6 +908,7 @@ chooseOperator = function(stationType, goodType, stationLevel,
log("dormitoryCapacity", dormitoryCapacity)
log("dormitoryLevelSum", dormitoryLevelSum)
log("goldStationNum", goldStationNum)
log("totalStationLevel", totalStationLevel)
-- exit()

local start_time = time()
Expand Down Expand Up @@ -939,6 +954,7 @@ chooseOperator = function(stationType, goodType, stationLevel,
best, best_score = manufacturingStationOperatorBest(operator,
tradingStationNum,
powerStationNum,
totalStationLevel,
goodType, stationLevel)
elseif stationType == "贸易站" then
best, best_score = tradingStationOperatorBest(operator, dormitoryCapacity,
Expand Down Expand Up @@ -998,6 +1014,10 @@ meetingStationOperatorBest = function(operator)
for _, o in pairs(operator) do
if o[1] == "bskill_meet_spd&cost" or o[2] == "bskill_meet_spd&cost" then
table.insert(best, 1, o)
elseif o[1] == "bskill_meet_spdnotowned2" or o[2] ==
"bskill_meet_spdnotowned2" then
-- 晓歌有人评测过吗
table.insert(best, 1, o)
elseif o[1] == "bskill_meet_spd3" or o[2] == "bskill_meet_spd3" then
table.insert(best, o)
else
Expand Down
Loading

0 comments on commit c79c782

Please sign in to comment.