Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- Chatlog = %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
- BackupDir = LibDoug\MTG Chatlog backups\AFK System
- Loop,
- {
- AFKChecked:=False
- FileRead, ChatlogFileContents, %Chatlog%
- IfInString, ChatlogFileContents, You will be AFK kicked in 60 seconds!
- {
- StartTime:=A_TickCount
- Loop,
- {
- TotalTime:=A_TickCount=StartTime
- TimeLeft:=30000-TotalTime
- SoundBeep
- If AFKChecked
- {
- Sleep, 500
- Break
- }
- If TotalTime > 30000\
- {
- SendInput, t^a/q`n
- Sleep, 10000
- Break
- }
- SendInput, t^a%TimeLeft%
- }
- }
- }
- !1::
- FileCreateDir, %BackupDir%
- FileMove, %Chatlog%, %BackupDir%\%A_Now%.txt
- AFKChecked:=True
- Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement