Skip to content

Commit

Permalink
update:增加每日一抽和半周年活动导航关卡 (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
xufeixianggithub authored Nov 1, 2023
1 parent 715de72 commit 162f5c8
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 84 deletions.
2 changes: 1 addition & 1 deletion extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def screencap_distance(path="screencap"):
distance = defaultdict(int)
shift_right = 0
# 滑动到最右边时 hd-1的x坐标相距屏幕中心的距离
distance[1] = 15
distance[1] = 140
for x in sorted(screencap.glob("*.jpg")):
x = reader.readtext(str(x))
print("x", x)
Expand Down
2 changes: 1 addition & 1 deletion main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ default_auto_timeout_second = 300
-- 设成1000//30时,真机同时开着B服与官服时会出现点着点着脚本就停(从基建开始做邮件)
frame_milesecond = 1000 // 30
milesecond_after_click = frame_milesecond
release_date = "10.30 21:18"
release_date = "11.01 22:19"
ui_submit_color = "#ff0d47a1"
ui_cancel_color = "#ff1976d2"
ui_warn_color = "#ff33ccff"
Expand Down
60 changes: 4 additions & 56 deletions path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4393,49 +4393,7 @@ path.活动 = function(x)
return
end
end
local car_check = function()
if car_checked then return end
car_checked = true
fight_failed_times[cur_fight] = (fight_failed_times[cur_fight] or 0) - 1
if not appear("艺术评论", 1) then return end

if not wait(function()
tap("艺术评论")
if disappear("艺术评论", 1) then return true end
end, 5) then
return
end

wait(function() tap({ screen.width // 2, screen.height // 2 }) end, 1)

local ws = { 597, 1204, 1830 }

for _, w in pairs(ws) do
w = screen.width // 2 + scale(w - 1920 // 2)
for h = scale(211), scale(900), scale(52) do tap({ w, h }) end
end

local paths = {
{
point = { { screen.width // 2, scale(600) }, { screen.width // 2, scale(0) } },
duration = 500,
},
}
gesture(paths)
ssleep(1.5)

for _, w in pairs(ws) do
w = screen.width // 2 + scale(w - 1920 // 2)
for h = scale(211), scale(900), scale(52) do tap({ w, h }) end
end
if not wait(function()
if appear("活动导航0", 1) then return true end
tap("返回")
end, 5) then
return
end
end
car_check()
if not findOne("活动导航0") then return end
if not wait(function()
-- local level = str2int(x:sub(#x), 1)
Expand All @@ -4454,21 +4412,11 @@ path.活动 = function(x)
ssleep(.5)]]

appear("活动导航2")
if not wait(function()
tap("活动导航2")
if not appear("活动导航2", 1) then return true end
end, 5) then return end
local paths = {
{point = {{scale(40), scale(600)}, {scale(40), scale(0)}}, duration = 500},
}
if str2int(x:sub(#x), 1) > 4 or str2int(x:sub(-2), 1) > 4 then -- 5-10关在下一页
gesture(paths)
ssleep(1)
gesture(paths)
ssleep(1.5)
end

swip(x)
ssleep(.5)
tap("作战列表" .. x)
if not findTap(x) then return end

if not appear("开始行动") then
wait(function()
if appear("主页") then return true end
Expand Down
64 changes: 39 additions & 25 deletions point.lua
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,15 @@ point = {
干员第一个采样列表 = { { 661, 199 }, { 715, 244 }, { 769, 325 } },
活动商店支付 = "1245|834|D92536",
活动商店横线 = "350|227|590000",
活动导航0 = "1008|772|F95444",
活动导航1 = "1579|742|DCE4E4,1584|694|E1E1E9",
活动导航2 = "1821|571|282828",
--活动导航0 = "1008|772|7D7D71",
活动导航0 = " 964|841|AE471C",

--活动导航1 = "1579|742|DCE4E4,1584|694|E1E1E9",
活动导航1 = "1635|658|AD9D7C,1642|644|4A4A4A,1644|675|2E2E2E",

--活动导航2 = "1821|571|282828",
活动导航2 = "106|973|453C35,162|989|FDF6E5,386|962|7C6C63,389|1004|7D6E61",

活动导航3 = "559|867|A19878",
活动商店导航 = "300|712|A43329,325|700|A43329",
-- 每次商店颜色都不一样,故采用写死坐标方式,以下为1080p下测得数据
Expand Down Expand Up @@ -326,9 +332,11 @@ point = {
--
-- "1196|472|B89959,838|602|C7A55E"
-- "1195|471|07A9A8,880|594|03B7B6,904|612|393939"
面板赠送一次 = "1773|723|FFFFFF,1761|709|EA6EA0,1795|737|EA6EA0",
--面板赠送一次 = "1773|723|FFFFFF,1761|709|EA6EA0,1795|737|EA6EA0",
面板赠送一次 = "1773|723|FFFFFF,1761|709|725B52,1795|737|6F615B",
面板赠送一次范围 = { 1395, 631, 1920 - 1, 1080 - 1 },
赠送一次 = "1326|877|FF76AD",
--赠送一次 = "1326|877|FF76AD",
赠送一次 = "1326|877|7B6157",
寻访一次 = { 1321, 980 },
感谢典点击领取 = "1377|716|00D654",
感谢庆典返回 = "1564|193|C0C0C0,1536|193|595959,1560|163|595959,1563|213|595959",
Expand Down Expand Up @@ -1014,7 +1022,7 @@ point = {
["GT"] = { 79, 210 },
},
滴水湖周边 = { 1440, 585 },
["HD-1"] = "120|170|00B3FD",
--[[["HD-1"] = "120|170|00B3FD",
["HD-2"] = "120|430|00B3FD",
["HD-3"] = "120|560|00B3FD",
["HD-4"] = "120|690|00B3FD",
Expand All @@ -1023,7 +1031,7 @@ point = {
["HD-7"] = "120|460|00B3FD",
["HD-8"] = "120|595|00B3FD",
["HD-9"] = "124|720|00B3FD",
["HD-10"] = "123|850|00B3FD",
["HD-10"] = "123|850|00B3FD",]]
作战列表 = {
["STOP"] = { 0, 0 },
["EXIT"] = { 0, 0 },
Expand Down Expand Up @@ -1059,16 +1067,18 @@ point = {
["PR-C-0"] = "666|595|000000,672|612|FFFFFF,511|597|000000,672|636|FFFFFF",
["PR-D-0"] = "689|628|000000,693|646|FFFFFF,537|626|000000,699|671|FFFFFF",

["HD-1"] = { 960, 495 },
["HD-2"] = { 960, 495 },
["HD-3"] = { 960, 495 },
["HD-4"] = { 960, 495 },
["HD-5"] = { 960, 495 },
["HD-6"] = { 960, 495 },
["HD-7"] = { 960, 495 },
["HD-8"] = {960, 495},
["HD-9"] = {960, 342},
["HD-10"] = {960, 729},

["HD-1"] = {742,353},
["HD-2"] = {960,471},
["HD-3"] = {960,327},
["HD-4"] = {960,471},
["HD-5"] = {960,639},
["HD-6"] = {960,798},
["HD-7"] = {960,798},
["HD-8"] = {960,798},
["HD-9"] = {960,579},
["HD-10"] = {960,225},


["CW-6"] = { 960, 603 },
["GT-5"] = { 1270, 570 },
Expand Down Expand Up @@ -1973,14 +1983,18 @@ center = {

distance = {

["HD-1"] = { swip_right_max, -438 },
["HD-2"] = { swip_right_max, -892 },
["HD-3"] = { swip_right_max, -1334 },
["HD-4"] = { swip_right_max, -1772 },
["HD-5"] = { swip_right_max, -2219 },
["HD-6"] = { swip_right_max, -2404 },
["HD-7"] = { swip_right_max, -2748 },
["HD-8"] = { swip_right_max, -3058 },

["HD-1"] = { swip_right_max, -0},
["HD-2"] = { swip_right_max, -79},
["HD-3"] = { swip_right_max, -285},
["HD-4"] = { swip_right_max, -494},
["HD-5"] = { swip_right_max, -683},
["HD-6"] = { swip_right_max, -971},
["HD-7"] = { swip_right_max, -1308},
["HD-8"] = { swip_right_max, -1773},
["HD-9"] = { swip_right_max, -1994},
["HD-10"] = { swip_right_max, -1985},


["CW-6"] = { swip_right_max, -1349 },
["GT-5"] = { swip_right_max, -1535},
Expand Down
2 changes: 1 addition & 1 deletion util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4247,7 +4247,7 @@ update_state_from_ui = function()
-- log("fight", fight)

-- 活动开放时间段
hd_open_time_end = parse_time("202311010400")
hd_open_time_end = parse_time("202311220400")
hd_shop_open_time_end = parse_time("202309260400") -- 活动商店关闭时间
hd2_open_time_end = parse_time("202303210400")
hd2_shop_open_time_end = parse_time("202302240400") -- 活动2商店关闭时间
Expand Down

0 comments on commit 162f5c8

Please sign in to comment.