Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Set the working directory to the SA-MP directory...
- sampdir:=A_MyDocuments . "\GTA San Andreas User Files\SAMP\"
- SetWorkingDir, %sampdir%
- ; If we're working in the wrong directory (ie you can't find the
- ; SA-MP config file) then return an error and exit.
- IfNotExist, sa-mp.cfg
- MsgBox, Error: Could not find SA-MP directory. Expected location: %sampdir%
- IfNotExist, sa-mp.cfg
- return
- Loop {
- ; Wait until GTA:SA is launched by SA-MP.
- WinWait GTA:SA:MP
- ; Generate the filename based on the time SA-MP is launched.
- filename:="chatlog-" . A_YYYY . A_MM . A_DD . "-" . A_Hour . A_Min . A_Sec
- ; Now wait for it to close before continuing.
- WinWaitClose GTA:SA:MP
- ; Copy the chatlog to the separate directory with the filename we generated earlier.
- FileCopy, chatlog.txt, chatlogarchiver\%filename%.txt
- ; Check that the file was actually copied, and return the location if it worked. If not,
- ; return a generic error because I can't be bothered to code in methods of working out
- ; what went wrong.
- IfExist, chatlogarchiver\%filename%.txt
- MsgBox, Chatlog saved as %sampdir%\chatlogarchiver\%filename%.txt.
- IfNotExist, chatlogarchiver\%filename%.txt
- MsgBox, There was an error and your chatlog was NOT archived.
- }
- return
Advertisement
Add Comment
Please, Sign In to add comment