#Persistent
#SingleInstance, Force
#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
}