Skip to content

Commit

Permalink
国际版适配
Browse files Browse the repository at this point in the history
  • Loading branch information
Nigh committed Jul 27, 2021
1 parent 5920b1a commit 25b658d
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 8 deletions.
47 changes: 39 additions & 8 deletions DoMiSo.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ debug:=0
Else
debug:=1

; debugHotkey:=debug
debugHotkey:=0

#SingleInstance force
SetBatchLines, -1
SetWorkingDir %A_ScriptDir%
Expand Down Expand Up @@ -71,6 +74,10 @@ genshin_note_map := { 48:"z"
, 79:"t"
, 81:"y"
, 83:"u" }
if debug
{
MsgBox, 0x41030,ATTENTION,You are running DEBUG version of the program!!!
}
#Include gui.ahk
Gui, Submit, NoHide
sheet_content:=editer
Expand Down Expand Up @@ -103,20 +110,27 @@ genshin_array_sort(ByRef array)
}

genshin_main:
if(genshin_play_p > genshin_play_array.Length())
genshin_win_hwnd:=genshin_window_exist()
if((genshin_play_p > genshin_play_array.Length()) or (!genshin_win_hwnd))
{
isBtn1Playing:=0
btn1update()
SetTimer, genshin_main, Off
Return
}
DllCall("QueryPerformanceCounter", "Int64P", nowTime)
IfWinNotActive, ahk_exe YuanShen.exe
WinActivate, ahk_exe YuanShen.exe
; genshin_window_active(genshin_window_exist())
While(nowTime//(freq/1000)-startTime >= genshin_play_array[genshin_play_p].delay)
{
Send, % genshin_play_array[genshin_play_p].note
; ControlSend, ,% genshin_play_array[genshin_play_p].note, ahk_exe YuanShen.exe
if not genshin_play_array[genshin_play_p].note
{
Return
}
if WinActive("ahk_id " genshin_win_hwnd)
{
Send, % genshin_play_array[genshin_play_p].note
}
; ControlSend, ,% genshin_play_array[genshin_play_p].note, ahk_exe GenshinImpact.exe
genshin_play_p += 1
}
Return
Expand Down Expand Up @@ -165,8 +179,8 @@ genshin_play()
global startTime, freq, genshin_play_p, isBtn1Playing
genshin_play_p := 1
DllCall("QueryPerformanceCounter", "Int64P", nowTime)
WinActivate, ahk_exe YuanShen.exe
WinWaitActive, ahk_exe YuanShen.exe,, 0
genshin_hwnd := genshin_window_active(genshin_window_exist())
WinWaitActive, ahk_id %genshin_hwnd%,, 0
if(ErrorLevel==1)
{
MsgBox, 0x41010,,Genshin is not running!!!
Expand All @@ -186,6 +200,23 @@ genshin_stop()
SetTimer, genshin_main, Off
}

genshin_window_exist()
{
genshinHwnd := WinExist("ahk_exe GenshinImpact.exe")
if not genshinHwnd
{
genshinHwnd := WinExist("ahk_exe YuanShen.exe")
}
return genshinHwnd
}

genshin_window_active(hwnd)
{
WinActivate, ahk_id %hwnd%
Return hwnd
}


func_btn_play:
if(!isBtn1Playing)
{
Expand Down Expand Up @@ -432,7 +463,7 @@ Return
GuiClose:
ExitApp

#If debug
#If debugHotkey
F5::ExitApp
F6::Reload
#If
Expand Down
7 changes: 7 additions & 0 deletions Gui.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ pToken := Gdip_Startup()
sample_sheet =
(

当前为Genshin国际服适配测试二进制

v0.5计划:
- 国际服适配测试
- 英文翻译增加
- youtube视频追加

v0.4版本更新:
- 添加了加密谱面发布功能

Expand Down

0 comments on commit 25b658d

Please sign in to comment.