Skip to content

Commit

Permalink
Merge pull request #729 from Starry-Wind/main-beta
Browse files Browse the repository at this point in the history
Main beta
  • Loading branch information
Night-stars-1 authored Oct 4, 2023
2 parents ce236b9 + 5a579e5 commit 96a4734
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions utils/calculated.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,23 @@ def wait_join(self):
return endtime
time.sleep(0.1)

def switch_window(self, dt=0.1):
ws = pwc.getWindowsWithTitle(self.title)
time.sleep(dt)
if len(ws) >= 1:
for w in ws:
# 避免其他窗口也包含崩坏:星穹铁道,比如正好开着github脚本页面
# log.debug(w.title)
if w.title == self.title:
#client.Dispatch("WScript.Shell").SendKeys('%')
self.keyboard.press(Key.right)
self.keyboard.release(Key.right)
w.activate()
break
else:
log.info(_('没找到窗口{title}').format(title=self.title))
time.sleep(dt)

def open_map(self, open_key):
while True:
self.keyboard.press(open_key)
Expand Down

0 comments on commit 96a4734

Please sign in to comment.