[Windows Mobile Apps and Games] XTREEM|RAGE:
@Holmanm or somebody :P

I still have some problems with my yahooweather v0.33. When it updates during the night it still unlock it self...sometimes...not all the time when it updates. I'm lost now, i really like the new stuff. But the old way worked perfectly. Here is my entire code, i hope some1 can see what i did wrong. or send me theirs if they have one that works perfectly ;):

# fetch weather from Yahoo, Parse, Update registry.
# Run every XX Hours
# Version 2.2 using Notification Queue, System Paths

# USER SETTINGS, CHANGE AS DESIRED

# how often to try and get the weather
delayHours = .5

# your location (see http://developer.yahoo.com/weather/ on finding your location)
location="NLXX0015"

# folder containing your weather wallpaper
wallpaperfolder = "\opslagkaart\my documents\download\wallpaper\weather\"

# wallpaper type jpg or gif
wallpapertype= ".jpg"

# desired units for temp, f or c
units="c"

# slideforecast is only if you are running s2u2 v 1.02 and up (otherwise do not change this)
# if you want no change to be made to the slide bar text then set slideforecast = 0 (default)
# if you want the daily forecast to be displayed on the slide bar then set slideforecast = 1
# if you want the current condition to be displayed on the slide bar then set slideforecast = 2
slideforecast = 1

GetTime(hour,min,sec,day,month,year)

# set up for next notification
utime = TimeStamp() + (delayHours*60)*60

mort = SystemPath("ScriptExe") & "\MortScript.exe"
script = SystemPath("ScriptPath") & "\" & SystemPath("ScriptName") & SystemPath("ScriptExt")

# kill any lingering notification
RemoveNotifications(mort, script)
# set notify for myself at next time
RunAt( utime, mort, script)

# Quietly ignore all errors
ErrorLevel("off")

# avoid registry writes if no change
curweather = RegRead("HKCU", "\Software\A_C\S2U2\", "UserWeather")
currlweather = RegRead("HKCU", "\Software\emerym\", "Weather")
curpic= RegRead("HKCU", "\Software\A_C\S2U2\", "wallpaper")
curforecast = SubStr(curpic,-6,2)
oldupdatetime = SubStr(curweather,-5,5)
weather = ""
rlweather = ""

FullHour=hour
If (FullHour<10)
FullHour= FullHour
endif

CurrentTime = Fullhour&":"&min

# only bother if cellular radio is on
radio = RegRead("HKLM", "\System\State\Phone", "Cellular System Available")
if (radio > 0)

# try to connect
if (not InternetConnected( "http://www.google.com"))
Sleep(30000)
Connect("Internet")
Sleep(10000)
endif

# do we have internet?
#if (InternetConnected( "http://www.google.com"))
raw = ReadFile("http://weather.yahooapis.com/forecastrss?p="&location&"&u="&units)

if (Length(raw) < 20)
# something wrong!
Exit
endif

# find current and today forcast
notDone = 0
# get tomorrow's weather if hour past 4pm (>15)
#if (hour > 15)
#notDone = -1
#endif
cond = ""
code = ""
ccond = ""
ccode = ""
temp = ""
lotemp = ""
hitemp = ""
tempat = ""
day = ""
wallpaper = ""
ForEach line in split(raw,"^LF^",1)
#<yweather:condition text="Mostly Cloudy" code="28" temp="39" date="Fri, 21 Dec 2007 7:53 am PST" />
if (notDone < 1)
if (Find(line,"<yweather:condition"))
CallFunction("getValue", ccond, line, "text")
CallFunction("getValue", ccode, line, "code")
CallFunction("getValue", temp, line, "temp")
else
#<yweather:forecast day="Fri" date="21 Dec 2007"low="34" high="55" text="Mostly Sunny" code="34" />
if (Find(line,"<yweather:forecast"))
notDone=notDone+1
CallFunction("getValue", cond, line, "text")
CallFunction("getValue", code, line, "code")
CallFunction("getValue", hitemp, line, "high")
CallFunction("getValue", lotemp, line, "low")
CallFunction("getValue", day, line, "day")
endif
endif
endif
EndForEach

if (notDone ne 1)
weather="W|0|Data|Error"
rlweather="Data Error"
else
weather="C|"&code&"|"&temp&"º H"&hitemp&"º\L"&lotemp&"º"&" Updated: "&oldupdatetime
if (hour > 15)
rlweather=ccond&" "&temp&" " &day&": " & cond & " "&hitemp
else
rlweather=ccond&" "&temp&" Today: " & cond & " "&hitemp
endif
endif
else
# we must be in a black hole
weather="W|0|No|Network"
rlweather="No Network"
endif

if (curweather ne weather)
#for s2u2 UserWeather
weather="C|"&code&"|"&temp&"º H"&hitemp&"º\L"&lotemp&"º"&" Updated: "&CurrentTime
RegWriteString("HKCU", "\Software\A_C\S2U2\", "UserWeather", weather)
if (ccode ne curforecast)
wallpaper=wallpaperfolder&ccode&wallpapertype
RegWriteString("HKCU", "\Software\A_C\S2U2\", "Wallpaper", wallpaper)
res2u2=0
if (WndActive("S2U2") = True)
res2u2=1
EndIf
Run("\Programmabestanden\S2U2\iLock2.exe","-refresh")
if (res2u2=1)
Run("\Programmabestanden\S2U2\s2u2.exe")
EndIf
endif
if (slideforecast ne 0)
if (slideforecast eq 1)
RegWriteString("HKCU", "\Software\A_C\S2U2\", "S2Utext", cond)
endif
if (slideforecast eq 2)
RegWriteString("HKCU", "\Software\A_C\S2U2\", "S2Utext", ccond)
endif
res2u2=0
if (WndActive("S2U2") = True)
res2u2=1
EndIf
Run("\Programmabestanden\S2U2\iLock2.exe","-refresh")
if (res2u2=1)
Run("\Programmabestanden\S2U2\s2u2.exe")
EndIf
endif
endif

# subroutine to pull value out of XML
Sub getValue
offset = Find(argv[1],argv[2]) + Length(argv[2])+2
endoff = find(argv[1], """", offset)
return(SubStr(argv[1], offset, endoff-offset)
EndSub