Page 1 of 6 123456 LastLast
Results 1 to 10 of 52

Thread: AutoIt to check label "TIME" Automatic Background Changer

  1. #1
    MGD
    MGD is offline
    FLAC
    Auto Apps:loading...
    MGD's Avatar
    Join Date
    Feb 2005
    Location
    Los Angeles
    Posts
    1,731

    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 Attached Files

  2. #2
    FLAC
    Auto Apps:loading...
    EL CAMINO's Avatar
    Join Date
    Jul 2005
    Location
    upland california us
    Posts
    1,216
    post what you have, it might just need a line or 2.

  3. #3
    MGD
    MGD is offline
    FLAC
    Auto Apps:loading...
    MGD's Avatar
    Join Date
    Feb 2005
    Location
    Los Angeles
    Posts
    1,731
    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

  4. #4
    FLAC Sal R.'s Avatar
    Join Date
    Aug 2006
    Location
    Sun Diego
    Posts
    1,448
    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

  5. #5
    MGD
    MGD is offline
    FLAC
    Auto Apps:loading...
    MGD's Avatar
    Join Date
    Feb 2005
    Location
    Los Angeles
    Posts
    1,731
    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.

  6. #6
    MGD
    MGD is offline
    FLAC
    Auto Apps:loading...
    MGD's Avatar
    Join Date
    Feb 2005
    Location
    Los Angeles
    Posts
    1,731
    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.

  7. #7
    Maximum Bitrate kpjuk's Avatar
    Join Date
    Dec 2003
    Location
    West Midlands
    Posts
    474
    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.......

  8. #8
    MGD
    MGD is offline
    FLAC
    Auto Apps:loading...
    MGD's Avatar
    Join Date
    Feb 2005
    Location
    Los Angeles
    Posts
    1,731
    Nop, still closes the script.

  9. #9
    FLAC Sal R.'s Avatar
    Join Date
    Aug 2006
    Location
    Sun Diego
    Posts
    1,448
    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

  10. #10
    MGD
    MGD is offline
    FLAC
    Auto Apps:loading...
    MGD's Avatar
    Join Date
    Feb 2005
    Location
    Los Angeles
    Posts
    1,731
    That freezes RR untill I exit the script.

Page 1 of 6 123456 LastLast

Similar Threads

  1. Mp3 Integrity check after Hard drive failure
    By mprover in forum Software & Software Development
    Replies: 1
    Last Post: 02-11-2006, 09:46 AM
  2. Easiest Way To Check System Power Usage?
    By James141 in forum Power Supplies
    Replies: 7
    Last Post: 03-09-2005, 06:07 AM
  3. Turn off check disk in XP
    By cyber in forum Newbie
    Replies: 6
    Last Post: 11-22-2004, 11:47 AM
  4. C.A.M.P. Project revealed! please check it out
    By crazyshaxs in forum General Hardware Discussion
    Replies: 10
    Last Post: 04-12-2001, 08:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •