许愿墙签到
This commit is contained in:
parent
8a61de4b81
commit
cf83b49203
13 changed files with 99 additions and 6 deletions
|
@ -671,6 +671,10 @@
|
|||
"label": "MOON_FESTIVAL",
|
||||
"comment": "月饼"
|
||||
},
|
||||
"1503": {
|
||||
"label": "SIGN_IN_ORUNDUM",
|
||||
"comment": "幸运墙签到"
|
||||
},
|
||||
"1601": {
|
||||
"label": "OPERATOR_MANAGEMENT",
|
||||
"comment": "干员列表"
|
||||
|
|
BIN
mower/resources/sign_in/orundum/banner.png
(Stored with Git LFS)
Normal file
BIN
mower/resources/sign_in/orundum/banner.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
mower/resources/sign_in/orundum/choose.png
(Stored with Git LFS)
Normal file
BIN
mower/resources/sign_in/orundum/choose.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
mower/resources/sign_in/orundum/complete.png
(Stored with Git LFS)
Normal file
BIN
mower/resources/sign_in/orundum/complete.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
mower/resources/sign_in/orundum/confirm.png
(Stored with Git LFS)
Normal file
BIN
mower/resources/sign_in/orundum/confirm.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
mower/resources/sign_in/orundum/entry.png
(Stored with Git LFS)
Normal file
BIN
mower/resources/sign_in/orundum/entry.png
(Stored with Git LFS)
Normal file
Binary file not shown.
|
@ -3,6 +3,7 @@ from datetime import datetime
|
|||
from mower.utils.graph import SceneGraphSolver
|
||||
|
||||
from .headhunting import Headhunting
|
||||
from .orundum import Orundum
|
||||
from .sign_in import SignIn
|
||||
|
||||
|
||||
|
@ -11,5 +12,6 @@ class SignInSolver(SceneGraphSolver):
|
|||
success = True
|
||||
if datetime.now() < datetime(2024, 11, 15):
|
||||
success = success and SignIn().run()
|
||||
success = success and Orundum().run()
|
||||
success = success and Headhunting().run()
|
||||
return success
|
||||
|
|
60
mower/solvers/sign_in/orundum.py
Normal file
60
mower/solvers/sign_in/orundum.py
Normal file
|
@ -0,0 +1,60 @@
|
|||
from datetime import datetime, timedelta
|
||||
|
||||
from mower.utils import config
|
||||
from mower.utils.graph import SceneGraphSolver
|
||||
from mower.utils.log import logger
|
||||
from mower.utils.scene import Scene
|
||||
|
||||
from .utils import notify
|
||||
|
||||
activity_name = "狂欢游乐好运墙"
|
||||
|
||||
|
||||
class Orundum(SceneGraphSolver):
|
||||
solver_name = "幸运墙"
|
||||
|
||||
def run(self):
|
||||
logger.info(f"Start: {activity_name}")
|
||||
self.in_progress = False
|
||||
self.start_time = datetime.now()
|
||||
self.success = False
|
||||
super().run()
|
||||
return self.success
|
||||
|
||||
def transition(self) -> bool:
|
||||
if datetime.now() - self.start_time > timedelta(minutes=2):
|
||||
notify(f"{activity_name}签到超时", level="ERROR")
|
||||
return True
|
||||
elif (scene := self.scene()) == Scene.INDEX:
|
||||
score, scope = config.recog.match("sign_in/orundum/entry")
|
||||
if score >= 0.8:
|
||||
self.tap(scope)
|
||||
self.in_progress = True
|
||||
else:
|
||||
notify(f"未找到{activity_name}签到入口")
|
||||
self.success = True
|
||||
return True
|
||||
elif scene == Scene.SIGN_IN_ORUNDUM:
|
||||
if self.find("sign_in/orundum/complete"):
|
||||
if self.in_progress:
|
||||
self.sleep()
|
||||
else:
|
||||
self.success = True
|
||||
notify(f"今日{activity_name}奖励已领完")
|
||||
return True
|
||||
for x in range(445, 1520, 213):
|
||||
if self.find("sign_in/orundum/choose"):
|
||||
self.tap((x, 415))
|
||||
elif pos := self.find("sign_in/orundum/confirm"):
|
||||
self.in_progress = True
|
||||
self.ctap(pos)
|
||||
else:
|
||||
self.sleep()
|
||||
elif scene == Scene.MATERIEL:
|
||||
if self.in_progress:
|
||||
notify(f"成功领取{activity_name}奖励")
|
||||
self.success = True
|
||||
return True
|
||||
self.tap((960, 960))
|
||||
else:
|
||||
self.scene_graph_step(Scene.INDEX)
|
|
@ -1,4 +1,3 @@
|
|||
from mower.utils import config
|
||||
from mower.utils.scene import Scene
|
||||
from mower.utils.solver import BaseSolver
|
||||
|
||||
|
@ -30,6 +29,8 @@ from .utils import edge
|
|||
@edge(Scene.SIGN_IN_DAILY, Scene.INDEX)
|
||||
@edge(Scene.INDEX_ORIGINITE, Scene.INDEX)
|
||||
@edge(Scene.INDEX_SANITY, Scene.INDEX)
|
||||
@edge(Scene.ANNOUNCEMENT, Scene.INDEX)
|
||||
@edge(Scene.SIGN_IN_ORUNDUM, Scene.INDEX)
|
||||
def back_to_index(solver: BaseSolver):
|
||||
solver.back()
|
||||
|
||||
|
@ -70,11 +71,6 @@ def materiel(solver: BaseSolver):
|
|||
solver.tap((960, 960))
|
||||
|
||||
|
||||
@edge(Scene.ANNOUNCEMENT, Scene.INDEX)
|
||||
def announcement(solver: BaseSolver):
|
||||
solver.tap(config.recog.check_announcement())
|
||||
|
||||
|
||||
@edge(Scene.AGREEMENT_UPDATE, Scene.INDEX)
|
||||
def agreement(solver: BaseSolver):
|
||||
if pos := solver.find("read_and_agree"):
|
||||
|
|
|
@ -340,6 +340,8 @@ class Recognizer:
|
|||
self.scene = Scene.ROGUE_INDEX
|
||||
elif self.find("contract"):
|
||||
self.scene = Scene.HEADHUNTING_RESULT
|
||||
elif self.find("sign_in/orundum/banner"):
|
||||
self.scene = Scene.SIGN_IN_ORUNDUM
|
||||
elif self.is_black():
|
||||
self.scene = Scene.LOADING
|
||||
|
||||
|
|
|
@ -116,6 +116,10 @@ color = {
|
|||
"sign_in/banner": (129, 763),
|
||||
"sign_in/headhunting/available": (1177, 857),
|
||||
"sign_in/moon_festival/moon_cake": (1216, 503),
|
||||
"sign_in/orundum/banner": (93, 814),
|
||||
"sign_in/orundum/choose": (1590, 798),
|
||||
"sign_in/orundum/complete": (1641, 800),
|
||||
"sign_in/orundum/confirm": (1625, 798),
|
||||
"skip": (1803, 32),
|
||||
"sss/action": (1641, 967),
|
||||
"sss/action_ex": (1641, 966),
|
||||
|
|
|
@ -335,6 +335,8 @@ class Scene:
|
|||
"签到活动"
|
||||
MOON_FESTIVAL = 1502
|
||||
"月饼"
|
||||
SIGN_IN_ORUNDUM = 1503
|
||||
"幸运墙签到"
|
||||
OPERATOR_MANAGEMENT = 1601
|
||||
"干员列表"
|
||||
OPERATOR_DETAILS = 1602
|
||||
|
@ -522,6 +524,7 @@ SceneComment = {
|
|||
1402: "活动关选择",
|
||||
1501: "签到活动",
|
||||
1502: "月饼",
|
||||
1503: "幸运墙签到",
|
||||
1601: "干员列表",
|
||||
1602: "干员详情",
|
||||
1701: "肉鸽作战前,正在编队",
|
||||
|
|
|
@ -38,6 +38,8 @@ Res = Literal[
|
|||
"choose_agent/profession/WARRIOR",
|
||||
"choose_agent/profession/choose_arrow",
|
||||
"choose_agent/rect",
|
||||
"choose_agent/riic/work_state",
|
||||
"choose_agent/riic/work_state_blue",
|
||||
"choose_agent/riic_empty",
|
||||
"choose_agent/support_agent",
|
||||
"choose_agent/support_skill_be_choosen",
|
||||
|
@ -532,6 +534,11 @@ Res = Literal[
|
|||
"sign_in/headhunting/available",
|
||||
"sign_in/moon_festival/banner",
|
||||
"sign_in/moon_festival/moon_cake",
|
||||
"sign_in/orundum/banner",
|
||||
"sign_in/orundum/choose",
|
||||
"sign_in/orundum/complete",
|
||||
"sign_in/orundum/confirm",
|
||||
"sign_in/orundum/entry",
|
||||
"skill_collect_confirm",
|
||||
"skill_confirm",
|
||||
"skip",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue