Jump to content

Randomizer


Info
 Share

Recommended Posts

#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiEdit.au3>
#include <StaticConstants.au3>

$ProgramVersion = " v1.0"
$ProgramCredits = "      - By Info"
$SetDataInEffectInputSave = 0

$MainGUI = GUICreate("Randomizer"&$ProgramVersion&$ProgramCredits, 186, 169, -1, -1, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
$FromInput = GUICtrlCreateInput("1", 8, 24, 65, 21,$ES_NUMBER)
$ToInput = GUICtrlCreateInput("100", 96, 24, 65, 21,$ES_NUMBER)
$EffectSecondsInput = GUICtrlCreateInput("", 100, 78, 75, 21,$ES_NUMBER)
$OneNumberRadio = GUICtrlCreateRadio("1 Number", 8, 56, 81, 17)
$TwoNumbersRadio = GUICtrlCreateRadio("2 Numbers", 96, 56, 81, 17)
$EffectCheckbox = GUICtrlCreateCheckbox("Toggle Effect", 8, 80, 89, 17)
$ResultButton = GUICtrlCreateButton("Generate", 10, 104, 167, 27)
$Result = GUICtrlCreateLabel("_____Result_____", 10, 138, 167, 27,$SS_CENTER)
GUICtrlSetFont(-1, 15, 400, 0, "Arial")
$SearchFromLabel = GUICtrlCreateLabel("Search numbers from:", 6, 8, 107, 16)
$SearchTo2 = GUICtrlCreateLabel("to", 79, 26, 17, 15)
GUICtrlSetState($OneNumberRadio,$GUI_CHECKED)
GUICtrlSetState($EffectSecondsInput,$GUI_HIDE)
GUICtrlSetState($ResultButton,$GUI_FOCUS)
GUISetState(@SW_SHOW)

While 1
    $m = GUIGetMsg()
    Switch $m
        Case $GUI_EVENT_CLOSE
            Exit
        Case $EffectCheckbox
            If GUICtrlRead($EffectCheckbox) = $GUI_CHECKED Then
                GUICtrlSetState($EffectSecondsInput,$GUI_SHOW)
                If $SetDataInEffectInputSave = 0 Then
                    GUICtrlSetData($EffectSecondsInput,"Insert Seconds")
                    $SetDataInEffectInputSave = 1
                EndIf
                GUICtrlSetState($EffectSecondsInput,$GUI_FOCUS)
            Else
                GUICtrlSetState($EffectSecondsInput,$GUI_HIDE)
            EndIf
        Case $ResultButton
            GUISetState(@SW_DISABLE)
            If GUICtrlRead($EffectCheckbox) = $GUI_CHECKED Then
                $timer=timerInit()
                If GUICtrlRead($TwoNumbersRadio) = $GUI_CHECKED Then
                    Do
                        GUICtrlSetData($Result,Random(GUICtrlRead($FromInput),GUICtrlRead($ToInput),1) & " __ " & Random(GUICtrlRead($FromInput),GUICtrlRead($ToInput),1))
                        Sleep(100)
                    Until TimerDiff($timer)>=GUICtrlRead($EffectSecondsInput)*1000
                Else
                    Do
                        GUICtrlSetData($Result,Random(GUICtrlRead($FromInput),GUICtrlRead($ToInput),1))
                        Sleep(100)
                    Until TimerDiff($timer)>=GUICtrlRead($EffectSecondsInput)*1000
                EndIf
            Else
            If GUICtrlRead($TwoNumbersRadio) = $GUI_CHECKED Then
                GUICtrlSetData($Result,Random(GUICtrlRead($FromInput),GUICtrlRead($ToInput),1) & " ___ " & Random(GUICtrlRead($FromInput),GUICtrlRead($ToInput),1))
            Else
                GUICtrlSetData($Result,Random(GUICtrlRead($FromInput),GUICtrlRead($ToInput),1))
            EndIf
            EndIf
            GUISetState(@SW_ENABLE)
    EndSwitch
WEnd

Do you like it? :)

Edited by Info
Link to comment
Share on other sites

Fine :)

i'll look through it

[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...