Include SAMP ahk global chatlogPatch A_MyDocuments GTA San Andreas Use

 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
46
47
48
49
50
51
52
53
54
55
56
#Include, SAMP.ahk
global chatlogPatch := % A_MyDocuments "\GTA San Andreas User Files\SAMP\chatlog.txt"
global ansAdm := ["Да, а где мне ещё быть?", "Допустим...", "/n Нет(да)"]
global Ignor := 1
SetTimer, checAdminReport, 50
return
checAdminReport()
{
FileRead, chatlog, % chatlogPatch
for k, v in StrSplit(chatlog, "`n")
{
if (RegExMatch(var, "\]\sАдминистратор\s[A-z_]+\[[0-9]+\]:\s(?<text>.*)", out_))
{
if (RegExMatch(out_text, "[Cc]ядь"))
{
sitDown(2)
}
if (RegExMatch(out_text, "(тут|[зс]дес|нами|ответ)"))
{
ansAdmin()
}
}
}
}
sitDown(count)
{
showGameText("ADMINISTRATOR", 5000, 3)
loop, count
{
Sleep 2000
Send {vk43 down}
Sleep 100
Send {vk43 up}
}
return
}
ansAdmin()
{
showGameText("ADMINISTRATOR", 5000, 3)
sitDown(1)
if(Ignore != ansAdm.MaxIndex() + 1)
{
Sleep, StrLen(ansAdm[Ignore]) * 100 + 1000
SendChat(ansAdm[Ignore])
Ignore ++
}
else
global Ignor := 1
return
}