Phenom Posted August 15, 2010 Posted August 15, 2010 There is a certain program that is always writing to a log file that is in text format. How can AutoIt be used to constantly monitor what is being written to this text file and take certain actions depending on what new output it sees?
PsaltyDS Posted August 16, 2010 Posted August 16, 2010 On 8/15/2010 at 9:19 AM, '4ggr35510n said: Infinite loop containing FileReadWell, maybe a loop that checks the time stamp or filesize and reads it only if changed. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Sobiech Posted August 16, 2010 Posted August 16, 2010 (edited) i coded this filewatcher ~~ one week ago ; File watcher $INI = @ScriptDir & "\Settings.ini" $filename = IniRead($INI, "watching", "filename", ""); Filename $string = IniRead($INI, "watching", "stringtosearch", ""); String writed to file by bot $do = IniRead($INI, "watching", "filerun", ""); Run a file after text in file $exit = IniRead($INI, "watching", "exitiffound", ""); Exit if string was found? $delay = IniRead($INI, "delays", "searchdelay", ""); Time between loop wil check file again $File = FileOpen($filename, 0) ; 0 - Read Mode While 1 If FileReadLine($filename, 1) = $string Then ; If first line of file is our string then... ShellExecute($do); Run a file If $exit = "true" Then Exit Else ContinueLoop EndIf EndIf sleep($delay * 1000) WEnd FileClose($File) This should be useful for u Edited August 16, 2010 by Sobiech This world is crazy
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now