aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/bin/assets/ScriptsAssetSet/osWeatherMap.lsl
diff options
context:
space:
mode:
authorSean Dague2008-06-18 19:38:30 +0000
committerSean Dague2008-06-18 19:38:30 +0000
commitb57b24655ca52f031aa87898ba8db132767523d0 (patch)
tree14586a06e4cff890a3ba72de129a57889ace8668 /bin/assets/ScriptsAssetSet/osWeatherMap.lsl
parentfix minor xml fubar. (diff)
downloadopensim-SC_OLD-b57b24655ca52f031aa87898ba8db132767523d0.zip
opensim-SC_OLD-b57b24655ca52f031aa87898ba8db132767523d0.tar.gz
opensim-SC_OLD-b57b24655ca52f031aa87898ba8db132767523d0.tar.bz2
opensim-SC_OLD-b57b24655ca52f031aa87898ba8db132767523d0.tar.xz
contribute weather map cycling script using osDynamicTextures.
Diffstat (limited to '')
-rw-r--r--bin/assets/ScriptsAssetSet/osWeatherMap.lsl43
1 files changed, 43 insertions, 0 deletions
diff --git a/bin/assets/ScriptsAssetSet/osWeatherMap.lsl b/bin/assets/ScriptsAssetSet/osWeatherMap.lsl
new file mode 100644
index 0000000..7dda87b
--- /dev/null
+++ b/bin/assets/ScriptsAssetSet/osWeatherMap.lsl
@@ -0,0 +1,43 @@
1default
2{
3 integer count = 0;
4 integer refreshRate = 300;
5 string URL1 = "http://icons.wunderground.com/data/640x480/2xus_rd.gif";
6 string URL2 = "http://icons.wunderground.com/data/640x480/2xus_sf.gif";
7 string URL3 = "http://icons.wunderground.com/data/640x480/2xus_st.gif";
8 string dynamicID="";
9 string contentType="image";
10
11 state_entry()
12 {
13 refresh_texture();
14 llSetTimerEvent(refreshRate); // create a "timer event" every 300 seconds.
15 }
16
17 timer()
18 {
19 refresh_texture();
20 }
21
22 touch_start(integer times)
23 {
24 refresh_texture();
25 }
26
27 void refresh_texture()
28 {
29 count++;
30 string url = "";
31 integer c = count % 3;
32
33 if (c == 0) {
34 url = URL1;
35 } else if (c == 1) {
36 url = URL2;
37 } else {
38 url = URL3;
39 }
40 // refresh rate is not yet respected here, which is why we need the timer
41 osSetDynamicTextureURL(dynamicID, contentType ,url , "", refreshRate );
42 }
43}