Warklot
Участник
- 112
- 3
Hello how to check like 5 lines of samp gta san andreas chatlog with this code,because in server there is alot of spam and its very hard for script to check for that lastline
AutoHotKey:
ChatLog = %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
Update:
lastline := GetNewLine(ChatLog)
if(RegExMatch(Lastline,"help"))
{
sendchat("what help you need")
}
return
GetNewLine(filename)
{
static old
static new
if !old
{
FileGetSize, old, %filename%
new := old
}
while old = new
{
sleep 1 ;Delay
FileGetSize, new, %filename%
}
old := new
Loop, read, %filename%
if A_LoopReadLine
{
last := A_LoopReadLine
}
return last
}