NoEnv Persistent SingleInstance force Include CRMPUDF ahk MaxMem 256 g

 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
#NoEnv
#Persistent
#SingleInstance, force
#Include, CRMPUDF.ahk
#MaxMem, 256
global chatLog := A_MyDocuments "\GTA San Andreas User Files\CR-MP\GenerationC\chatlog.txt" ; путь к чатлогу
settimer, start, 50
Return
start()
{
FileRead, textChatLog, % chatLog
for k, v in StrSplit(textChatLog, "`n")
{
if (RegExMatch(v, "^\[\d+:\d+:\d+\]\s+\[ADM-CHAT\]\s+{FFFFFF}(?<nick>[A-z_]+)\[[0-9]{1,3}\]:\s(?<text>(?<punish>\/warn|\/kick|\/ban|\/jail|\/skick|\/sethp|\/sban|\/o|\/iban|\/offban|\/ioffban|\/offmute|\/offjail|\/offwarn|\/sp|\/freeze|\/unfreeze|\/givegun|\/getip|\/agetip|\/agetstats|\/aunjail).*)$", out_))
{
saveCRMP(textChatLog)
addChatMessageEx("FFFFFF", "{00FF00}Администратор " out_nick " просит " out_text " {FFFFFF} У вас есть 10 секунд чтоб подтвердить действия на кнопку F4!")
KeyWait, F4, D T10
if(ErrorLevel)
{
addChatMessageEx("FFFFFF", "{00FF00}Вы не приняли прозьбу Администратор " out_nick " | " out_text )
Return
}
RegExMatch(out_nick, "(?<name>[A-z])\w+_(?<lastName>[A-z]+)", out_)
addChatMessage(out_text " • " out_name ". " out_lastName)
}
}
Return true
}
saveCRMP(chatlog)
{
static logschat := A_MyDocuments "\GTA San Andreas User Files\CR-MP\GenerationC\ChatLogs\"
static chat := A_MyDocuments "\GTA San Andreas User Files\CR-MP\GenerationC\chatlog.txt"
FileCreateDir , % logschat A_MM "-" A_YYYY
FileAppend , % chatlog, % logschat A_MM "-" A_YYYY "\" A_DD "." A_MM "." A_YYYY ".txt"
FileDelete , % chat
}