Sign in to follow this  
Followers 0
Mumms

Help with Script

7 posts in this topic

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. :idea:

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

So any coding hints to get me started :idea:

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

whatever Edited 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

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 :idea:

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

Thank you for all the replies, It has really helpped!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0