Mumms Posted May 8, 2010 Share 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 Link to comment Share on other sites More sharing options...
Bert Posted May 8, 2010 Share 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/ Link to comment Share on other sites More sharing options...
Mumms Posted May 8, 2010 Author Share Posted May 8, 2010 So any coding hints to get me started Link to comment Share on other sites More sharing options...
MvGulik Posted May 8, 2010 Share 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 ... Link to comment Share on other sites More sharing options...
Tvern Posted May 8, 2010 Share 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 Link to comment Share on other sites More sharing options...
somdcomputerguy Posted May 8, 2010 Share 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. Link to comment Share on other sites More sharing options...
Mumms Posted May 8, 2010 Author Share Posted May 8, 2010 Thank you for all the replies, It has really helpped! Link to comment Share on other sites More sharing options...
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