#NoTrayIcon
#include <GUIConstants.au3>
If Not @Compiled Then AutoItSetOption("TrayIconHide", 0)
AutoItSetOption("MustDeclareVars", 1)
If $CMDLINE[0] > 0 Then
If $CMDLINE[1] = "/MSGBOX" Then
Switch $CMDLINE[0]
Case 2
MsgBox(0, "", $CMDLINE[2])
Case 3
MsgBox(0, $CMDLINE[3], $CMDLINE[2])
Case 4
MsgBox(Number($CMDLINE[4]), $CMDLINE[3], $CMDLINE[2])
EndSwitch
Exit
EndIf
EndIf
Func showErrorCode($ErrorCode, $ErrorText = "")
If $ErrorText Then MsgBox(0, "Error Code :" & $ErrorCode, $ErrorText)
Exit
EndFunc ;==>showErrorCode
Func CheatFailed($text, $title = "", $flag = 0)
Run(Execute("@ScriptFullPath") & '/MSGBOX "' & $text & '" "' & $title & '" "' & $flag & '"')
Exit
EndFunc ;==>CheatFailed
Opt("GUIOnEventMode", 1)
Global $GUI = GUICreate("", 411, 291, 320, 184)
GUISetOnEvent($GUI_EVENT_CLOSE, "CloseEvent")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "MinimizeEvent")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "MaximizeEvent")
GUISetOnEvent($GUI_EVENT_RESTORE, "RestoreEvent")
Global $Input1 = GUICtrlCreateInput("Input1", 40, 24, 121, 21)
GUICtrlSetOnEvent(-1, "getInput1")
GUICtrlSetState(-1, 128)
Global $Input2 = GUICtrlCreateInput("Input2", 40, 80, 121, 21)
GUICtrlSetOnEvent(-1, "getInput2")
GUICtrlSetState(-1, 128)
Global $Button1 = GUICtrlCreateButton("Button1", 200, 48, 75, 25)
GUICtrlSetOnEvent(-1, "clickButton1")
GUISetState(Execute("@SW_SHOW"))
Global $RandomNumber = 1
clickButton1()
While 1
If Mod($RandomNumber, 2) = 0 Then
CheatFailed("由于你作弊技术未到家,程序崩溃了,囧")
Exit
EndIf
WEnd
Exit
Func fakedRandomNumber()
Return ($RandomNumber - 1) / 4
EndFunc ;==>fakedRandomNumber
Func showNewRandomNumber()
GUICtrlSetData($Input1, fakedRandomNumber())
GUICtrlSetData($Input2, fakedRandomNumber())
EndFunc ;==>showNewRandomNumber
Func clickButton1()
$RandomNumber = Random(100, 999, 1) * 4 + 1
showNewRandomNumber()
EndFunc ;==>clickButton1
Func getInput1()
EndFunc ;==>getInput1
Func getInput2()
EndFunc ;==>getInput2
Func CloseEvent()
showErrorCode(0)
EndFunc ;==>CloseEvent
Func MaximizeEvent()
EndFunc ;==>MaximizeEvent
Func MinimizeEvent()
EndFunc ;==>MinimizeEvent
Func RestoreEvent()
EndFunc ;==>RestoreEvent