Тема: Нажатие клавиши по появлении определенной строки в файле
В общем:
Делаю скрипт, который в GTA SA делает прыжок, когда в чатлоге (ткст файл) появляется строка с текстом "Объявление".
Не могу понять своей ошибки. Прошу помочь найти её.
name = chatlog.txt
Loop
{
FileGetSize, old, %Name%
new := old
while old = new
{
sleep 500
FileGetSize, new_s, %Name%
}
StringCaseSense, Locale
FindWords := "Объявление" ; Var filter
Loop, Read, %A_ScriptDir%\chatlog.txt
{
If !A_LoopReadLine
{
EmptyString := % A_Index
CountEmptyStringNum .= ", "EmptyString
CountEmptyString++
}
}
Loop, Parse, FindWords, `,
{
FileRead, OutPutVar, %A_ScriptDir%\chatlog.txt
IfInString, OutPutVar, % A_LoopField
{
CurrentWord := % A_LoopField
FoundWords .= ", "CurrentWord
FoundWordsNum++
}
}
StringTrimLeft, FoundWords2, FoundWords, 1
StringTrimLeft, CountEmptyStringNum2, CountEmptyStringNum, 1
If !CurrentWord
FileAppend, Not Detect (%A_Index%)`n, log.log
Else
send {shift down}
sleep 10
send {shift up}
}
return
F5::
ExitApp
PS. Не обращайте внимание на всякие подсчеты строк. Они мне нужны.
(Не обращайте внимания на логин)