Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Persistent
- OnExit, ExitScript
- Menu, Tray, NoStandard
- Menu, Standards, Standard
- Menu, Script, Add, Change Chatlog Dir (for when chatlogs get too long to read efficiently), NewTooLong
- Menu, Script, Add, Change Payment Log Dir, NewPaymentLog
- Menu, Tray, Add, Script Stuff, :Script
- Menu, Tray, Add, Standard Stuff, :Standards
- IniRead, TooLongDir, Settings.ini, Settings, TooLongDir
- IniRead, PaymentLog, Settings.ini, Settings, PaymentLog
- If TooLongDir = Error
- {
- RestartTooLogDir:
- FileSelectFolder, TooLongDir,,, Please select a place to place all your chatlogs when they get too long.
- If ErrorLevel
- {
- MsgBox, You must have a directory selected!
- Goto, RestartTooLogDir
- }
- IniWrite, %TooLongDir%, Settings.ini, Settings, TooLongDir
- MsgBox, New Dir:`n%TooLongDir%
- }
- If PaymentLog = Error
- {
- RestartPaymentLog:
- FileSelectFolder, PaymentLog,,, Please select a place to put your payment logs.
- If ErrorLevel
- {
- MsgBox, You must have a directory selected!
- Goto, RestartPaymentLog
- }
- IniWrite, %PaymentLog%, Settings.ini, Settings, PaymentLog
- MsgBox, New Payment Log Dir:`n%TooLongDir%
- }
- ;TooLongDir = TooLong\Too Long - %A_Now%
- ;PaymentLog = Payment Logs
- FileAppend, =============================`n[%A_Hour%:%A_Min%:%A_Sec%]Start At: 0`n, %PaymentLog%\Payments.txt
- SetTimer, PaymentLooper, On
- PaymentLooper:
- Loop,
- {
- FileReadLine, RT, %a_mydocuments%\GTA San Andreas User Files\SAMP\chatlog.txt, %A_Index%
- If ErrorLevel
- {
- LineNum:=A_Index-2
- Goto, PaymentStage2
- }
- }
- PaymentStage2:
- FileReadLine, RT, %a_mydocuments%\GTA San Andreas User Files\SAMP\chatlog.txt, %LineNum%
- ; SplashImage,, x2000, %RT%
- If LineNum > 98
- {
- FileCreateDir, %TooLongDir%
- FileMove, %a_mydocuments%\GTA San Andreas User Files\SAMP\chatlog.txt, %TooLongDir%\chatlog - %A_Now%.txt
- }
- IfInString, RT, You have been paid $
- {
- StringTrimLeft, Amount, RT, 31
- StringGetPos, AmountPoint, Amount, %A_Space%
- StringLen, Length, Amount
- RightTrim:=Length-AmountPoint
- StringTrimRight, Amount, Amount, %RightTrim%
- If TotalAmount
- TotalAmount+=Amount
- Else
- TotalAmount:=Amount
- FileAppend, [%A_Hour%:%A_Min%:%A_Sec%]%TotalAmount%(+%Amount%)`n, %PaymentLog%\Payments.txt
- FileAppend, ==AHK LINE==`n`n, %a_mydocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
- SoundBeep
- Sleep, 5000
- Goto, PaymentLooper
- }
- Return
- NewTooLong:
- FileSelectFolder, TooLongDir,,, Please select a place to place all your chatlogs when they get too long.
- If not ErrorLevel
- {
- IniWrite, %TooLongDir%, Settings.ini, Settings, TooLongDir
- MsgBox, New Dir:`n%TooLongDir%
- }
- Return
- NewPaymentLog:
- FileSelectFolder, PaymentLog,,, Please select a place to put your payment logs.
- If not ErrorLevel
- {
- IniWrite, %PaymentLog%, Settings.ini, Settings, PaymentLog
- MsgBox, New Payment Log Dir:`n%TooLongDir%
- }
- Return
- ExitScript:
- FileAppend, [%A_Hour%:%A_Min%:%A_Sec%]Total: %TotalAmount%`n=============================`n, %PaymentLog%\Payments.txt
- ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement