Skip to content

Commit

Permalink
增加云崩铁支持
Browse files Browse the repository at this point in the history
  • Loading branch information
CHNZYX committed Aug 29, 2024
1 parent e7be44a commit 9d9c4cd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions diver.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ def route(self):
Text = win32gui.GetWindowText(hwnd)
warn_game = False
cnt = 0
while Text != "崩坏:星穹铁道" and not self._stop:
while Text != "崩坏:星穹铁道" and Text != "云·星穹铁道" and not self._stop:
self.lst_changed = time.time()
if self._stop:
raise KeyboardInterrupt
if not warn_game:
warn_game = True
log.warning("等待游戏窗口")
log.warning(f"等待游戏窗口,当前窗口:{Text}")
time.sleep(0.5)
cnt += 1
if cnt == 1200:
Expand Down
4 changes: 2 additions & 2 deletions simul.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ def route(self):
Text = win32gui.GetWindowText(hwnd)
warn_game = False
cnt = 0
while Text != "崩坏:星穹铁道" and not self._stop:
while Text != "崩坏:星穹铁道" and Text != "云·星穹铁道" and not self._stop:
self.lst_changed = time.time()
if self._stop:
raise KeyboardInterrupt
if not warn_game:
warn_game = True
log.warning("等待游戏窗口")
log.warning(f"等待游戏窗口,当前窗口:{Text}")
time.sleep(0.5)
cnt += 1
if cnt == 1200:
Expand Down
6 changes: 4 additions & 2 deletions utils/diver/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def set_forground():
else:
shell.SendKeys("")
game_nd = win32gui.FindWindow("UnityWndClass", "崩坏:星穹铁道")
if game_nd == 0:
game_nd = win32gui.FindWindow(None, "云·星穹铁道")
win32gui.SetForegroundWindow(game_nd)
except:
pass
Expand Down Expand Up @@ -146,7 +148,7 @@ def __init__(self):
# x01y01:窗口左上右下坐标
# xx yy:窗口大小
# scx scy:当前窗口和基准窗口(1920*1080)缩放大小比例
if Text == "崩坏:星穹铁道":
if Text == "崩坏:星穹铁道" or Text == "云·星穹铁道":
if self.xx != 1920 or self.yy != 1080:
log.error(f"分辨率错误 {self.xx} {self.yy} 请设为1920*1080")
break
Expand Down Expand Up @@ -523,7 +525,7 @@ def exist_minimap(self):
def get_screen(self):
hwnd = win32gui.GetForegroundWindow() # 根据当前活动窗口获取句柄
Text = win32gui.GetWindowText(hwnd)
while Text != "崩坏:星穹铁道" and not self._stop:
while Text != "崩坏:星穹铁道" and Text != "云·星穹铁道" and not self._stop:
log.warning("等待游戏窗口")
time.sleep(0.5)
hwnd = win32gui.GetForegroundWindow() # 根据当前活动窗口获取句柄
Expand Down
4 changes: 3 additions & 1 deletion utils/simul/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def set_forground():
else:
shell.SendKeys("")
game_nd = win32gui.FindWindow("UnityWndClass", "崩坏:星穹铁道")
if game_nd == 0:
game_nd = win32gui.FindWindow(None, "云·星穹铁道")
win32gui.SetForegroundWindow(game_nd)
except:
pass
Expand Down Expand Up @@ -152,7 +154,7 @@ def __init__(self):
# x01y01:窗口左上右下坐标
# xx yy:窗口大小
# scx scy:当前窗口和基准窗口(1920*1080)缩放大小比例
if Text == "崩坏:星穹铁道":
if Text == "崩坏:星穹铁道" or Text == "云·星穹铁道":
time.sleep(1)
if self.xx != 1920 or self.yy != 1080:
log.error("分辨率错误")
Expand Down

0 comments on commit 9d9c4cd

Please sign in to comment.