IfWinActive ahk_exe gta_sa exe SingleInstance Force NoEnv ListLines Of

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#IfWinActive, ahk_exe gta_sa.exe
#SingleInstance Force
#NoEnv
ListLines Off
SetBatchLines -1
chatlog := A_MyDocuments "\GTA San Andreas User Files\SAMP\chatlog.txt"
;FileDelete, %chatlog%
Words = (warn|kick|ban|mute|jail|skick|hp|skin|o|msg|unban|unwarn|unmute|rban|unjail|offban|offwarn|spcar|sban|offjail|offmute|sp|get|a|r|money|alist|offunwarn|getv|slap|getcar|okay|setleader|setweather|sw|settime|st|z|z_close)
F4::
FileRead, Str, %chatlog%
StringReplace, Str, Str, `r`n, `n, 1
StringReplace, Str, Str, `r, `n, 1
RegExMatch("`n" Str "`n", "i).*\n\[\d+:\d+:\d+]\s*\[A].*?\[.*?]:\s*(/`*" Words "\s.*?)\n", Match)
FileAppend,%Match1%`n,chat.ini
SendMessage, 0x50,, 0x4190419,, A
SendInput,{F6}%match1%{space}
Return
F5::
FileRead, Str, %chatlog%
StringReplace, Str, Str, `r`n, `n, 1
StringReplace, Str, Str, `r, `n, 1
RegExMatch("`n" Str "`n", "i).*\n\[\d+:\d+:\d+]\s*\ .*?\[.*?] : \s*(/`*.*?(\d+)\s.*?)\n", Match)
SendMessage, 0x50,, 0x4190419,, A
SendInput, {F6}/sp %match2%{Enter}
Return
!Right:: SendInput, {right 150}
!Left:: SendInput, {left 150}/{right 150}{space}
F9::
FileRead, Str, %chatlog%
StringReplace, Str, Str, `r`n, `n, 1
StringReplace, Str, Str, `r, `n, 1
RegExMatch("`n" Str "`n", "i).*\n\[\d+:\d+:\d+]\s*\ .*?\[.*?] : \s*(/`*.*?(\d+)\s.*?)\n", Match)
SendMessage, 0x50,, 0x4190419,, A
SendInput, {F6}/id %match2%{Enter}
Return