Jump to content

Recommended Posts

Posted

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
Posted

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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...