global FileCLog := % A_MyDocuments "\GTA San Andreas User Files\SAMP\chatlog.txt"
F2::
Loop {
lastline := GetNewLine(FileCLog)
SendInput, {F6}/capture 1{Enter}
if lastline contains напал,напала
break
}
Return
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
}