samp read chatlog

aymanhdbest

Новичок
Автор темы
1
0
I'm wondering if i it is possible to read for AHK chatlog and everytime a specific message is sent the autohotkey then automatically sends another command.
for example of what i mean: a guy asks for license, everytime autohotkey detects the message in chat for example:
* Fun_ky (level 13) requested an instructor (EN). To accept his request use (/accept needlicense 440).
it responds by executing the command to accept needlicense the player id who asked. in short:
1) autohotkey reads "... (/ accept needlicense ...."
2) it automatically types / accept needlicense (player id that asked for license)
is it possible and how?
 

meowprd

Тот самый Котовский
Проверенный
1,283
711
AutoHotKey:
file_update := A_MyDocuments "/GTA San Andreas User Files/SAMP/chatlog.txt"
FileRead, chatlog, % file_update
save(chatlog)
if(regExMatch(chatlog, ".*requested an instructor.*\/accept needlicense ([0-9]*)\)", out) {
    sendInput, {F6}/accept needlicense %out1%{ENTER} 
}



save(chatlog)
{
    static logschat     := A_MyDocuments "\GTA San Andreas User Files\SAMP\ChatLogs\"
    static chat         := A_MyDocuments "\GTA San Andreas User Files\SAMP\chatlog.txt"
    FileCreateDir, % logschat A_MM "-" A_YYYY
    FileAppend, % chatlog, % logschat A_MM "-" A_YYYY "\" A_DD "." A_MM "." A_YYYY ".txt"
    FileDelete, % chat
}