PD,
Try it like this...(not tested)
HotKeySet("{ESC}", "Terminate") ; Press Esc key to exit script.
Global $sFileName = "281478146260429_chatlog.txt"
Global $asearch[5]
$asearch[0] = "tips you"
$asearch[1] = "bank credits"
$asearch[2] = "trade with you"
$asearch[3] = "you tell"
$asearch[4] = "to a duel"
_FileDeleteLines()
AdlibRegister("_FileDeleteLines", 10 * 1000) ; Run the function, _FileDeleteLines(), every 30 secs
While Sleep(100)
WEnd
Func _FileDeleteLines()
Local $sFileContents = FileRead($sFileName)
Local $hFileOpen = FileOpen($sFileName, 2) ; $FO_OVERWRITE (2) = Write mode (erase previous contents)
For $1 = 0 To UBound($asearch) - 1
$sFileContents = StringRegExpReplace($sFileContents, '(?m)^.*\Q' & $asearch[$1] & '\E.*\R?(*SKIP)(?!)|^.*\R*', ""))
Next
FileWrite($hFileOpen, $sFileContents)
FileClose($hFileOpen)
EndFunc ;==>_FileDeleteLines
Func Terminate()
AdlibUnRegister("_FileDeleteLines")
Exit
EndFunc ;==>Terminate
kylomas