10 Years of Service
66%
[HIDE-THANKS]
[/HIDE-THANKS]
Code:
>#include
#include
#include
#include
#include
#include
$Brute = GUICreate("Brute", 188, 131, -1, -1)
$Rand = GUICtrlCreateButton("[R]", 104, 8, 75, 21)
GUICtrlCreateGroup("", 0, 32, 185, 9)
$SetNum = GUICtrlCreateInput("0000", 10, 8, 89, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER))
$Num = GUICtrlCreateInput("0000", 10, 50, 89, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER))
$Start = GUICtrlCreateButton("Start", 104, 48, 75, 25)
$DelayLbl = GUICtrlCreateLabel("Delay: XXXXXXXXXXXXXXXXX ms", 8, 80, 172, 17)
$Progress = GUICtrlCreateProgress(8, 104, 174, 17)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Rand
$iRand = Random(0, 9, 1) & Random(0, 9, 1) & Random(0, 9, 1) & Random(0, 9, 1)
GuiCtrlSetData($SetNum, $iRand)
Case $Start
Local $iCurrent = 0
Local $sCurrent
Local $iResult = GUICtrlRead($SetNum)
$sCurrent = sAddZero($iCurrent)
$hTimer = TimerInit()
For $iCurrent = 0 To 9999 Step 1
If($sCurrent == $iResult) Then
$iDiff = TimerDiff($hTimer)
ExitLoop
EndIf
$sCurrent = sAddZero($iCurrent)
GUICtrlSetData($Num, $sCurrent)
$Percentage = $iCurrent / 9999 * 100
GUICtrlSetData($Progress, $Percentage)
Next
GuiCtrlSetData($DelayLbl, "Delay: " & Round($iDiff, 2) & " ms")
EndSwitch
WEnd
Func sAddZero($iNum)
Local $sOut
Switch $iNum
Case $iNum <= 9
$sOut = "000" & $iNum
Case $iNum <= 99
$sOut = "00" & $iNum
Case $iNum <= 999
$sOut = "0" & $iNum
Case $iNum > 999
$sOut = $iNum
EndSwitch
Return $sOut
EndFunc