我正在努力寻找一个地方
$Password = GUICtrlRead($PasswordInput)
代替
Func BeginningGUI()
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Stronghold Kingdoms", 248, 95, -1, -1)
$PasswordInput = GUICtrlCreateInput("Password", 8, 32, 233, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
$ButtonOk = GUICtrlCreateButton("OK", 86, 64, 75, 25, $BS_NOTIFY)
$ButtonCancel = GUICtrlCreateButton("Cancel", 167, 64, 75, 25, $BS_NOTIFY)
$EnterPassLabel = GUICtrlCreateLabel("Please Enter Your Stronghold Kingdoms Password", 0, 12, 241, 17, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $ButtonCancel
Exit
Case $ButtonOk
OpenSHK()
Exit
EndSwitch
WEnd
EndFunc
Func OpenSHK()
Run("C:\Program Files (x86)\Firefly Studios\Stronghold Kingdoms\StrongholdKingdoms.exe")
WinWaitActive("Stronghold Kingdoms")
Sleep(5000)
Send($Password)
MouseClick("left",927,163)
Sleep(5000)
MouseClick("left",1112,371)
WinWaitActive("Stronghold Kingdoms - World 8")
sleep(10000)
EndFunc
我只需要将他们输入的内容声明为 $Password 以供以后使用。
我尝试将它放在 Case $ButtonOk 下面,但它给出了关于未声明变量的错误。