Skip to content

Commit

Permalink
更新依赖,优化日常出击流程
Browse files Browse the repository at this point in the history
  • Loading branch information
veadex committed Sep 25, 2024
1 parent d16c790 commit a3bae16
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion autowsgr/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.0.0"
__version__ = "1.0.0.1"
8 changes: 6 additions & 2 deletions autowsgr/fight/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,14 +500,18 @@ def _make_decision(self, *args, **kwargs) -> str:

# =============== 战斗中通用的操作 ===============
def _SL(self):
self.timer.logger.debug("正在执行SL操作")
# 重置地图节点信息
self.timer.port.chapter = None
self.timer.port.map = None
self.reset_chapter_map()

self.timer.restart()
self.timer.go_main_page()
self.timer.set_page("main_page")

def reset_chapter_map(self):
self.timer.port.chapter = None
self.timer.port.map = None


class DecisionBlock:
"""地图上一个节点的决策模块"""
Expand Down
5 changes: 3 additions & 2 deletions autowsgr/fight/normal_fight.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,9 @@ def _enter_fight(self, *args, **kwargs):
self.timer.port.map = self.map
# if not hasattr(self, "level_checked"):
self.timer.wait_images(
[self.Info.map_image] + [IMG.identify_images["fight_prepare_page"]]
) != None
[self.Info.map_image] + [IMG.identify_images["fight_prepare_page"]],
timeout=3,
)
self._go_fight_prepare_page()
MoveTeam(self.timer, self.fleet_id)
if (
Expand Down
1 change: 1 addition & 0 deletions autowsgr/game/expedition.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def run(self, force=False):
bool: 是否进行了远征操作
"""
self.update(force=force)
self.timer.logger.debug("尚未有已完成的远征任务")
if self.is_ready:
self.timer.goto_game_page("expedition_page")
flag = try_to_get_expedition(self.timer)
Expand Down
2 changes: 1 addition & 1 deletion autowsgr/game/game_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def quick_repair(

def get_rewards(timer: Timer):
"""检查任务情况,如果可以领取奖励则领取"""
timer.goto_game_page("main_page")
timer.go_main_page()
if not timer.check_pixel((694, 457), bgr_color=(45, 89, 255)):
return "no"
timer.goto_game_page("mission_page")
Expand Down
4 changes: 2 additions & 2 deletions autowsgr/timer/controllers/android_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def relative_click(self, x, y, times=1, delay=0.5, enable_subprocess=False):
self.shell(f"input tap {str(x)} {str(y)}")
time.sleep(delay * self.config.DELAY)

def click(self, x, y, times=1, delay=0.1, enable_subprocess=False, *args, **kwargs):
def click(self, x, y, times=1, delay=0.3, enable_subprocess=False, *args, **kwargs):
"""点击模拟器相对坐标 (x,y).
Args:
x,y:相对横坐标 (相对 960x540 屏幕)
Expand Down Expand Up @@ -423,7 +423,7 @@ def click_images(self, images, must_click=False, timeout=0, delay=0.5):
Returns:
bool:如果找到图片返回匹配位置,未找到则返回None
"""
return self.click_image(images, must_click, timeout)
return self.click_image(images, must_click, timeout, delay)

def log_screen(
self,
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ opencv-python==4.5.4.60
paddleocr==2.8.1
paddlepaddle==2.6.1
pre-commit
python-bidi==0.4.2
thefuzz
wheel
loguru

0 comments on commit a3bae16

Please sign in to comment.