简单的代码。现在我想在我的监视器上实时看到变量,所以我做了一个gui。
但是,无论我做什么,它都不会更新,并且停留在0。我搜索了文档和示例,但仍然没有任何线索。这是我到目前为止的代码:
Gui, Font, s32, impact
Gui, Color, EEAA99
WinSet, TransColor, EEAA99
Gui -Caption +AlwaysOnTop +ToolWindow
Gui, Add, Text, , CC: %ConsCount%
Gui, Add, Text, , LN: %LastN%
Gui, Add, Text, , LR: %LastR%
Gui, Add, Text, , LS: %LastSpace%
Gui, Show, NoActivate X0 Y0
SetTimer, Loop, On
Loop:
SetTimer, Loop, off
Sleep, 2
SetTimer, Loop, reset我知道这没有任何意义,但我真的不知道该怎么办。
发布于 2020-07-20 02:41:11
这可能会有帮助,按F1添加或F2减去。
Gui, Font, s32, impact
Gui, Color, EEAA99
WinSet, TransColor, EEAA99
Gui, -Caption +AlwaysOnTop +ToolWindow
vararr := {"ConsCount": 0, "LastN": 0, "LastR": 0, "LastSpace": 0} ; Array contains the gui controls variables names and it values as 0.
For key, val in vararr ; Loop throw vararr array keys and values.
Gui, Add, Text, v%key% w9, %key%: %val% ; Add the variable name and it value to the gui.
Gui, Show, NoActivate X0 Y0
Return
F1:: ; Press F1
For key, val in vararr
{
val++ ; Add +1 to the previous value of the variable.
GuiControl,, %key%, %key%: %val% ; Update the gui to show the new value.
vararr[Key] := val ; Replace the old values of the variable with the new one in the array.
}
Return
F2:: ; Press F2
For key, val in vararr
{
val-- ; Add -1 to the previous value of the variable.
GuiControl,, %key%, %key%: %val%
vararr[Key] := val
}
Returnhttps://stackoverflow.com/questions/62921929
复制相似问题