Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region
- #AutoIt3Wrapper_UseUpx=Y
- #AutoIt3Wrapper_Compression=4
- #AutoIt3Wrapper_Icon=E:\wamp\www\favicon.ico
- #AutoIt3Wrapper_Res_Comment=Coded by Juno_okyo
- #AutoIt3Wrapper_Res_Description=Coded by Juno_okyo
- #AutoIt3Wrapper_Res_Fileversion=1.0.0.0
- #AutoIt3Wrapper_Res_ProductVersion=1.0.0.0
- #AutoIt3Wrapper_Res_LegalCopyright=(c) 2014 by Juno_okyo's Blog
- #AutoIt3Wrapper_Res_Field=ProductName|Juno_okyo's Production
- #AutoIt3Wrapper_Res_Field=ProductVersion|1.0.0.0
- #AutoIt3Wrapper_Res_Field=CompanyName|J2TeaM
- #endregion
- ; Includes
- #include <Misc.au3>
- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <WindowsConstants.au3>
- #include <Array.au3>
- #include <String.au3>
- ; Only One Instance
- _Singleton(@ScriptName)
- ; Options
- #NoTrayIcon
- Opt('WinTitleMatchMode', 2)
- Opt('GUIOnEventMode', 1)
- Opt('GUICloseOnESC', 0)
- ; Script Start - Add your code below here
- #Region ### START Koda GUI section ### Form=
- Global $MainForm = GUICreate("[Juno_okyo] Get new random string", 505, 437, -1, -1)
- GUISetFont(12, 400, 0, "Arial")
- GUISetOnEvent($GUI_EVENT_CLOSE, "MainFormClose")
- Global $Group1 = GUICtrlCreateGroup("Input", 5, 5, 494, 178)
- Global $Edit1 = GUICtrlCreateEdit("", 15, 30, 474, 140)
- GUICtrlSetState(-1, $GUI_FOCUS)
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- Global $Group2 = GUICtrlCreateGroup("Output", 5, 190, 494, 178)
- Global $Edit2 = GUICtrlCreateEdit("", 15, 215, 474, 140)
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- Global $Button1 = GUICtrlCreateButton("Convert", 5, 379, 494, 47)
- GUICtrlSetFont(-1, 16, 400, 0, "Arial")
- GUICtrlSetOnEvent(-1, "Button1Click")
- GUICtrlSetCursor(-1, 0)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- While 1
- Sleep(100)
- WEnd
- Func Button1Click()
- Local $input = GUICtrlRead($Edit1)
- If $input = '' Then Return False
- $input = StringSplit($input, '.')
- Local $output = ''
- For $i = 1 To $input[0]
- $output &= get_new_string($input[$i])
- Next
- GUICtrlSetData($Edit2, $output)
- EndFunc
- Func get_new_string($string)
- Local $aString = _StringExplode($string, ' ')
- _ArrayShuffle($aString)
- Local $output2 = '', $total = UBound($aString) - 1
- For $i = 0 To $total
- Local $temp = StringStripWS($aString[$i], 8)
- If $temp = '.' Or $temp = '' Then ContinueLoop
- $output2 &= $temp
- If $i = $total Then
- $output2 &= '. '
- Else
- $output2 &= ' '
- EndIf
- Next
- Return string_ucfirst($output2)
- EndFunc
- Func string_ucfirst($str)
- Return StringUpper(StringMid($str, 1, 1)) & StringMid($str, 2)
- EndFunc
- Func MainFormClose()
- Exit
- EndFunc
Add Comment
Please, Sign In to add comment