Announcement

Collapse
No announcement yet.

AutoIt Detecting when Road Runner closes

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • AutoIt Detecting when Road Runner closes

    I have a script that poll's RR for information. I have multiple checks in the script like the following:

    if ProcessExists("RoadRunner.exe") = 0 Then Exit

    I have this the line above all lines that poll info from RR.

    The problem, is when RR closes, The Road Runner.exe process can remain in the task list for up to 4 seconds. Thus, I get a nasty error from the script that the object has failed when I close Road Runner. (The window handle also remains active till RR completely shuts down, I tried that as well)

    The script polls information every 1 second, and I do not want to have to put a wait for 5 seconds before it polls info from RR.

    Is there another way, with AutoIt to more reliably tell when RR is closed or in the process of closing?

    I did find this:

    Opt("RunErrorsFatal", 0)

    Which disables error reporting, but only on run & wait commands, and not other types of errors.

    The script is pretty straight forward, and solid, so I am not opposed to turning off errors completely for the script, if someone knows how.
    Front End of Choice: Ride Runner (Is there anything else??? ) & Powered by the DFX5.1 Skin Available in the Mobile App Mart

    My Fiero Build Thread

  • #2
    which object are you using in the script that is giving you the error ? is there no way to check if the object has closed or is still valid ?
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

    Comment


    • #3
      I am using the following code, interacting with RR's SDK:

      $rr=ObjCreate("RoadRunner.sdk")
      $rr.Execute("SETIND;CUSTOM_CdInsert;OFF")

      I have found no way, as of yet, to check if the object is still valid, without actually using it.
      Front End of Choice: Ride Runner (Is there anything else??? ) & Powered by the DFX5.1 Skin Available in the Mobile App Mart

      My Fiero Build Thread

      Comment


      • #4
        the way i handled this is to tell my script to set a variable to "1" in rr once the object is created then check the status of that variable before i run any .execute commands. My exectbl.ini tells rr to set the variable to "0" before rr closes. I no longer have those errors
        mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
        Follow Me on Twitter or Facebook
        Live mp3Car Facebook Chat

        Comment


        • #5
          Originally posted by JohnWPB View Post
          I am using the following code, interacting with RR's SDK:

          $rr=ObjCreate("RoadRunner.sdk")
          $rr.Execute("SETIND;CUSTOM_CdInsert;OFF")

          I have found no way, as of yet, to check if the object is still valid, without actually using it.
          Maybe try using "IsObj($rr)"

          ie
          $rr=ObjCreate("RoadRunner.sdk")
          if IsObj($rr) Then $rr.Execute("SETIND;CUSTOM_CdInsert;OFF")
          RideRunner...The #1 FE, PERIOD.

          Current Project: DFXVoice [v1.0 Released]
          Next in line: RRMedia v2.0

          DFX 5.1.1 Skin
          Appstore Link

          My RideRunner Plugins
          RRMedia
          RRExtended
          DFXVoice

          "There are no bugs - only undocumented features."

          Comment


          • #6
            Just tried that, no luck. RR remains as a process for a few seconds after it closed, and thus passes the exists check, but then errors when trying to send something to it.

            This has gotten so frustrating....

            I am using this simple script to test with. If I close RR, I get the error about being unable to communicate with the object.

            Code:
            $rr=ObjCreate("RoadRunner.sdk")
            
            For $test = 1 to 5
                sleep(1000)
                $RRCheck = IsObj($rr)
                if $RRCheck = 1 then $rr.Execute("SETIND;CUSTOM_WIFI;OFF")
            Next
            Originally posted by Sonicxtacy02 View Post
            the way i handled this is to tell my script to set a variable to "1" in rr once the object is created then check the status of that variable before i run any .execute commands. My exectbl.ini tells rr to set the variable to "0" before rr closes. I no longer have those errors
            How are you setting the variable in the exectbl to 0 when RR exits? A button code would not work well added to the EXIT command, as when you send the power down to the computer, no button code is executed ect, or for some reason RR locks, or does not exit gracefully. I do not want a msgbox holding up the system shutting down.
            Front End of Choice: Ride Runner (Is there anything else??? ) & Powered by the DFX5.1 Skin Available in the Mobile App Mart

            My Fiero Build Thread

            Comment


            • #7
              Originally posted by JohnWPB View Post
              Just tried that, no luck. RR remains as a process for a few seconds after it closed, and thus passes the exists check, but then errors when trying to send something to it.

              This has gotten so frustrating....

              I am using this simple script to test with. If I close RR, I get the error about being unable to communicate with the object.

              Code:
              $rr=ObjCreate("RoadRunner.sdk")
              
              For $test = 1 to 5
                  sleep(1000)
                  $RRCheck = IsObj($rr)
                  if $RRCheck = 1 then $rr.Execute("SETIND;CUSTOM_WIFI;OFF")
              Next
              How are you setting the variable in the exectbl to 0 when RR exits? A button code would not work well added to the EXIT command, as when you send the power down to the computer, no button code is executed ect, or for some reason RR locks, or does not exit gracefully. I do not want a msgbox holding up the system shutting down.
              i was using the ONEXIT event that i have in my exectbl.ini.. but as i saying that i realized thats something i added to the latest source myself. Its not official RR code. I can send that beta to ya if ya want though.
              mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
              Follow Me on Twitter or Facebook
              Live mp3Car Facebook Chat

              Comment


              • #8
                Code:
                $rr=ObjCreate("RoadRunner.sdk")
                	$rr.execute("quit")
                	
                For $test = 1 to 5
                	 if ProcessExists("RoadRunner") = 0 then Exit
                    sleep(1000)
                    if Not IsObj($rr) then exit
                	$rr.Execute("SETIND;CUSTOM_WIFI;OFF")
                	If @error then ContinueLoop
                Next
                send that to guino also and hopefully can be added for the next release, i can use that feature as well.
                BASSRR ==> [Audio Player/MusicDB/Cd Player/Ripper/Rate/Internet Radio/Audio Capture/Youtube Video]
                RRTube ==> [View/Download Youtube Videos]
                WifiMan ==> [Wifi Manager]
                RRec ==> [Audio Capture]

                If You Want To Be Given Everything, Give Everything Up ...
                Bird York -- In The Deep --

                Comment


                • #9
                  I second that one for sure, as it is such a simple add to RR, but will help with any scripting outside RR 10 fold.
                  Front End of Choice: Ride Runner (Is there anything else??? ) & Powered by the DFX5.1 Skin Available in the Mobile App Mart

                  My Fiero Build Thread

                  Comment


                  • #10
                    Originally posted by JohnWPB View Post
                    I second that one for sure, as it is such a simple add to RR, but will help with any scripting outside RR 10 fold.
                    well i was gonna just upload a beta but i forgot i updated to the dec. 6th release and copied over my beta . being that the dec. 6 source isnt available yet i'm gonna pm guino and see if he can add it to the dec 6th release before it goes public. its only one line of code it shouldnt be too hard.
                    mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
                    Follow Me on Twitter or Facebook
                    Live mp3Car Facebook Chat

                    Comment


                    • #11
                      I dropped using the SDK all together, and am passing commands via RR"s WinHandle. It's not as clean of a way to code things, but I will never see another error pop-up if RR is not running for any reason.

                      The last thing I wanted is to have the system hang on an error msg for someone, possibly causing a dead battery as the computer didn't go into standby/hibernate ect.
                      Front End of Choice: Ride Runner (Is there anything else??? ) & Powered by the DFX5.1 Skin Available in the Mobile App Mart

                      My Fiero Build Thread

                      Comment


                      • #12
                        great minds must think alike... I was just wondering about this exact same thing as I've been getting kinda sick of the autoit message box errors on my script.
                        I was under the impression ONEXIT already existed but I guess i was wrong.
                        04 Acura TL w/ core2duo 2ghz laptop w/ 1gb RAM on a docking station.

                        Fast car, fast PC. ;)

                        http://www.arcdesigns.net/carpc/

                        My TL CarPC ver2

                        FSR Flash Skin w/ moving weather maps

                        Comment


                        • #13
                          it should be effective in the 12-13 binary
                          mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
                          Follow Me on Twitter or Facebook
                          Live mp3Car Facebook Chat

                          Comment


                          • #14
                            so on this command, you use it like....
                            Code:
                            "ONEXIT","CLOSEWINDOW;iGuidance"
                            i didnt see any info on the latest skin commands.txt
                            BASSRR ==> [Audio Player/MusicDB/Cd Player/Ripper/Rate/Internet Radio/Audio Capture/Youtube Video]
                            RRTube ==> [View/Download Youtube Videos]
                            WifiMan ==> [Wifi Manager]
                            RRec ==> [Audio Capture]

                            If You Want To Be Given Everything, Give Everything Up ...
                            Bird York -- In The Deep --

                            Comment


                            • #15
                              I put the command there, but when viewing the debug it didn't seem like it got to execute it.. I have to review this.
                              Ride Runner RR's Myspace

                              "Being happy is not about having what you want, it's about wanting what you have."
                              "The best things in life are always free - but that doesn't mean money can't buy you good things."

                              Comment

                              Working...
                              X