#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(v, "\]\sАдминистратор\s[A-z_]+\[[0-9]+\]:\s(?<text>.*)", out_))
{
save(chatlog)
if (RegExMatch(out_text, "[Cc]ядь") && A_TickCount - startTime > 1000 * 60)
{
startTime := A_TickCount
sitDown()
}
if (RegExMatch(out_text, "(тут|[зс]дес|нами|ответ)") && A_TickCount - startTime > 1000 * 60)
{
startTime := A_TickCount
ansAdmin()
}
}
}
}
sitDown()
{
showGameText("ADMINISTRATOR", 5000, 3)
Sleep 500
Send {vk43 down}
Sleep 50
Send {vk43 up}
Sleep, 200
Send {vk43 down}
Sleep 50
Send {vk43 up}
return
}
ansAdmin()
{
showGameText("ADMINISTRATOR", 5000, 3)
sitDown()
if(Ignor != ansAdm.MaxIndex() + 1)
{
Sleep, StrLen(ansAdm[Ignor]) * 100 + 1000
SendChat(ansAdm[Ignor])
Ignor ++
}
else
{
global Ignor := 1
ansAdmin()
}
return
}