tabnation

ahk ai chatter

Oct 18th, 2025
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. #Persistent
  2. #SingleInstance Force
  3.  
  4. ; === CONFIGURATION ===
  5. FilePath := "C:\Users\thoma\OneDrive\Desktop\lister.txt" ; path to your text file
  6. ProgressFile := "C:\Users\thoma\OneDrive\Desktop\progress.txt" ; where the script remembers last line
  7. Delay := 600000 ; 15 minutes = 900000 ms
  8.  
  9. ; === HOTKEY ===
  10. F1::
  11. if !FileExist(FilePath) {
  12. MsgBox, 16, Error, File not found: %FilePath%
  13. return
  14. }
  15.  
  16. FileRead, FileContent, %FilePath%
  17. if ErrorLevel {
  18. MsgBox, 16, Error, Could not read the file.
  19. return
  20. }
  21.  
  22. Lines := StrSplit(FileContent, "`n")
  23.  
  24. ; Read saved progress
  25. if FileExist(ProgressFile) {
  26. FileRead, LastLine, %ProgressFile%
  27. if (LastLine = "")
  28. LastLine := 0
  29. } else {
  30. LastLine := 0
  31. }
  32.  
  33. ; Start from next line
  34. StartIndex := LastLine + 1
  35.  
  36. Loop % Lines.MaxIndex()
  37. {
  38. Index := A_Index
  39. if (Index < StartIndex)
  40. continue
  41.  
  42. Line := Trim(Lines[Index])
  43. if (Line = "")
  44. continue
  45.  
  46. SendInput, now a %Line%
  47. SendInput, {Enter}
  48.  
  49. ; Save progress
  50. FileDelete, %ProgressFile%
  51. FileAppend, %Index%, %ProgressFile%
  52.  
  53. Sleep, %Delay%
  54. }
  55.  
  56. MsgBox, 64, Done, Finished typing all lines!
  57. return
  58.  
  59.  
  60.  
  61. f2::reload
Advertisement
Add Comment
Please, Sign In to add comment