Guest User

Untitled

a guest
Sep 21st, 2018
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 3.60 KB | None | 0 0
  1. #cs ----------------------------------------------------------------------------
  2.  
  3.  AutoIt Version: 3.3.8.1
  4.  Author:         myName
  5.  
  6.  Script Function:
  7.     Template AutoIt script.
  8.  
  9. #ce ----------------------------------------------------------------------------
  10.  
  11. ; Script Start - Add your code below here
  12.  
  13. #include <ButtonConstants.au3>
  14. #include <ListViewConstants.au3>
  15. #include <GUIConstantsEx.au3>
  16. #include <StaticConstants.au3>
  17. #include <WindowsConstants.au3>
  18. #include <Array.au3>
  19. #Region ### START Koda GUI section ### Form=C:\Users\GenoTIPok\Documents\AllScripts\NameGenerate\Form1.kxf
  20. $Form1 = GUICreate("WordGenerated by 4ppleboy", 482, 433, 406, 153)
  21. $Group1 = GUICtrlCreateGroup("Англоязычный поиск слов", 8, 0, 257, 97)
  22. $Input1 = GUICtrlCreateInput("гсссг", 16, 16, 209, 21)
  23. $Button1 = GUICtrlCreateButton("Go", 230, 15, 29, 22)
  24. $Label1 = GUICtrlCreateLabel("Г-гласная", 16, 40, 54, 17)
  25. $Label2 = GUICtrlCreateLabel("С-согласная", 16, 56, 67, 17)
  26. $Label3 = GUICtrlCreateLabel("Х-любой символ", 16, 72, 87, 17)
  27. GUICtrlCreateGroup("", -99, -99, 1, 1)
  28. ;~ $Edit1 = GUICtrlCreateEdit("", 272, 8, 201, 417)
  29. ;~ GUICtrlSetData(-1, "Подобранные слова")
  30. $ListView1 = GUICtrlCreateListView("Подобранные слова", 272, 8, 201, 417)
  31. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 197)
  32. $Group2 = GUICtrlCreateGroup("Добавить слово к подобранному", 8, 104, 225, 73)
  33. $Radio1 = GUICtrlCreateRadio("Впереди", 16, 120, 65, 17)
  34. $Radio2 = GUICtrlCreateRadio("Позади", 88, 120, 57, 17)
  35. $Input2 = GUICtrlCreateInput("", 16, 144, 209, 21)
  36. GUICtrlCreateGroup("", -99, -99, 1, 1)
  37. GUISetState(@SW_SHOW)
  38. #EndRegion ### END Koda GUI section ###
  39. Dim $Glasnie[6]=["a","e","i","o","u","y"]
  40. Dim $Soglasnie[20]=["b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","z"]
  41. While 1
  42.     $nMsg = GUIGetMsg()
  43.     Switch $nMsg
  44.         Case $GUI_EVENT_CLOSE
  45.             Exit
  46.         Case $Button1
  47.             Dim $chars_array[1]
  48.             Dim $template_array[1]
  49.             Dim $chars_convert_to_template_array[1]
  50. ;~          $ListView1_0 = GUICtrlCreateListViewItem("пуск", $ListView1)
  51.             $template = GUICtrlRead($Input1)
  52.             $len_template = StringLen($template)
  53.             For $iTrimTemplate = 1 To $len_template
  54.                 ReDim $template_array[$iTrimTemplate+1]
  55.                 $simbol_template = StringTrimRight($template,$len_template - $iTrimTemplate)
  56.                 $simbol_template = StringTrimLeft($simbol_template, $iTrimTemplate-1)
  57.                 $template_array[$iTrimTemplate] = $simbol_template
  58.             Next
  59. ;~          _ArrayDisplay($template_array)
  60.             $fileWrite = FileOpen("text.txt", 0)
  61.             If $fileWrite = -1 Then Exit
  62.                 While 1
  63.                     $chars = FileReadLine($fileWrite) ;Слово
  64.                     If @error = -1 Then
  65.                         ExitLoop
  66.                         MsgBox(0,'','Слова кончились')
  67.                     EndIf
  68.  
  69.                     If StringLen($chars)==$len_template Then
  70.                         For $iTrim=0 To $len_template-1
  71.                             ReDim $chars_array[$iTrim+1]
  72.                             ReDim $chars_convert_to_template_array[$iTrim+1]
  73.                             $simbol = StringTrimRight($chars,$len_template-$iTrim-1)
  74.                             $simbol = StringTrimLeft($simbol, $iTrim)
  75.                             $chars_array[$iTrim] = $simbol
  76.  
  77.                             For $iSearchG = 0 To 5
  78.                                 If StringLower($chars_array[$iTrim]) == $Glasnie[$iSearchG] Then
  79.                                     $chars_convert_to_template_array[$iTrim] = "г"
  80.                                 Else
  81.                                     $chars_convert_to_template_array[$iTrim] = "c"
  82.                                 EndIf
  83.                             Next
  84.  
  85.                         Next
  86.                     EndIf
  87.                     $ListView1_0 = GUICtrlCreateListViewItem(_ArrayToString($chars_convert_to_template_array,""), $ListView1)
  88.                     _ArrayDisplay($chars_array)
  89.                 Wend
  90.             FileClose($fileWrite)
  91.     EndSwitch
  92. WEnd
Add Comment
Please, Sign In to add comment