Advertisement
Doug4347

Auto SAMP chatlog archiver

Jul 19th, 2015
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Menu, Tray, NoStandard
  2. Menu, Script, Add, Change Chatlog Saving Directory, ChangeDir
  3. Menu, Script, Add, Change Chatlog Name, ChangeName
  4. Menu, Script, Add, Change Hotkey, ChangeHotkey
  5. Menu, StandardStuff, Standard
  6. Menu, Tray, Add, Script Stuff, :Script
  7. Menu, Tray, Add, Standard Stuff, :StandardStuff
  8. IniRead, OldHotkey, ChatlogSettings.ini, Settings, Hotkey, !1
  9. Hotkey, %OldHotkey%, ManualSave, On
  10. TrayTip, Chatlog Archiver has started!
  11. Goto, AutoArchiver
  12. Return
  13.  
  14. AutoArchiver:
  15.     Process, Wait, gta_sa.exe ;Change if your GTA works on a different process
  16.     Process, WaitClose, gta_sa.exe ;Change if your GTA works on a different process
  17.     IniRead, Dir, ChatlogSettings.ini, Settings, Dir
  18.     StringReplace, Dir, Dir, &WorkingDir&, %A_WorkingDir%, 1
  19.     StringReplace, Dir, Dir, &YEAR&, %A_Year%, 1
  20.     StringReplace, Dir, Dir, &MONTHNUM&, %A_MM%, 1
  21.     StringReplace, Dir, Dir, &MONTHNAME&, %A_MMMM%, 1
  22.     StringReplace, Dir, Dir, &DAY&, %A_DD%, 1
  23.     StringReplace, Dir, Dir, &HOUR&, %A_Hour%, 1
  24.     StringReplace, Dir, Dir, &MINUTE&, %A_Min%, 1
  25.     StringReplace, Dir, Dir, &SECOND&, %A_Sec%, 1
  26.     IniRead, Name, ChatlogSettings.ini, Settings, Name
  27.     StringReplace, Name, Name, &YEAR&, %A_Year%, 1
  28.     StringReplace, Name, Name, &MONTHNUM&, %A_MM%, 1
  29.     StringReplace, Name, Name, &MONTHNAME&, %A_MMMM%, 1
  30.     StringReplace, Name, Name, &DAY&, %A_DD%, 1
  31.     StringReplace, Name, Name, &HOUR&, %A_Hour%, 1
  32.     StringReplace, Name, Name, &MINUTE&, %A_Min%, 1
  33.     StringReplace, Name, Name, &SECOND&, %A_Sec%, 1
  34.     FileCreateDir, %Dir%
  35.     FileMove, %A_MyDocuments%\GTA San Andreas User Files\SAMP\Chatlog.txt, %Dir%\%Name%.txt
  36.     Goto, AutoArchiver
  37. Return
  38.  
  39. ChangeHotkey:
  40.     Gui, Add, Text,, Click the box below and press your hotkeys
  41.     Gui, Add, Hotkey, vNewHotkey
  42.     Gui, Add, Button, Default gSubmitHotkey, Submit
  43.     Gui, Show
  44. Return
  45.  
  46. ChangeDir:
  47.     Gui, Add, Text,, Enter your new directory to save your chatlogs to:
  48.     Gui, Add, Text,, Use &&WorkingDir&& to use the current directory of your script
  49.     Gui, Add, Text,, Use &&WorkingDir&&/FOLDERNAME to use a sub folder of the current directory of your script
  50.     Gui, Add, Text,,
  51.     (
  52. Use &&WorkingDir&& to use the current directory of your script.
  53. Use &&WorkingDir&&\FOLDERNAME to use a sub folder of the current directory of your script.
  54. Use &&YEAR&& to add the current year to the name.
  55. Use &&MONTHNUM&& to add the current month number to the name. (i.e. June = 06)
  56. Use &&MONTHNAME&& to add the current month name to the name. (i.e. June = June)
  57. Use &&DAY&& to add the current day of the month to the name.
  58. Use &&HOUR&& to add the current hour to the name.
  59. Use &&MINUTE&& to add the current minute to the name.
  60. Use &&SECOND&& to add the current second to the name.
  61.     )
  62.     Gui, Add, Edit, vNewDir w500
  63.     Gui, Add, Button, Default gSubmitDir, Submit
  64.     Gui, Show
  65. Return
  66.  
  67. ChangeName:
  68.     Gui, Add, Text,, Enter your new directory to save your chatlogs to:
  69.     Gui, Add, Text,,
  70.     (
  71. Use &&YEAR&& to add the current year to the name.
  72. Use &&MONTHNUM&& to add the current month number to the name. (i.e. June = 06)
  73. Use &&MONTHNAME&& to add the current month name to the name. (i.e. June = June)
  74. Use &&DAY&& to add the current day of the month to the name.
  75. Use &&HOUR&& to add the current hour to the name.
  76. Use &&MINUTE&& to add the current minute to the name.
  77. Use &&SECOND&& to add the current second to the name.
  78.     )
  79.     Gui, Add, Edit, vNewName w500
  80.     Gui, Add, Button, Default gSubmitName, Submit
  81.     Gui, Show
  82. Return
  83.  
  84. SubmitHotkey:
  85.     Gui, Submit
  86.     Gui, Destroy
  87.     IniRead, OldHotkey, ChatlogSettings.ini, Settings, Hotkey, !1
  88.     IniWrite, %NewHotkey%, ChatlogSettings.ini, Settings, Hotkey
  89.     Hotkey, %OldHotkey%, ManualSave, Off
  90.     Hotkey, %NewHotkey%, ManualSave, On
  91.     StringReplace, NewHotkey, NewHotkey, +, Shift +` , 1
  92.     StringReplace, NewHotkey, NewHotkey, !, Alt +` , 1
  93.     StringReplace, NewHotkey, NewHotkey, ^, Ctrl +` , 1
  94.     StringReplace, NewHotkey, NewHotkey, #, Win +` , 1
  95.     MsgBox, 64, Chatlog Archiver, [Success]`n`nYour hotkey has been changed to:`n%NewHotkey%
  96. Return
  97.  
  98. SubmitDir:
  99.     Gui, Submit
  100.     Gui, Destroy
  101.     IniWrite, %NewDir%, ChatlogSettings.ini, Settings, Dir
  102.     MsgBox, 64, Chatlog Archiver, [Success]`n`nYour directory has been changed to:`n%NewDir%
  103. Return
  104.  
  105. SubmitName:
  106.     Gui, Submit
  107.     Gui, Destroy
  108.     IniWrite, %NewName%, ChatlogSettings.ini, Settings, Name
  109.     MsgBox, 64, Chatlog Archiver, [Success]`n`nYour name has been changed to:`n%NewName%
  110. Return
  111.  
  112. ManualSave:
  113.     IniRead, Dir, ChatlogSettings.ini, Settings, Dir
  114.     StringReplace, Dir, Dir, &WorkingDir&, %A_WorkingDir%, 1
  115.     StringReplace, Dir, Dir, &YEAR&, %A_Year%, 1
  116.     StringReplace, Dir, Dir, &MONTHNUM&, %A_MM%, 1
  117.     StringReplace, Dir, Dir, &MONTHNAME&, %A_MMMM%, 1
  118.     StringReplace, Dir, Dir, &DAY&, %A_DD%, 1
  119.     StringReplace, Dir, Dir, &HOUR&, %A_Hour%, 1
  120.     StringReplace, Dir, Dir, &MINUTE&, %A_Min%, 1
  121.     StringReplace, Dir, Dir, &SECOND&, %A_Sec%, 1
  122.     IniRead, Name, ChatlogSettings.ini, Settings, Name
  123.     StringReplace, Name, Name, &YEAR&, %A_Year%, 1
  124.     StringReplace, Name, Name, &MONTHNUM&, %A_MM%, 1
  125.     StringReplace, Name, Name, &MONTHNAME&, %A_MMMM%, 1
  126.     StringReplace, Name, Name, &DAY&, %A_DD%, 1
  127.     StringReplace, Name, Name, &HOUR&, %A_Hour%, 1
  128.     StringReplace, Name, Name, &MINUTE&, %A_Min%, 1
  129.     StringReplace, Name, Name, &SECOND&, %A_Sec%, 1
  130.     FileCreateDir, %Dir%
  131.     FileMove, %A_MyDocuments%\GTA San Andreas User Files\SAMP\Chatlog.txt, %Dir%\%Name%.txt
  132. Return
  133.  
  134. GuiClose:
  135.     Gui, Destroy
  136. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement