Skip to content

Commit eb665f7

Browse files
committed
examples: wowjump optimize win11
1 parent 27632c0 commit eb665f7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/wowjump/logout.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ func (l *Logout) checkFlashWindow() {
6969
winapi.FlashWindow(config.flashHwnd, i%1+1)
7070
sleep(500)
7171
}
72+
randomSleep(3333, 6666)
7273
}
7374
func (l *Logout) input() {
7475
if l.subTime == 0 {
@@ -199,6 +200,9 @@ func (l *Logout) CheckWindow() bool {
199200

200201
// TryGetWindow try focus window.
201202
func (l *Logout) TryGetWindow() bool {
203+
if !l.IsValid() {
204+
return false
205+
}
202206
focus := win.GetForegroundWindow()
203207
if focus != l.hwnd {
204208
win.ShowWindow(l.hwnd, win.SW_NORMAL)

0 commit comments

Comments
 (0)