Advertisement
Guest User

Тест

a guest
Apr 21st, 2017
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Функция оборачивающая имена клавиш в фигурные скобки {}
  2. stringformat(line) {
  3.     StringReplace, line, line, {{}, {{}, ,All
  4.     StringReplace, line, line, {}}, {}}, ,All
  5.     StringReplace, line, line, !, {!}, ,All
  6.     StringReplace, line, line, #, {#}, ,All
  7.     StringReplace, line, line, ^, {^}, ,All
  8.     StringReplace, line, line, +, {+}, ,All
  9.     return line
  10. }
  11.  
  12. SetKeyDelay, -1, -1 ; Уменьшаем время паузы после нажатия клавиш, отправляемых скриптом
  13. filePath := "C:\Users\admin\Desktop\test.txt" ; Полный или относительный путь к файлу, содержимое которого мы собрались читать
  14. FileRead, file, %filePath% ; Чтение файла в переменную "file"
  15. textArray := StrSplit(file, "`n") ; Преобразование файла в массив
  16. index := 0 ; Сброс счетчика на 0
  17.  
  18. ; Чтение следующий строки
  19. ^1::
  20. text := stringformat(textArray[++index])
  21. SendInput, {f6}%text%{enter}
  22. sleep 1150
  23. return
  24.  
  25. ; Повтор строки
  26. ^2::
  27. SendInput, {f6}%text%{enter}
  28. sleep 1150
  29. return
  30.  
  31. ; Сброс позиции на 0
  32. ^3::
  33. FileRead, file, %filePath% ; Чтение файла в переменную "file"
  34. textArray := StrSplit(file, "`n") ; Преобразование файла в массив
  35. index := 0 ; Сброс счетчика на 0
  36. SoundBeep
  37. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement