Помощь в написании AHK скрипта

nopa_nopa

Новичок
Автор темы
15
0
Версия SA-MP
  1. 0.3.7-R4
Помогите пожалуйста! Буду очень благодарен, нужно что бы в чат выводило никнейм или ID игрока отправившего вопрос.
Сообщение из чатлога - Вопрос от Nick_Name [ID 100]:
Нужно что бы вывело - /otvet Nick_Name
Нужно что бы вывело - /otvet 100

код:
#IfWinActive GTA:SA:MP
SLES := 0
suspectid := 0
suspectname := "Test"
suspectid1 := 0
suspectname1 := "Test"
path := "\GTA San Andreas User Files\SAMP\"

numpad1::
{
FileDelete, %A_MyDocuments%%path%suspect.txt
sleep 50

Loop
{
Loop, read, %A_MyDocuments%%path%chatlog.txt, %A_MyDocuments%%path%suspect.txt
{
IfInString, A_LoopReadLine, ] Вопрос от , FileAppend, %A_LoopReadLine%`n
}

Loop, read, %A_MyDocuments%%path%suspect.txt
{
RegExMatch(A_LoopReadLine, "] Вопрос от (.*) ID ", suspectname)
RegExMatch(A_LoopReadLine, " ID (.*): ", suspectid)
}
NewStr := RegExReplace(suspectid, " ID (.*):", "$1")
sendinput {f6}/otvet %NewStr%
Break
if SLES <> 0
{
SLES := 0
Break
}
}
sleep 1000
}

return