Sign in to follow this  
Followers 0
mat07

Slowness script in background

4 posts in this topic

Hello everybody,

i'am doing a script who will be executed in background with a endless loop (While 1...WEnd).
My question is about a prospective slow-down of user's computer because script is in background. My script read one time a excel file (30 000 entries), stock it in an array. Wait and when user is on a special webpage, my script browse the array and show a popup.

Here is my script :

; Read file and stock it in a variable
Local $contacts = _ArrayFileToArray("myfile.csv", ';')

While 1
    ; Wait to be on the webpage
    Local $title = "my special webpage - Windows Internet Explorer"
    WinWaitActive($title)
    
    ; Get value of a input text called myId
    $oIE = _IEAttach($title, 'windowtitle')
    Local $oForm = _IEGetObjByName($oIE, "myId")
    $id = _IEFormElementGetValue($oForm)
    
    ; Check nb time that myId is in array
    Local $nbContact = 0
    For $i = 0 To UBound($contacts)-1 
        If $contacts[$i][3] = $id Then
            $nbContact += 1
        EndIf
    Next
    MsgBox(1,"myWindow", "L'identifiant " & $id & " is " & $nbContact & " time")
    
    WinWaitNotActive($title)
    Sleep(1000)
WEnd

 

On my computer, all is ok, i have no slowness for the time being. But my computer is best than user's computer. They have 2Mo RAM, CPU 2.7 Ghz.

Have you ever met trouble with script in background ?
Have you some good practices to optimize script in background ?

Thank's a lot

Bye

Share this post


Link to post
Share on other sites



If by "2Mo RAM" you mean "2MB RAM" then it will not workm in fact I'd be surprised if the computer boots.

If you mean "2GB RAM" then I'm sure it will be fine, but depends what other resources or being consumed.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

oh excuse me, it's 2Go RAM :>

Thanks for your reply

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