Announcement

Collapse
No announcement yet.

Slider for temperature from weather?

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

  • Slider for temperature from weather?

    I'm trying to make a slider for the current temperature based on the code "w_tmp" in the skincommands.txt.

    I've got it almost all the way working:

    Code:
    SETVARBYCODE;TEMPSLIDER;w_tmp||EVAL;TEMP;$TEMPSLIDER$*546
    This is designed so that if the temp is 120, the slider would be at or close to 100%

    Problem is the "w_tmp" label returns with the degrees symbol, and it doesn't calculate the slider's position because the label isn't strictly a number. (Can't calculate, so it always returns the position as 0, same as if you tried to divide 120 by orange, the answer is zero because the syntax is wrong.)

    Is there a way to get just the numeric value from the "w_tmp" label so that this can be done?
    2007 Chrysler PT Cruiser TE
    Car PC Progress:
    Planning.......[---------X-] 95%
    Parts...........[---------X-] 90%
    Fabrication...[---------X-] 90%
    RR Skin........[---------X-] 95%
    View my
    Worklog
    Road Runner Skins
    Website
    Favorite thread EVER!

  • #2
    Not sure if this will work, but in the RR.ini:
    weatherdegress=

    Maybe changing that to have nothing, could possibly work.
    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


    • #3
      Doesn't seem like that works.

      I had a label display the calculations, it always comes up as 0.

      I had it display the $TEMPSLIDER$ variable, and it shows the temperature in this format:

      ##__F

      So I basically need to find a way to delete the "space degrees symbol space F" from the tag...
      2007 Chrysler PT Cruiser TE
      Car PC Progress:
      Planning.......[---------X-] 95%
      Parts...........[---------X-] 90%
      Fabrication...[---------X-] 90%
      RR Skin........[---------X-] 95%
      View my
      Worklog
      Road Runner Skins
      Website
      Favorite thread EVER!

      Comment


      • #4
        you need to do this in Autoit and trim the sting of the degree symbol and then set a variable in RR and use that.

        Comment


        • #5
          Not familiar with autoit yet, but...

          I guess I'll D/L and


          off to learn...
          2007 Chrysler PT Cruiser TE
          Car PC Progress:
          Planning.......[---------X-] 95%
          Parts...........[---------X-] 90%
          Fabrication...[---------X-] 90%
          RR Skin........[---------X-] 95%
          View my
          Worklog
          Road Runner Skins
          Website
          Favorite thread EVER!

          Comment


          • #6
            Something like this should do it.

            Code:
            $rr = ObjCreate("RoadRunner.sdk")
            $var = $rr.getinfo("w_tmp")
            $var = StringTrimLeft($var, 3)
            $var = StringStripWS($var, 8)
            ;MsgBox(4096, "Result", $var)
            $rr.execute("SETVAR;MYTEMP; &$var")
            Then you should have MYTEMP showing only 75 instead of 75*F

            Comment


            • #7
              Ok, here is ascript what does exactly this. You can run it when ever you update the weather info. The VARIABLE is called "MYTEMP" and if you want to set a label then use
              as label code "=$MYTEMP$"
              Tested and working.
              Just rename the file to WeatherTemp.exe
              Attached Files

              Comment


              • #8
                since i'm still new with autoit...

                So, I would compile this into a script saved as an .exe and have the above code amended to look like this right?:

                Code:
                Run;$skinpath$myscript.exe||SETVARBYCODE;TEMPSLIDER;MYTEMP||EVAL;TEMP;$TEMPSLIDER$*546
                Or just have myscript.exe load "ONSKINSTART" (So that it doesn't try to load it again when I go back and click the above button again...)

                Edit:

                Didn't see you posted the script. I'll try this when I get to my home computer.

                Thanks
                2007 Chrysler PT Cruiser TE
                Car PC Progress:
                Planning.......[---------X-] 95%
                Parts...........[---------X-] 90%
                Fabrication...[---------X-] 90%
                RR Skin........[---------X-] 95%
                View my
                Worklog
                Road Runner Skins
                Website
                Favorite thread EVER!

                Comment


                • #9
                  Just Rename it to weatherTemp.exe and put it in your scripts folder.
                  On you menu.skin where you call the weather.skin, run this script.
                  Code:
                  "LOAD;Weather.skin||RUN;$SKINPATH$myscripts\weatherTemp.exe||SETVARBYCODE;TEMPSLIDER;$MYTEMP$||EVAL;TEMP;$TEMPSLIDER$*546"
                  The script only returns the number, like 78 or 52 in the VARIABLE

                  Comment


                  • #10
                    Exactly what I was looking for, now it's a matter of time to wait for the official release of the RR update, so that weather AND solid slider styles work at the same time.
                    2007 Chrysler PT Cruiser TE
                    Car PC Progress:
                    Planning.......[---------X-] 95%
                    Parts...........[---------X-] 90%
                    Fabrication...[---------X-] 90%
                    RR Skin........[---------X-] 95%
                    View my
                    Worklog
                    Road Runner Skins
                    Website
                    Favorite thread EVER!

                    Comment


                    • #11
                      That truncated the tag down to remove the extra stuff, but it kept the values as text rather than numbers, so EVAL doesn't do anything.

                      (I tried "EVAL;TESTTEMP;$MYTEMP$+5" and a label with "=$TESTTEMP$" and it just showed 5 in the label, rather than the temp plus 5.)

                      Is there a way to have the autoit script then convert the value into a number rather than text?
                      2007 Chrysler PT Cruiser TE
                      Car PC Progress:
                      Planning.......[---------X-] 95%
                      Parts...........[---------X-] 90%
                      Fabrication...[---------X-] 90%
                      RR Skin........[---------X-] 95%
                      View my
                      Worklog
                      Road Runner Skins
                      Website
                      Favorite thread EVER!

                      Comment


                      • #12
                        The reason that happened was because you need to call the weather screen first before running that script as that label equals nothing until you go to the weathe scn to make RR populate the label with the info from the weather it found.
                        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


                        • #13
                          Originally posted by Blue ZX3 View Post
                          The reason that happened was because you need to call the weather screen first before running that script as that label equals nothing until you go to the weathe scn to make RR populate the label with the info from the weather it found.

                          You so smucking fart

                          Comment


                          • #14
                            OK, I rearranged the code to look like this:

                            Code:
                            "WEATHER||wait;5||RUN;$skinpath$weatherTemp.exe||SETVAR;TEMPSLIDER;$MYTEMP$||EVAL;TEMP;$TEMPSLIDER$*546"
                            
                            .
                            And it works, but I have to load the weather skin, then go back to main, and load it again for it to calculate.

                            I basically have to run the code above, wait a few seconds, then load it again. I set a timer event so that every 5 seconds it evals the variables and set's the slider, because the first time it loads, it shows 0, then the second time it shows the correct amount.
                            I think this is because it takes a couple seconds to download the info from the .xml feed and it has to start from the WEATHER.skin (rather than having the skin pre-loaded) so the first time it tries, the label isn't set yet. (I've tried the wait; at 10 seconds though, and that didn't seem to affect it.)

                            We're getting closer to getting this working nicely though.

                            In skincommands.txt:

                            Originally posted by skincommands.txt
                            This event is re-occurring, so every few XXX seconds it will re-execute the TIMER event.
                            You can use a simple variable switch to prevent it from executing your command more than once (if desired).
                            What variable switch would I use? Is there a way to execute the command only until the evaluated result is above 0?
                            2007 Chrysler PT Cruiser TE
                            Car PC Progress:
                            Planning.......[---------X-] 95%
                            Parts...........[---------X-] 90%
                            Fabrication...[---------X-] 90%
                            RR Skin........[---------X-] 95%
                            View my
                            Worklog
                            Road Runner Skins
                            Website
                            Favorite thread EVER!

                            Comment

                            Working...
                            X