Argonath RPG - A World of its own

GTA:SA => SA:MP - San Andreas Multiplayer => SA:MP General => Topic started by: Kaze on March 23, 2014, 12:54:54 am

Title: [TUTORIAL] How to save your chat logs automatically
Post by: Kaze on March 23, 2014, 12:54:54 am


Credits to: SantiagoEllis
As I'm sure you're aware, all the text that appears in the upper left of your window when playing SA:MP is saved to a file called "chatlog.txt" in "C:\Users\\Documents\GTA San Andreas User Files\SAMP". It's a good thing to refer to if there was an RP scenario you'd like to re-read, or an old PM you'd like to refer to or anything else.

But by default, chatlog.txt is overwritten every time you launch the game. You could make a mental note to move the file somewhere and rename it every time you leave the game, but that's boring and requires effort. And why bother when you can do it automagically with a AHK script!?

If you haven't already, download and install AutoHotkey.
http://www.autohotkey.com/



Navigate to your GTA San Andreas User Files folder (C:\Users\\Documents\GTA San Andreas User Files\SAMP").
Create a new folder here. Name it "Chatlog backups" (without the quote marks).
Now, go to your desktop. Right click > New > AutoHotkey Script.
Picture: http://i.imgur.com/OOQUE0g.png

Name it "Chatlog Archiver".
Picture: http://i.imgur.com/JBbDyUw.png

Right click on your file and click Edit Script.
Picture: http://i.imgur.com/X6RPvXj.png

The script should open up in Notepad, and you'll probably see a load of gibberish.
Picture: http://i.imgur.com/6hGK1Ku.png

Delete all of it - you don't need it.
So, now you should have a blank notepad window with the filename "Chatlog Archiver.ahk".
Picture: http://i.imgur.com/m5UwqHz.png



Now, copy and paste this into the file:

Code: [Select]
WinWait, GTA: San Andreas
WinWaitClose
FileMove, C:\Users\your username\Documents\GTA San Andreas User Files\SAMP\chatlog.txt, C:\Users\your username\Documents\GTA San Andreas User Files\SAMP\Chatlog backups\Chatlog %A_YYYY%-%A_MM%-%A_DD% %A_Hour%-%A_Min%-%A_Sec%.txt
Run Chatlog Archiver.ahk
return

Replace BOTH your username fields with your computer username. If you have Word Wrap switched off, you'll need to scroll to the right to see the second one.
For example, my computer username is Kaze, so for me it would look like this:

Code: [Select]
WinWait, GTA: San Andreas
WinWaitClose
FileMove, C:\Users\Kaze\Documents\GTA San Andreas User Files\SAMP\chatlog.txt, C:\Users\Kaze\Documents\GTA San Andreas User Files\SAMP\Chatlog backups\Chatlog %A_YYYY%-%A_MM%-%A_DD% %A_Hour%-%A_Min%-%A_Sec%.txt
Run Chatlog Archiver.ahk
return



Click File > Save (or Ctrl + S, whichever you prefer) to save the file.
Double click the "Chatlog Archiver.ahk" file.
Picture: http://i.imgur.com/aLOEst9.png

You should see an AutoHotkey icon appear in your system tray, and if you hover your mouse over it then it should show the name of the file.
Picture: http://i.imgur.com/4XqUjtT.png

And that's it - it's ready to go. As long as this script is running, whenever you close SA:MP (the game window, not the server browser/launcher) or even if it crashes, "chatlog.txt" will be moved to "Chatlog backups" and renamed to the current time and date. An example new file name would be "Chatlog 2013-03-28 11-27-32.txt" (Chatlog year-month-day hour-minute-second.txt).
Picture: http://i.imgur.com/Z5aQNlS.png



Requesting for this to be stickied!
Title: Re: [TUTORIAL] How to save your chat logs automatically
Post by: Luke on March 23, 2014, 12:56:44 am
Nice one Kaze! Great Guide.
Title: Re: [TUTORIAL] How to save your chat logs automatically
Post by: Kaze on March 23, 2014, 12:58:10 am
Nice one Kaze! Great Guide.

Not mine, I'm just taking this on from another community I thought I should share this with everyone! (I did mention the credits)

Title: Re: [TUTORIAL] How to save your chat logs automatically
Post by: Bruce. on March 23, 2014, 01:33:22 am
Really amazing thing, it worked for me, this is really useful not only for me but it will be for everyone.

 :app:  :app:  :app:
Title: Re: [TUTORIAL] How to save your chat logs automatically
Post by: Axison on March 23, 2014, 01:54:31 am
Good Job, works like a charm.
Title: Re: [TUTORIAL] How to save your chat logs automatically
Post by: Slavik on March 23, 2014, 07:09:21 am
Very good  :app:
Title: Re: [TUTORIAL] How to save your chat logs automatically
Post by: Osamad on March 23, 2014, 07:15:30 am
Good Job :app: :app:
Title: Re: [TUTORIAL] How to save your chat logs automatically
Post by: AryaN on March 23, 2014, 07:20:33 am
Really helpful. THanks for sharing this
Title: Re: [TUTORIAL] How to save your chat logs automatically
Post by: Marcel on March 24, 2014, 11:26:27 pm
Hint: http://www.argonathrpg.eu/index.php?topic=93943.0
SimplePortal 2.3.7 © 2008-2025, SimplePortal