Sign in to follow this  
Followers 0
Dinosaurr

Program not properly closing when my script is running

5 posts in this topic

While 1
    Select
        Case ProcessExists("uTorrent.exe") And ProcessExists("pg2.exe") = 0
            If ProcessExists("pg2.exe") = 0 Then
                Run("pg2.exe")
            EndIf
        Case ProcessExists("pg2.exe") And ProcessExists("uTorrent.exe") = 0
            ProcessClose("pg2.exe")
            If ProcessExists("pgfix.exe") = 0 Then
                Run("pgfix.exe")
            EndIf
            ControlClick("Warning", "", "Button1")
            Sleep(750)
            ControlClick("PGFix", "", "Button1")
    EndSelect
WEnd

This is the code for my script, but when it is running, when i try to close uTorrent, it will close and the window wont show, but the process doesnt close so PG2 won't close.

Any suggestions?

Share this post


Link to post
Share on other sites



How does this go for you?

While 1
    Select
        Case (ProcessExists("pg2.exe") <> 0) And (ProcessExists("uTorrent.exe") = 0)
            MsgBox(0, "", "Case 2")
            ProcessClose("pg2.exe")
            If ProcessExists("pgfix.exe") = 0 Then
                Run("pgfix.exe")
                MsgBox(0, "", "Running pgfix.exe")
            EndIf
        ;ControlClick("Warning", "", "Button1")
        ;Sleep(750)
        ;ControlClick("PGFix", "", "Button1")
        Case (ProcessExists("uTorrent.exe") <> 0) And (ProcessExists("pg2.exe") = 0)
            MsgBox(0, "", "Case 1")
            If ProcessExists("pg2.exe") = 0 Then
            ;Run("pg2.exe")
                MsgBox(0, "", "Running Pg2.exe")
            EndIf
    EndSelect
WEnd

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

How does this go for you?

While 1
    Select
        Case (ProcessExists("pg2.exe") <> 0) And (ProcessExists("uTorrent.exe") = 0)
            MsgBox(0, "", "Case 2")
            ProcessClose("pg2.exe")
            If ProcessExists("pgfix.exe") = 0 Then
                Run("pgfix.exe")
                MsgBox(0, "", "Running pgfix.exe")
            EndIf
;ControlClick("Warning", "", "Button1")
;Sleep(750)
;ControlClick("PGFix", "", "Button1")
        Case (ProcessExists("uTorrent.exe") <> 0) And (ProcessExists("pg2.exe") = 0)
            MsgBox(0, "", "Case 1")
            If ProcessExists("pg2.exe") = 0 Then
    ;Run("pg2.exe")
                MsgBox(0, "", "Running Pg2.exe")
            EndIf
    EndSelect
WEnd
i can close the program now, thanks for the help!

[edit] but may i ask what the <> 0 does?

Edited by Dinosaurr

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

<> means does not equal...

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