Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Date.au3>
- #include <GUIConstantsEx.au3>
- Opt("GUIOnEventMode", 1)
- $Form = GUICreate("Random Gen", 267, 110)
- GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
- GUICtrlCreateLabel("Start Value: ", 8, 8, 74, 17)
- GUICtrlCreateLabel("End Value: ", 8, 32, 74, 17)
- $iStart = GUICtrlCreateInput("2", 70, 5, 121, 21)
- $iEnd = GUICtrlCreateInput("9001", 70, 29, 121, 21)
- GUICtrlCreateLabel("Result #1: ", 8, 60, 74, 17)
- GUICtrlCreateLabel("Result #2: ", 8, 84, 74, 17)
- $iFirst = GUICtrlCreateInput("-", 70, 57, 121, 21)
- $iSecond = GUICtrlCreateInput("-", 70, 81, 121, 21)
- $all = GUICtrlCreateButton("Generate all", 196, 15)
- GUICtrlSetOnEvent(-1, "_GenAll")
- $bFirst = GUICtrlCreateButton("Generate", 196, 56, -1, 23)
- GUICtrlSetOnEvent(-1, "_GenFirst")
- $bSecond = GUICtrlCreateButton("Generate", 196, 80, -1, 23)
- GUICtrlSetOnEvent(-1, "_GenSecond")
- GUISetState(@SW_SHOW)
- While 1
- Sleep (100)
- WEnd
- Func _GenAll()
- $UnixTime = _DateDiff( 's',"1970/01/01 00:00:00",_NowCalc())
- SRandom($UnixTime)
- $r = Random(1, 100, 1)
- $start = GUICtrlRead($iStart)
- $end = GUICtrlRead($iEnd)
- For $i = 0 To $r
- GUICtrlSetData($iFirst, Random($start, $end, 1))
- GUICtrlSetData($iSecond, Random($start, $end, 1))
- Sleep (50)
- Next
- EndFunc
- Func _GenFirst()
- $UnixTime = _DateDiff( 's',"1970/01/01 00:00:00",_NowCalc())
- SRandom($UnixTime)
- $r = Random(1, 100, 1)
- $start = GUICtrlRead($iStart)
- $end = GUICtrlRead($iEnd)
- For $i = 0 To $r
- GUICtrlSetData($iFirst, Random($start, $end, 1))
- Sleep (50)
- Next
- EndFunc
- Func _GenSecond()
- $UnixTime = _DateDiff( 's',"1970/01/01 00:00:00",_NowCalc())
- SRandom($UnixTime)
- $r = Random(1, 100, 1)
- $start = GUICtrlRead($iStart)
- $end = GUICtrlRead($iEnd)
- For $i = 0 To $r
- GUICtrlSetData($iSecond, Random($start, $end, 1))
- Sleep (50)
- Next
- EndFunc
- Func _Exit()
- Exit
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment