Announcement

Collapse
No announcement yet.

AutoIt to check label "TIME" Automatic Background Changer

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

  • AutoIt to check label "TIME" Automatic Background Changer

    Can someone give me a hint on how to have an AutoIt script running in the background what checks the label "TIME" every 5 or 10 min. I have working script was does this already, but it has to run manually. The script runs fine but it closes it self. How can I make it running all the time?

    All is well, Thanks Guys, working great.

    DOWNLOAD Attatched.
    Attached Files

  • #2
    post what you have, it might just need a line or 2.
    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


    • #3
      Here is the code. It takes the Sunrise and sunset times from the weather skin, compares it with the time label and when they are < > = then I swith my background image acordingly.

      Code:
      $RR = ObjCreate("RoadRunner.sdk")
      $RR.Execute("RELOADWEATHER")
      $VARAM = $RR.getinfo ("W_SUNR")
      $VARAM = "0" & $VARAM
      $VARPM = $RR.getinfo ("W_SUNS")
      $VARPM = "0" & $VARPM
      $TIME = $RR.getinfo ("Time")
      $PMTIME = StringTrimLeft($TIME, 6)
      If $TIME > $VARPM And $PMTIME = "PM"  Then
      	$RR.Execute("SETVARBYCODE;Background;$NightBackground$||SAVETOSKIN;Background;$NightBackground$||RELOADSKIN||NIGHTGAMMA")
      EndIf
      If $TIME < $VARAM And $PMTIME = "AM"  Then
      	$RR.Execute("SETVARBYCODE;Background;$NightBackground$||SAVETOSKIN;Background;$NightBackground$||RELOADSKIN||NIGHTGAMMA")
      EndIf
      If $TIME > $VARAM And $PMTIME = "AM"  Then
      	$RR.Execute("SETVARBYCODE;Background;$DayBackground$||SAVETOSKIN;Background;$DayBackground$||RELOADSKIN||DAYGAMMA")
      EndIf
      If $TIME < $VARPM And $PMTIME = "PM"  Then
      	$RR.Execute("SETVARBYCODE;Background;$DayBackground$||SAVETOSKIN;Background;$DayBackground$||RELOADSKIN||DAYGAMMA")
      EndIf

      Comment


      • #4
        Why don't you just use the time execute plugin?
        Pico-ITX / XP Home with EWF-HORM / RR v12/02/2009 / Winamp v5.13 / RRMedia v1.2.2

        Comment


        • #5
          It does not work while RR is running.
          I could run my script on the ONSONGSTART but when I am in the radio skin and the sunset time occours it would not switch my background either.

          Comment


          • #6
            What we need now is instead of the auto skin change an auto background change. But then I dont want to adjust my times all the time for this to happen, that's why I use the sunrise and sunset labels.

            Comment


            • #7
              Hi MGD,

              you need a loop in there, try this

              $RR = ObjCreate("RoadRunner.sdk")
              $RR.Execute("RELOADWEATHER")
              $VARAM = $RR.getinfo ("W_SUNR")
              $VARAM = "0" & $VARAM
              $VARPM = $RR.getinfo ("W_SUNS")
              $VARPM = "0" & $VARPM
              $a = 1
              while $a > 1
              $TIME = $RR.getinfo ("Time")
              $PMTIME = StringTrimLeft($TIME, 6)
              If $TIME > $VARPM And $PMTIME = "PM" Then
              $RR.Execute("SETVARBYCODE;Background;$NightBackgro und$||SAVETOSKIN;Background;$NightBackground$||REL OADSKIN||NIGHTGAMMA")
              EndIf
              If $TIME < $VARAM And $PMTIME = "AM" Then
              $RR.Execute("SETVARBYCODE;Background;$NightBackgro und$||SAVETOSKIN;Background;$NightBackground$||REL OADSKIN||NIGHTGAMMA")
              EndIf
              If $TIME > $VARAM And $PMTIME = "AM" Then
              $RR.Execute("SETVARBYCODE;Background;$DayBackgroun d$||SAVETOSKIN;Background;$DayBackground$||RELOADS KIN||DAYGAMMA")
              EndIf
              If $TIME < $VARPM And $PMTIME = "PM" Then
              $RR.Execute("SETVARBYCODE;Background;$DayBackgroun d$||SAVETOSKIN;Background;$DayBackground$||RELOADS KIN||DAYGAMMA")
              EndIf
              sleep(300000) ; 1000 = 1 second
              WEnd

              This will check the time and take the action you identified, then sleep for 300 seconds, wake up and do it all again. There is no way out of the loop, so you will have to terminate this script yourself.

              cheers
              KPJUK
              M1000, 512MB, 512MB CF, 6GB Disk (4200rpm),
              DVD/RW, Dynamix 8" screen, M2-ATX, Custom case,Too many hours building and rebuilding and rebuild.......

              Comment


              • #8
                Nop, still closes the script.

                Comment


                • #9
                  heh...try $a = 2

                  or

                  While $a = 1
                  Pico-ITX / XP Home with EWF-HORM / RR v12/02/2009 / Winamp v5.13 / RRMedia v1.2.2

                  Comment


                  • #10
                    That freezes RR untill I exit the script.

                    Comment


                    • #12
                      This will do the trick:

                      Code:
                      $RR = ObjCreate("RoadRunner.sdk")
                      $RR.Execute("RELOADWEATHER")
                      
                      While 1
                          Timer()
                          sleep (300)    
                      WEnd
                      
                      Func Timer()
                      
                          $VARAM = $RR.getinfo("W_SUNR")
                          $VARAM = "0" & $VARAM
                          $VARPM = $RR.getinfo("W_SUNS")
                          $VARPM = "0" & $VARPM
                          $TIME = $RR.getinfo("Time")
                          $PMTIME = StringTrimLeft($TIME, 6)
                          If $TIME > $VARPM And $PMTIME = "PM" Then
                              $RR.Execute("SETVARBYCODE;Background;$NightBackground$||SAVETOSKIN;Background;$NightBackground$||RELOADSKIN||NIGHTGAMMA")
                          EndIf
                          If $TIME < $VARAM And $PMTIME = "AM" Then
                              $RR.Execute("SETVARBYCODE;Background;$NightBackground$||SAVETOSKIN;Background;$NightBackground$||RELOADSKIN||NIGHTGAMMA")
                          EndIf
                          If $TIME > $VARAM And $PMTIME = "AM" Then
                              $RR.Execute("SETVARBYCODE;Background;$DayBackground$||SAVETOSKIN;Background;$DayBackground$||RELOADSKIN||DAYGAMMA")
                          EndIf
                          If $TIME < $VARPM And $PMTIME = "PM" Then
                              $RR.Execute("SETVARBYCODE;Background;$DayBackground$||SAVETOSKIN;Background;$DayBackground$||RELOADSKIN||DAYGAMMA")
                          EndIf
                      
                      EndFunc
                      The only downfall of this is it will not work until you execute the WEATHER command to propagate all of the weather labels.
                      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


                      • #13
                        Nope, that srcews RR completely. I can just put Timer event in the menu.skin and run the script every 5 min. I know that works.

                        Comment


                        • #15
                          Well, Tryed that and ran it from the ONSKINSTART but nothing. Where does it get the info what to switch? Does it read the Sunset and Sunrise Labels. I set my clock to 1:00 am and it still shows my day background.

                          Comment

                          Working...
                          X