Created
May 7, 2023 07:09
-
-
Save krrr/d755f3e38d6906564b3717f990de962c to your computer and use it in GitHub Desktop.
genshin dialog auto skip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#MaxThreadsPerHotkey 2 | |
if (not A_IsAdmin) | |
Run '*RunAs "' A_AhkPath '" /restart "' A_ScriptFullPath '"' | |
skipDialogRunning := false | |
DIALOG_NAME_COLOR := 0xFFC300 | |
#HotIf WinActive("ahk_exe YuanShen.exe") | |
Pause:: { | |
global skipDialogRunning | |
if (skipDialogRunning) { | |
skipDialogRunning := false | |
} else { | |
SkipDialog() | |
} | |
} | |
SkipDialog() { | |
global skipDialogRunning | |
skipDialogRunning := true | |
WinGetClientPos &ysX, &ysY, &ysW, &ysH, "ahk_exe YuanShen.exe" | |
clickX := ysX + ysW - ysW * 0.2 | |
clickY := ysY + ysH - ysH * 0.23 | |
nameX1 := ysX + (ysW / 2) - ysW*0.02 | |
nameY1 := ysY + ysH - ysH * 0.21 | |
nameX2 := nameX1 + ysW*0.04 | |
nameY2 := nameY1 + ysH*0.03 | |
Loop { | |
namePresent := PixelSearch(&nameFoundX, &nameFoundY, nameX1, nameY1, nameX2, nameY2, DIALOG_NAME_COLOR) | |
if (not namePresent) { | |
Sleep(500) | |
continue | |
} | |
if (not skipDialogRunning) { | |
break | |
} | |
MouseMove(clickX, clickY) | |
ControlClick("x" clickX " y" clickY, "ahk_exe YuanShen.exe",,,, "NA Pos") | |
N := Random(80, 140) | |
Sleep(N) | |
if (not skipDialogRunning) { | |
break | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment