Mumms 0 Posted May 8, 2010 Here is my code. What it is doing, is opening the log file every loop and reading the last line to see if someone says "@vp" Is there anyway i can do this a different way that wouldn't make the user lag so badly, because I have had a ton of complaints. While 1 $vp = 0 FileClose($file) FileOpen("demo/MP/qconsole.log", 0) $line = FileReadLine($file, -1) $vp = StringInStr($line, "@vp", 2) If $vp > 1 Then bind() Sleep(3000) EndIf Wend Share this post Link to post Share on other sites
Bert 1,430 Posted May 8, 2010 When the log file changes, the modified date is changed. Just look at that. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Share this post Link to post Share on other sites
Mumms 0 Posted May 8, 2010 So any coding hints to get me started Share this post Link to post Share on other sites
MvGulik 86 Posted May 8, 2010 (edited) whatever Edited February 7, 2011 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)"Believing what you know ain't so" ...Knock Knock ... Share this post Link to post Share on other sites
Tvern 11 Posted May 8, 2010 Try adding a sleep in your loop like this: While 1 $vp = 0 FileClose($file) FileOpen("demo/MP/qconsole.log", 0) $line = FileReadLine($file, -1) $vp = StringInStr($line, "@vp", 2) If $vp > 1 Then bind() Sleep(2500) EndIf Sleep(500) Wend Share this post Link to post Share on other sites
somdcomputerguy 103 Posted May 8, 2010 Try adding a sleep in your loop..I was going to suggest that too.For while your waiting:- "File, Directory and Disk functions" Reference in your local AutoIt documentation.- FileGetTime documentation at AutoIt wiki.So any coding hints to get me started Another nudge: If the file date hasn't changed since last check, don't bother opening it and reading to check for a change.. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Share this post Link to post Share on other sites
Mumms 0 Posted May 8, 2010 Thank you for all the replies, It has really helpped! Share this post Link to post Share on other sites