|
|||||||
| Register | FAQ | XDA-Portal | XDA-Wiki | Device database | Donate! | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Figured I would make a thread for this to keep the S2U2 thread uncluttered
A_C's wonderful S2U2 introduced support for weather forecast display if you used some apps to get weather, or you could use "User" generated weather data in the registry. I never have good luck with those weather apps, but I am handy with mortscript - the following script works with S2U2 *and* rlToday, giving you the current weather and the forecast for today or tomorrow. REQUIRED: SU2U 0.95 or later, installed, with UserWeather enabled in settings MortScript 4.1 installed CHANGES: In V2.1 I've cleaned up the system paths so they are not hard coded * this should work no matter where you have MortScript installed In V2 I've updated the script as follows: * if your cellular radio is OFF, the weather check is skipped - it will try again on the next scheduled time (ie, it works right when you are in flight mode) * if there is any runtime error at all, the script quietly quits now, and tries again on the next scheduled time TWEAKS: Near the top of the script, you must edit the various settings (see below) to get your weather, and to have it update as often as you want. You can also change some lower-level parts of the script - if you don't want it to switch to tomorrow's weather forcast after 4pm, remove these lines from the script: Code:
# get tomorrow's weather if hour past 4pm (>15)
if (hour > 15)
notDone = -1
endif
Code:
weather="W|"&code&"|"&hitemp&"|"&lotemp Change code to ccode to show the icon for the current weather, not the forecast for the day Change lotemp to temp to display the forecast hi temp / current temp INSTALLING AND RUNNING Unzip the attached zip file Copy notiweather.mscr to /Windows/Startup If you have run a previous version of this script, you can copy clearweather.mscr anywhere onto your device, and run it once - it will ask if it can clear the notifications... tap Yes. Then you can delete the script Run the notiweather.mscr script by navigating to it in a file browser on your device and double tappping it. It should silently run - if it works you should see some data activity. Run S2U2 and see if you've got some weather. It is safe to run the script manually to update the weather - it will also update the next run time to be whatever you have it set for in the script. WEATHER PANEL ICONS S2U2 has an incomplete set of Weather Panel Icons. Go to http://www.desktopsidebar.com/forums...ded&show=&st=& Link for full stardock set of weather icons is at bottom: http://www.desktopsidebar.com/forums...e=post&id=1489 That set includes the missing 33.png, among many others - unzip those into your gfx\weather folder overwriting what's there, if you're using UserWeather and don't have a full weather icon set. Seems to make S2U2 much happier - still not sure if/when the weather display is updated, will try and nail down some examples for A_C to test.TROUBLESHOOTING/INTERNATIONAL One user reports that the code used to automatically connect to the internet fails on his device. Changing the Connect() call as follows fixed it: Original line: Connect("The Internet") Change to: Connect("Internet") Try that if the script complains for the connect call. Original post: http://forum.xda-developers.com/show...&postcount=337 Attached is a mortscript that uses yahoo's weather rss feed to fetch the weather and put it in the right place,right format for S2U2 "userweather" - so you can have weather even if you don't have a weather app Unzip notiweather.zip, and then edit notiweather.mscr in a text editor... You NEED to edit the file before you put it on your pda - at the top are three settings: Code:
# USER SETTINGS, CHANGE AS DESIRED # how often to try and get the weather delayHours = 2 # your location (see http://developer.yahoo.com/weather/ on finding your location) location="95129" # desired units for temp, f or c units="f" You can launch the script manually or soft reset. The script uses the notification manager to run every delayHours and fetch your weather. It issues a Connect call to "The Internet" if no network connection is present. It formats the weather correctly and puts in in two registry locations: #for s2u2 UserWeather RegWriteString("HKCU", "\Software\A_C\S2U2\", "UserWeather", weather) #for rltoday RegWriteString("HKCU", "\Software\emerym\", "Weather", rlweather) If you are just using S2U2, all you need to do is edit your registry and add ShowWeather, DWORD 5. If you also use rltoday, you can use that second registry value in your skin.xml to get a string with the current weather + today (or tomorrow if after 4pm's) weather and hi temp Code:
<Registry x="119" y="52"key="key="HKEY_CURRENT_USER\Software\emerym\Weather" alignment="center"> </Registry> It's all working very well. Thanks to A_C for this great app! Lemme know if anyone runs into any issues. Change log: V 2.2: 15-01-2008 - use system paths from Mortscript to set up notifications V 2.1: 13-01-2008 - skip check if cell radio off, handle errors cleanly V 2: 22-12-2007 - first working version V 1: unreleased test version Last edited by schettj; 16th January 2008 at 06:20 PM.. |
| Sponsored Links |
|
#2
|
||||
|
||||
|
What version of Mortscript are you using? I'm using 4.1 and I got "DelayHours command unkown". 4.1 wants set DelayHours,2. So I assume we are using diffent versions.
Mike H |
|
#3
|
|||
|
|||
|
I'm on 4.1 and it works for me. Is it because it should be delayHours = 2 ?
__________________
Changed phone to LG-GM750 Don't have time to personalize phone but reasonable happy with it. |
|
#4
|
||||
|
||||
|
Quote:
Mike H |
|
#5
|
||||
|
||||
|
I put this mortscript on my device, and I do not get any errors, but nothing is displaying on my s2u2 lock screen. Do I need to wait for it to update?
|
|
#6
|
|||
|
|||
|
I am using SU2U version 0.97 and MortScript 4.1. When I launch manually, I could get the weather infor. On the other hand, the auto update always complains of Mortscript not being able to be run. I had set the updating to 1 hour internal. Not sure if there is a limitation on how ofter Mortscript could be run or that 2 hours is the lowest interval that I can set.
|
|
#7
|
|||
|
|||
|
It should "just work" with mortscript 4.1, however it depends on the installed mortscript being in a specific location.
For those who have problems, you might try editing the lines # kill any lingering notification RemoveNotifications("\Windows\MortScript.exe", "\Windows\Startup\notiweather.mscr" ) # set notify for myself at next time RunAt( utime, "\Windows\MortScript.exe", "\Windows\Startup\notiweather.mscr" ) Near the top. They're going to need to have the correct path to the Mortscript executable - mine is in the \Windows folder, but it could be \Program files\Mortscript or even somewhere on your storage card. |
|
#8
|
|||
|
|||
|
Quote:
I'm going to check tomorrow, I am pretty sure I can get rid of the path to the executable in the code - sloppy on my part, sorry! That's the hazard of releasing scripts you write for your own use ![]() |
|
#9
|
||||
|
||||
|
I am hoping this can get working...I miss having a temp on my phone. I used to be a big fan of weatherpanel, but it left a lot of undeletable junk on my phone.
I have MortScript 4.0, does that matter? Also, mine was in an A2DP folder, I just copied it to the windows folder. Just tried this, and still no luck. I am running WM5 with a Treo700wx. |
|
#10
|
||||
|
||||
|
OK...
I installed MortScript 4.1 and got this working. It gives me tongiht's forcast, but gives me a SUN with CLOUDS. It seems to be the wrong icon. Also, any way to edit this to display the current temparture. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|