为什么 WinMinimize 在 autohotkey 中不起作用?
Why doesnt WinMinimize work in autohotkey?
我一直在尝试为我的生存单人 Minecraft 世界制作一个宏。
我使用了 youtube 上的一些东西,google 并使用了很多东西将其制作成脚本(我使用了一些 youtubers ahk 脚本的免费版本并重写了除 gui 之外的所有内容)。所有的东西都正常工作,除了一件事:WinMinimize。当我按 f7 键时,我将 window 最小化,但不是最小化它,而是关闭它。我 googled 很多,也在这里搜索过,但找不到。我该如何修复它才能正常工作?这是代码,谢谢!
Menu, Tray, NoIcon
#SingleInstance, force
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Gui, Color, black
Gui, Font, S8 CWhite, Verdana
Gui, Font, S20 CDefault, Asinastra
Gui, Font, S20 CDefault, Asinastra
Gui, Font, S16 CDefault, Asinastra
Gui, Font, S14 CDefault, Asinastra
Gui, Font, S20 CWhite, Asinastra
Gui, Add, Text, x48 y19 w350 h30 +Center, carrot macro
Gui, Font, S18 CWhite, Asinastra
Gui, Add, GroupBox, x562 y-1 w-30 h170 , GroupBox
Gui, Font, S16 CWhite, Asinastra
Gui, Add, GroupBox, x28 y69 w390 h150 , Config
Gui, Font, S14 CWhite, Asinastra
Gui, Add, Text, x100 y139 w190 h30, f8 - turn on
Gui, Add, Text, x100 y169 w210 h30, f9 - exit
Gui, Add, Text, x100 y109 w190 h30, f7 - minimize
Gui, Font, S18 CWhite, Asinastra
Gui, Add, GroupBox, x28 y239 w390 h170 , Info
Gui, Font, S20 CDefault, Asinastra
Gui, Font, S20 CDefault, Asinastra
Gui, Font, S16 CDefault, Asinastra
Gui, Font, S14 CDefault, Asinastra
Gui, Font, S18 CBlack, Asinastra
Gui, Font, S12 CWhite, Asinastra
Gui, Add, Text, x322 y429 w120 h30
Gui, Font, S16 CWhite, Asinastra
Gui, Font, S14 CWhite, Asinastra
Gui, Font, S14 CWhite, Asinastra
Gui, Add, Text, x42 y309 w360 h30 , carrot farm :D
Gui, Show, x304 y107 h488 w451, Carrot farm macro
Return
Gui, Show, x304 y107 h488 w451,
Return
GuiClose:
ExitApp
f7::
WinMinimize
f9::
ExitApp
f8::
Gui, Submit, NoHide
Loop
{
SetKeyDelay, 50, 50
Controlsend,, {v down}, ahk_exe javaw.exe
sleep 100
Controlsend,, {o down}, ahk_exe javaw.exe
sleep 100
Controlsend,, {w down}, ahk_exe javaw.exe
sleep 1500
Controlsend,, {w up}, ahk_exe javaw.exe
sleep 100
Controlsend,, {a down}, ahk_exe javaw.exe
sleep 43500
Controlsend,, {a up}, ahk_exe javaw.exe
sleep 100
Controlsend,, {o up}, ahk_exe javaw.exe
sleep 100
Controlsend,, {w down}, ahk_exe javaw.exe
sleep 1500
Controlsend,, {w up}, ahk_exe javaw.exe
sleep 100
Controlsend,, {o down}, ahk_exe javaw.exe
sleep 100
Controlsend,, {d down}, ahk_exe javaw.exe
sleep 43500
Controlsend,, {d up}, ahk_exe javaw.exe
sleep 50
Controlsend,, {v up}, ahk_exe javaw.exe
sleep 50
Controlsend,, {o up}, ahk_exe javaw.exe
sleep 50
}
在末尾添加return,如下所示:
f7::
WinMinimize
Return
f9::
ExitApp
Return
如果只有一个命令,也可以这样改:
f7::WinMinimize
在 f8 的末尾添加 return 这样它就不会跳转到下一行以防您添加更多行
我一直在尝试为我的生存单人 Minecraft 世界制作一个宏。
我使用了 youtube 上的一些东西,google 并使用了很多东西将其制作成脚本(我使用了一些 youtubers ahk 脚本的免费版本并重写了除 gui 之外的所有内容)。所有的东西都正常工作,除了一件事:WinMinimize。当我按 f7 键时,我将 window 最小化,但不是最小化它,而是关闭它。我 googled 很多,也在这里搜索过,但找不到。我该如何修复它才能正常工作?这是代码,谢谢!
Menu, Tray, NoIcon
#SingleInstance, force
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Gui, Color, black
Gui, Font, S8 CWhite, Verdana
Gui, Font, S20 CDefault, Asinastra
Gui, Font, S20 CDefault, Asinastra
Gui, Font, S16 CDefault, Asinastra
Gui, Font, S14 CDefault, Asinastra
Gui, Font, S20 CWhite, Asinastra
Gui, Add, Text, x48 y19 w350 h30 +Center, carrot macro
Gui, Font, S18 CWhite, Asinastra
Gui, Add, GroupBox, x562 y-1 w-30 h170 , GroupBox
Gui, Font, S16 CWhite, Asinastra
Gui, Add, GroupBox, x28 y69 w390 h150 , Config
Gui, Font, S14 CWhite, Asinastra
Gui, Add, Text, x100 y139 w190 h30, f8 - turn on
Gui, Add, Text, x100 y169 w210 h30, f9 - exit
Gui, Add, Text, x100 y109 w190 h30, f7 - minimize
Gui, Font, S18 CWhite, Asinastra
Gui, Add, GroupBox, x28 y239 w390 h170 , Info
Gui, Font, S20 CDefault, Asinastra
Gui, Font, S20 CDefault, Asinastra
Gui, Font, S16 CDefault, Asinastra
Gui, Font, S14 CDefault, Asinastra
Gui, Font, S18 CBlack, Asinastra
Gui, Font, S12 CWhite, Asinastra
Gui, Add, Text, x322 y429 w120 h30
Gui, Font, S16 CWhite, Asinastra
Gui, Font, S14 CWhite, Asinastra
Gui, Font, S14 CWhite, Asinastra
Gui, Add, Text, x42 y309 w360 h30 , carrot farm :D
Gui, Show, x304 y107 h488 w451, Carrot farm macro
Return
Gui, Show, x304 y107 h488 w451,
Return
GuiClose:
ExitApp
f7::
WinMinimize
f9::
ExitApp
f8::
Gui, Submit, NoHide
Loop
{
SetKeyDelay, 50, 50
Controlsend,, {v down}, ahk_exe javaw.exe
sleep 100
Controlsend,, {o down}, ahk_exe javaw.exe
sleep 100
Controlsend,, {w down}, ahk_exe javaw.exe
sleep 1500
Controlsend,, {w up}, ahk_exe javaw.exe
sleep 100
Controlsend,, {a down}, ahk_exe javaw.exe
sleep 43500
Controlsend,, {a up}, ahk_exe javaw.exe
sleep 100
Controlsend,, {o up}, ahk_exe javaw.exe
sleep 100
Controlsend,, {w down}, ahk_exe javaw.exe
sleep 1500
Controlsend,, {w up}, ahk_exe javaw.exe
sleep 100
Controlsend,, {o down}, ahk_exe javaw.exe
sleep 100
Controlsend,, {d down}, ahk_exe javaw.exe
sleep 43500
Controlsend,, {d up}, ahk_exe javaw.exe
sleep 50
Controlsend,, {v up}, ahk_exe javaw.exe
sleep 50
Controlsend,, {o up}, ahk_exe javaw.exe
sleep 50
}
在末尾添加return,如下所示:
f7::
WinMinimize
Return
f9::
ExitApp
Return
如果只有一个命令,也可以这样改:
f7::WinMinimize
在 f8 的末尾添加 return 这样它就不会跳转到下一行以防您添加更多行