Welcome to the MP3Car.com forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. Registering will also remove advertisements. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact contact us.
|
05-09-2008, 11:19 PM
|
#1
|
|
FLAC
Join Date: May 2007
Location: Lakehood, CO
Vehicle: 2007 PT Cruiser Touring
Posts: 981
|
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?
|
|
|
05-10-2008, 01:01 AM
|
#2
|
|
Road Runner Moderator
Join Date: Sep 2005
Location: West Palm Beach, Florida
Vehicle: 99 Mitsubishi Eclipse
Posts: 2,619
|
Not sure if this will work, but in the RR.ini:
weatherdegress=º
Maybe changing that to have nothing, could possibly work.
|
|
|
05-10-2008, 08:06 AM
|
#3
|
|
FLAC
Join Date: May 2007
Location: Lakehood, CO
Vehicle: 2007 PT Cruiser Touring
Posts: 981
|
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...
Last edited by monkeyracer : 05-10-2008 at 08:16 AM.
|
|
|
05-10-2008, 09:36 AM
|
#4
|
|
FLAC
Join Date: Feb 2005
Location: Los Angeles
Vehicle: 2005 Chrysler 300
Posts: 1,221
|
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.
|
|
|
05-10-2008, 10:00 AM
|
#5
|
|
FLAC
Join Date: May 2007
Location: Lakehood, CO
Vehicle: 2007 PT Cruiser Touring
Posts: 981
|
Not familiar with autoit yet, but...
I guess I'll D/L and
off to learn...

|
|
|
05-10-2008, 10:14 AM
|
#6
|
|
FLAC
Join Date: Feb 2005
Location: Los Angeles
Vehicle: 2005 Chrysler 300
Posts: 1,221
|
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
|
|
|
05-10-2008, 10:38 AM
|
#7
|
|
FLAC
Join Date: Feb 2005
Location: Los Angeles
Vehicle: 2005 Chrysler 300
Posts: 1,221
|
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
|
|
|
05-10-2008, 10:57 AM
|
#8
|
|
FLAC
Join Date: May 2007
Location: Lakehood, CO
Vehicle: 2007 PT Cruiser Touring
Posts: 981
|
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
|
|
|
05-10-2008, 11:05 AM
|
#9
|
|
FLAC
Join Date: Feb 2005
Location: Los Angeles
Vehicle: 2005 Chrysler 300
Posts: 1,221
|
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
Last edited by MGD : 05-10-2008 at 11:08 AM.
|
|
|
05-10-2008, 12:23 PM
|
#10
|
|
FLAC
Join Date: May 2007
Location: Lakehood, CO
Vehicle: 2007 PT Cruiser Touring
Posts: 981
|
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.
|
|
|
05-10-2008, 08:11 PM
|
#11
|
|
FLAC
Join Date: May 2007
Location: Lakehood, CO
Vehicle: 2007 PT Cruiser Touring
Posts: 981
|
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?
|
|
|
05-10-2008, 09:20 PM
|
#12
|
|
Raw Wave
Join Date: Aug 2004
Location: Chicago area,IL
Vehicle: 01 Ford ZX3
Posts: 1,973
|
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.
|
|
|
05-10-2008, 10:44 PM
|
#13
|
|
FLAC
Join Date: Feb 2005
Location: Los Angeles
Vehicle: 2005 Chrysler 300
Posts: 1,221
|
Quote: Originally Posted by Blue ZX3 
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  
|
|
|
05-10-2008, 11:01 PM
|
#14
|
|
FLAC
Join Date: May 2007
Location: Lakehood, CO
Vehicle: 2007 PT Cruiser Touring
Posts: 981
|
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:
Quote: 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?
Last edited by monkeyracer : 05-10-2008 at 11:06 PM.
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:19 PM.
|
|