#include <GUIConstantsEx.au3>
GUICreate('Test', 250, 75)
$nInput = GUICtrlCreateInput('', 10, 10, 240, 20)
$nButton = GUICtrlCreateButton('Сгенерировать Числа', 50, 35, 150, 30)
GUISetState()
_GenerateNumbers($nInput)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $nButton
_GenerateNumbers($nInput)
EndSwitch
WEnd
Func _GenerateNumbers($n_Input)
Local $i_Count, $s_String, $i_Random
While $i_Count < 6
$i_Random = Random(1, 36, 1)
If Not StringInStr($s_String, ' ' & $i_Random & ',') Then
$s_String &= $i_Random & ', '
$i_Count += 1
EndIf
WEnd
GUICtrlSetData($n_Input, StringTrimRight(StringStripWS($s_String, 8), 1))
EndFunc ;==>_GenerateNumbers