#include SAMP V2.ahk
#IfWinActive GTA:SA:MP
global FileCLog:=% A_MyDocuments "\GTA San Andreas User Files\SAMP\chatlog.txt"
SelectedFile = %A_MyDocuments%\Gta San Andreas User Files\samp\chatlog.txt
Loop
{
log = % A_MyDocuments "\GTA San Andreas User Files\SAMP\chatlog.txt"
id := NearCop()
FileRead, logchat, %log%
sleep, 100
IfInString, logchat, Арестованный
{
FileRead, info, %log%
sleep, 100
if RegExMatch(info, "\Q] \E(.*)\{FFFFFF\}\E(.*)_(.*)\Q {269BD8}\E", out)
{
Sleep, 2200
SendMessage, 0x50,, 0x4190419,, A
SendInput, {F6}/r Дело закрыто. Подозреваемый %out2% %out3% пойман. | Напарник(и): %id% {Enter}
Sleep, 2200
SendInput, {F6}/time{Enter}
Sleep, 400
SendInput, {F2}
sleep, 1000
FileDelete %log%
sleep, 1000
FileAppend %log%
}
}
sleep, 100
IfInString, logchat, Вы поместили
{
FileRead, info, %log%
sleep, 100
if RegExMatch(info, "\Q] \E(.*)поместили\E (.*)_(.*)\Q в\E", out)
{
Sleep, 2200
SendMessage, 0x50,, 0x4190419,, A
SendInput, {F6}/r Дело закрыто. Подозреваемый %out2% %out3% пойман. | Напарник(и): %id% {Enter}
Sleep, 2200
SendInput, {F6}/time{Enter}
Sleep, 400
SendInput, {F2}
sleep, 1000
FileDelete %log%
sleep, 1000
FileAppend %log%
}
}
sleep, 100
IfInString, logchat, нейтрализовал
{
FileRead, info, %log%
sleep, 100
if RegExMatch(info, "(.*)Log_Logov нейтрализовал преступника '(.*)_(.*)'", out)
{
Sleep, 2200
SendMessage, 0x50,, 0x4190419,, A
SendInput, {F6}/n Преступник %out2% %out3% нейтрализован. | Причина: Вооруженное сопротивление. | Напарник(и): %id% {Enter}
Sleep, 2200
SendInput, {F6}/time{Enter}
Sleep, 400
SendInput, {F2}
sleep, 1000
FileDelete %log%
sleep, 1000
FileAppend %log%
}
}
sleep, 100
IfInString, logchat, Подозреваемый
{
FileRead, info, %log%
sleep, 100
if RegExMatch(info, "\Q] \E(.*)\{FFFFFF\}\E(.*)_(.*)\Q {269BD8}\E", out)
{
Sleep, 2200
SendMessage, 0x50,, 0x4190419,, A
SendInput, {F6}/r Дело закрыто. Подозреваемый %out2% %out3% пойман. | Напарник(и): %id% {Enter}
Sleep, 2200
SendInput, {F6}/time{Enter}
Sleep, 400
SendInput, {F2}
sleep, 1000
FileDelete %log%
sleep, 1000
FileAppend %log%
}
}
sleep, 100
NearCop()
{
p := getStreamedInPlayersInfo()
sleep, 100
If (!p)
return
lpos := getCoordinates()
If (!lpos)
return
For i, o in p
{
t := getDist(lpos,o.POS)
sleep, 100
If (t <= 10)
{
Colorpl := getplayercolor(i)
Skin := getTargetPlayerSkinIdById(i)
If ((Colorpl = 274771114) || (Colorpl = 2054579968) AND (Skin = 265|266|267|280|281|282|283|284|285|288|300|301|302|306|307|309|310|311|295))
sleep, 100
{
NameCop := RegExReplace(o.NAME, "_", " ")
If NearCops
NearCops := % NearCops ", " NameCop
else
NearCops := NameCop
}
}
}
If not NearCops
sleep, 100
NearCops := "Нету"
sleep, 100
return NearCops
}
}
return
sleep, 100
GetNewLine(filename)
{
static old
static new
if !old
{
FileGetSize, old, %filename%
new := old
}
while old = new
{
sleep 100
FileGetSize, new, %filename%
}
old := new
Loop, read, %filename%
if A_LoopReadLine
{
last := A_LoopReadLine
}
return last
}