So sollte es funktionieren (mal wieder ungetestet):
GetChatLine(Line, ByRef Output, timestamp=0, color=0){ ;Funktion, recht weit oben hin
chatindex := 0
FileRead, file, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
loop, Parse, file, `n, `r
{
if(A_LoopField)
chatindex := A_Index
}
loop, Parse, file, `n, `r
{
if(A_Index = chatindex - line){
output := A_LoopField
break
}
}
file := ""
if(!timestamp)
output := RegExReplace(output, "U)^\[\d{2}:\d{2}:\d{2}\]")
if(!color)
output := RegExReplace(output, "Ui)\{[a-f0-9]{6}\}")
return
}
SetTimer, CheckCar, 500 ;vor das erste return!
return
CheckCar:
if(!WinActive("GTA:SA:MP"))
return
GetChatLine(0, chat)
if(InStr(chat, "deine Reload-Time ist nun 15 Minuten.")){
SetTimer, CarSell, -900000
AddChatMessage(0xFF6600, "Timer gestartet")
}
return
CarSell:
if(WinActive("GTA:SA:MP"))
AddChatMessage(0xFF6600, "Du kannst nun wieder ein Auto verticken")
else
MsgBox, Du kannst nun wieder ein Auto verticken