Jump to content

Program not properly closing when my script is running


 Share

Recommended Posts

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?

Link to comment
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
Link to comment
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
i can close the program now, thanks for the help!

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

Edited by Dinosaurr
Link to comment
Share on other sites

Link to comment
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
 Share

  • Recently Browsing   0 members

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