Advertisement
Doug4347

chatlog-archiver.ahk

Dec 6th, 2022 (edited)
753
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  2. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  3.  
  4. Archive := "chatlog/archive"
  5. Chatlog := A_MyDocuments . "/GTA San Andreas User Files/SAMP/chatlog.txt"
  6. Exe := "gta_sa.exe"
  7. TTS := true
  8.  
  9. IfNotExist, Archive
  10.     FileCreateDir, % Archive
  11.  
  12. If SubStr(Archive, 0, 1) != "/" or SubStr(Archive, 0, 1) != "\"
  13. {
  14.     If InStr(Archive, "/")
  15.         Archive := Archive . "/"
  16.     Else
  17.         Archive := Archive . "\"
  18. }
  19. Loop,
  20. {
  21.     Process, Wait, % Exe
  22.     Process, WaitClose, % Exe
  23.     FileMove, % Chatlog, % Archive . "chatlog-" . A_Now . ".txt"
  24.     If TTS
  25.         ComObjCreate("SAPI.SpVoice").Speak("Chatlog archived.")
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement